# Pastebin 1sjEEDOV data Validation e a = Error [e] | OK a deriving Functor instance Applicative (Validation e) where pure = OK Error e1 <*> Error e2 = Error (e1 <> e2) Error e1 <*> OK _ = Error e1 OK _ <*> Error e2 = Error e2 OK f <*> OK x = OK (f x)