4 ms·
I don't understand how ghc linear types allows allocation-free code. GHC'ss linear types don't give you uniqueness types in the same way rust does
by platz 6y ago
I don't understand how ghc linear types allows allocation-free code. GHC'ss linear types don't give you uniqueness types in the same way rust does
- zetalemur 6y ago> GHC'ss linear types don't give you uniqueness types in the same way rust does Why, though? Is it because GHC's linear types are a superset of Rust's linear types? I guess that could rule out some features the compiler is able to prove (or not).
- platz 6y agoGHC models linearity differently. Rust puts linearity on the types, GHC puts linearity on the arrows. https://i.imgur.com/s0Mxhcr_d.webp?maxwidth=640&shape=thumb&fidelity=medium https://i.imgur.com/s0Mxhcr_d.webp?maxwidth=640&shape=thumb&...
- senorsmile 6y agoIs Idris 2's linearity the same as Haskell's in this respect?
- platz 6y agoyes
- whateveracct 6y agoYou can use them to write much safer off-heap memory management APIs in userspace. But GHC can't do anything for free, no.