3 ms·
> There is no special syntax for applicative functors because it is hardly necessary. You just write > readHeader = liftA3 Header get get get Seeing Haskell
by tom_mellior 7y ago
> There is no special syntax for applicative functors because it is hardly necessary. You just write
> readHeader = liftA3 Header get get get
Seeing Haskell code peppered with liftM_ and similar things is one of the main problems I have with the language. Monads (and applicatives etc.) solve a problem, one might even say that they solve it well, but I've never found that they solve it ergonomically.
- kqr 7y agoYes, I think you have a key point there. Using the same-ish syntax for effects as for pure code is a tricky problem of ergonomics: get it too similar/implicit, and people will be confused about when effects happen and when pure code runs. Get it too dissimilar/explicit, and it gets cumbersome to write. I actually think do notation hits a great middle point, where it's obvious you're in effectful code, yet familiar and similar enough to pure expressions to be convenient.
- deleted 7y ago[deleted]