2 ms·
You can still do a lot with applicatives, like parsing context-free languages... and even parsing context-sensitive languages. https://byorgey.wordpress.com/20
by mbrock 10y ago
You can still do a lot with applicatives, like parsing context-free languages... and even parsing context-sensitive languages.
https://byorgey.wordpress.com/2012/01/05/parsing-context-sensitive-languages-with-applicative/ https://byorgey.wordpress.com/2012/01/05/parsing-context-sen...
But yeah.
ApplicativeDo might be useful. You would be able to see the static applicative structure as far as the next monadic bind, which lets you do interesting types of optimization, e.g. Haxl.
https://ghc.haskell.org/trac/ghc/wiki/ApplicativeDo https://ghc.haskell.org/trac/ghc/wiki/ApplicativeDo
https://github.com/facebook/Haxl https://github.com/facebook/Haxl
- lmm 10y agoThe thing is we're used to thinking in monads, and used to thinking of certain constructs as equivalent, which ApplicativeDo would break. There's a real tension between being explicit about the performance - in which case many identities no longer hold - and not. I don't know what Haxl itself does, but Fetch (which claims to be a Scala port) is kind of unsatisfactory in that regard.