DEV Community

loading...

Discussion on: Applicative functors in Haskell

Collapse
swizzard profile image
sam

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)