Re:GHC 9.0, supporting linear types
by whateveracct on Wednesday December 30, 2020 @03:02PM
(#25585403)
They'd mostly be used for creating a pure API around any mutability under the hood
But we already had ST for that, so the real advantage of LTs over ST is you can type-safely "freeze" and "thaw" your mutable structure without copying.
The mutable array example in the Linear Haskell paper is a simple comparison to what you're asking for.
But we already had ST for that, so the real advantage of LTs over ST is you can type-safely "freeze" and "thaw" your mutable structure without copying.
The mutable array example in the Linear Haskell paper is a simple comparison to what you're asking for.