flâneur — a map of the web's best reading

Writing an OS in Haskell - agniv sarkar : r/haskell

reddit.com · 6 words · saved by 1 readers

In GHC, IO (Maybe a) would allocate and pattern match at every step, so forall r. r -> (a -> r) -> IO r is more efficient. Does MicroHS have the same issue? MicroHs allocates all the time. There is no way to avoid it. It's part of the paradigm when using combinators. It's one of the big drawbacks. Even the simplest execution allocates. Are you sure? I haven't checked, but I'm pretty sure your case just trades it for closure allocation. 🤷 I'm mostly speaking from common talking points of using CPS to avoid pattern matching at every bind: https://wiki.haskell.org/Performance/Monads Well, the wiki page has this: MaybeCPS should be faster than using Maybe in most cases and should be almost a drop in replacement for Maybe. Unfortunately, this may not necessarily be true. And the conversation from the link seems to confirm my suspicion. I wonder if it's specific to Maybe, and maybe the optimization only works for Either 300% penalty is a lot. Do effect systems have a similar performance hit

Reddit - Please wait for verification

Explore this link on the map →

related reading