3 ms·
Sorry, but you cannot write malloc in linear Haskell. I wish you could too.
by Ericson2314 6y ago
Sorry, but you cannot write malloc in linear Haskell. I wish you could too.
- whateveracct 6y agoI could mmap some virtual memory and write malloc's API to allocate chunks, kept safe by linear haskell I can write a variety of memory allocators, kept safe by linear haskell more generally, anything you can do in C, you can do in Haskell. So malloc is fair game (although i'd just call the C one from Haskell)
- Ericson2314 6y agoNo I mean linear arrows vs linear kinds means you can't write malloc without CPSing.
- whateveracct 6y agoyeah i don't especially expect that to matter in practice. monads used to require CPSing all over the place too.