linear-types icon indicating copy to clipboard operation
linear-types copied to clipboard

Proposed experiment - build stackage with some linear prelude types

Open rrnewton opened this issue 8 years ago • 4 comments

How to show that a linear extension is backwards compatible? One way to substantiate that claim is to actually build large amounts of code with it.

I.e. if we replace the type of (++) in the prelude, does all of stackage still build?

This experiment is so simple that maybe we can even do it for this submission.

rrnewton avatar Jul 01 '17 02:07 rrnewton

Almost certainly not, unfortunately. There will be a need of eta-expanding the function here and there.

Of course we can do

(++') :: [a] -o [a] -o [a]
(++) :: [a] -> [a] -> [a]
a ++ b = a ++' b

Which proves, at least, that we can have both types hanging about with minimal boilerplate.

aspiwack avatar Jul 03 '17 08:07 aspiwack

Oh, that's too bad.... what about something smaller. What about building nofib?

rrnewton avatar Jul 03 '17 15:07 rrnewton

So building base and nofib? There will probably be a few eta-expansions to do along the way. Would that be acceptable? If so, then yes, we could do it.

aspiwack avatar Jul 03 '17 15:07 aspiwack

Sure! I think it still sounds somewhat convincing -- we build N lines of legacy code where N is in the thousands!

rrnewton avatar Jul 03 '17 15:07 rrnewton