[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:33:35 UTC 2015


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:

    http://stackoverflow.com/posts/21331284/revisions

Tom


More information about the Haskell-Cafe mailing list