Unpacking sum types

Simon Peyton Jones simonpj at microsoft.com
Mon Sep 7 19:25:57 UTC 2015


| Are we okay with stealing some operator sections for this? E.G. (x
| ||). I think the boxed sums larger than 2 choices are all technically
| overlapping with sections.

I hadn't thought of that.  I suppose that in distfix notation we could require spaces
   (x | |)
since vertical bar by itself isn't an operator.  But then (_||) x might feel more compact.

Also a section (x ||) isn't valid in a pattern, so we would not need to require spaces there.

But my gut feel is: yes, with AnonymousSums we should just steal the syntax.  It won't hurt existing code (since it won't use AnonymousSums), and if you *are* using AnonymousSums then the distfix notation is probably more valuable than the sections for an operator you probably aren't using.

I've updated the wiki page

Simon

| -----Original Message-----
| From: Dan Doel [mailto:dan.doel at gmail.com]
| Sent: 07 September 2015 18:53
| To: Simon Peyton Jones
| Cc: Johan Tibell; Simon Marlow; Ryan Newton; ghc-devs at haskell.org
| Subject: Re: Unpacking sum types
| 
| Are we okay with stealing some operator sections for this? E.G. (x
| ||). I think the boxed sums larger than 2 choices are all technically
| overlapping with sections.
| 
| On Mon, Sep 7, 2015 at 10:35 AM, Simon Peyton Jones
| <simonpj at microsoft.com> wrote:
| > Good start.
| >
| >
| >
| > I have updated the page to separate the source-language design (what
| the
| > programmer sees) from the implementation.
| >
| >
| >
| > And I have included boxed sums as well – it would be deeply strange not
| to
| > do so.
| >
| >
| >
| > Looks good to me!
| >
| >
| >
| > Simon
| >
| >
| >
| > From: Johan Tibell [mailto:johan.tibell at gmail.com]
| > Sent: 01 September 2015 18:24
| > To: Simon Peyton Jones; Simon Marlow; Ryan Newton
| > Cc: ghc-devs at haskell.org
| > Subject: RFC: Unpacking sum types
| >
| >
| >
| > I have a draft design for unpacking sum types that I'd like some
| feedback
| > on. In particular feedback both on:
| >
| >
| >
| >  * the writing and clarity of the proposal and
| >
| >  * the proposal itself.
| >
| >
| >
| > https://ghc.haskell.org/trac/ghc/wiki/UnpackedSumTypes
| >
| >
| >
| > -- Johan
| >
| >
| >
| >
| > _______________________________________________
| > ghc-devs mailing list
| > ghc-devs at haskell.org
| > http://mail.haskell.org/cgi-bin/mailman/listinfo/ghc-devs
| >


More information about the ghc-devs mailing list