checkResult :: forall (m :: * -> *). (Monad m) => Text -> m Bool -> m (Maybe Text) checkResult msg f = do result <- f return $ if result then Nothing else (Just msg) class Validatable a where validate :: forall master. (SqlBackend ~ YesodPersistBackend master, YesodPersist master, ~{moduleName m}Interface master) => a -> HandlerT master IO [Text] class Yesod master => ~{moduleName m}Interface master where