[Haskell-cafe] an idea for modifiyng data/newtype syntax: use `::=` instead of `=`

Tom Ellis tom-lists-haskell-cafe-2013 at jaguarpaw.co.uk
Sat Aug 8 14:41:28 UTC 2015


On Sat, Aug 08, 2015 at 03:33:35PM +0100, Tom Ellis wrote:
> On Sat, Aug 08, 2015 at 04:23:15PM +0200, Corentin Dupont wrote:
> > One thing I quite don't understand is: do we really need to make the
> > newtype/data distinction explicit?
> 
> I'm pretty sure we don't.
> 
>  newtype N = N A
> 
> defines a datatype isomorphic to
> 
>  data D = D !A
> 
> but you have to use it slightly differently, that's all.  I wrote more about
> this here:

Correction:

    http://stackoverflow.com/questions/21327740/strict-single-constructor-single-field-data-declaration-vs-newtype/21331284#21331284

(My previous post linked to the previous revisions of the answer!)


More information about the Haskell-Cafe mailing list