DEV Community

Discussion on: Applicative functors in Haskell

Collapse
 
swizzard profile image
sam • Edited

I don't think your Either example will work as written--since you're using <>, you need something like

Monoid e => instance Applicative (Either e) where
    ...
    Left e1 <*> Left e2 = Left (e1 <> e2)