[Haskell-cafe] an idea for modifiyng data/newtype syntax: use `::=` instead of `=`
Brandon Allbery
allbery.b at gmail.com
Sat Aug 8 21:20:00 UTC 2015
On Sat, Aug 8, 2015 at 5:16 PM, Tom Ellis <
tom-lists-haskell-cafe-2013 at jaguarpaw.co.uk> wrote:
> On Sat, Aug 08, 2015 at 05:13:30PM -0400, Brandon Allbery wrote:
> > On Sat, Aug 8, 2015 at 5:11 PM, Tom Ellis <
> > tom-lists-haskell-cafe-2013 at jaguarpaw.co.uk> wrote:
> >
> > > No, not at all. I'm making a much stronger claim than that. I'm
> claiming
> > > the functionality provided by newtype is completely subsumed by that
> > > provided by data.
> >
> > When did `data` start guaranteeing that the representation of a single
> > constructor, strict `data' wrapper around another type is exactly the
> same
> > as the wrapped type?
>
> I make no claims about the operational semantics of existing compilers, but
> can you point out a reason why data of a single strict field *shuoldn't* be
> compiled in the same way as a newtype?
Because it's a bizarre special case compared to the way `data` works for
everything else?
Also, the behavior I described is not something that can just be ignored as
an optimization in a particular compiler. It is part of the language
specification. In fact, it is the *primary reason* for the existence of
`newtype`.
--
brandon s allbery kf8nh sine nomine associates
allbery.b at gmail.com ballbery at sinenomine.net
unix, openafs, kerberos, infrastructure, xmonad http://sinenomine.net
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.haskell.org/pipermail/haskell-cafe/attachments/20150808/06b899fd/attachment.html>
More information about the Haskell-Cafe
mailing list