Oneshot eta-expanding of Sem #285
Labels
enhancement
New feature or request
polish
make the libary joyful t use
question
Further information is requested
Milestone
I was reading this https://www.joachim-breitner.de/blog/763-Faster_Winter_5__Eta-Expanding_ReaderT, and it mentions using
oneShot
to convince GHC to float lambdas out. I suspect this is why the common pattern in polysemy offoo (Sem m) = Sem $ \k -> m $ \u -> blah
performs better than the naivefoo = runSem $ \u -> blah
.We can probably clean up a lot of this roundabout code by doing the same thing, and putting
oneShot
into the common combinators.The text was updated successfully, but these errors were encountered: