[ghc-steering-committee] Proposal #111: Linear Types
Simon Peyton Jones
simonpj at microsoft.com
Tue Aug 28 16:17:26 UTC 2018
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.
It's hard to argue that a different way of integrating linear types into Haskell could not be superior. Perhaps it could! But we can't tell without saying what that different way is.
Later Iavor says
I am not really making a proposal, but I was suggesting that it might be a simpler way to at least start experimenting with the proposal, without having to change the types of core Haskell concepts.
What is "it" that might be simpler? I genuinely want to understand what you have in mind, because I want to be sure that I'm thinking about the same design choices that you are.
Simon
From: Richard Eisenberg <rae at cs.brynmawr.edu>
Sent: 28 August 2018 14:27
To: Simon Peyton Jones <simonpj at microsoft.com>
Cc: Iavor Diatchki <iavor.diatchki at gmail.com>; ghc-steering-committee <ghc-steering-committee at haskell.org>
Subject: Re: [ghc-steering-committee] Proposal #111: Linear Types
On Aug 28, 2018, at 6:49 AM, Simon Peyton Jones <simonpj at microsoft.com<mailto: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/f0270884/attachment-0001.html>
More information about the ghc-steering-committee
mailing list