jaspervdj / digestive-functors

A general way to consume input using applicative functors
149 stars 71 forks source link

Result is not a lawful Monad #147

Open benjamin-hodgson opened 7 years ago

benjamin-hodgson commented 7 years ago

Result's Monad instance violates the (<*>) = ap law.

ghci> Error "a" `ap` Error "b"
Error "a"
ghci> Error "a" <*> Error "b"
Error "ab"

This is a potential "gotcha" and it should at least be documented.