[ghc-steering-committee] Proposal #111: Linear Types

Richard Eisenberg rae at cs.brynmawr.edu
Tue Aug 28 13:26:45 UTC 2018



> On Aug 28, 2018, at 6:49 AM, Simon Peyton Jones <simonpj at microsoft.com> wrote:
> 
> Is this essentially proposing that we don't make any change to datatypes? That would mean that a library that wishes to have linear datatypes would have to explicitly declare them as such. I think this is a stable middle ground.
>  
> Are you proposing that pairs, lists, Maybe etc all have non-linear types? 

I'm not proposing this -- I was trying to interpret Iavor's paragraph:

> Overall, while I like the core ideas, I would prefer a different way of integrating them into Haskell, one that is more modular, even at the cost of having to duplicate some code.  My reasoning is that while linearity might be useful in some cases, most of the time it is not something that we'd care about much, so we should not add it (at least straight away) to the core part of the language (functions and data types).


My "stable middle ground" comment is that such a design would work: be type-safe, expressive, etc. I don't think it's ergonomic, for the reasons you describe.
>  
> I think we want both (Just :: a -o Maybe a) and (fromJust :: Maybe a -o a); but suppressing the lollipops when printing for the user unless -XLinear is on.

Why fromJust? My understanding is that this proposal comes with no changes to `base`, meaning we would retain the existing fromJust.

Richard
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.haskell.org/pipermail/ghc-steering-committee/attachments/20180828/7ab30091/attachment.html>


More information about the ghc-steering-committee mailing list