I have the following value and its signature
type JsonResponse = Affjax.AffjaxResponse Json
getUser :: forall e m. (MonadAff (ajax :: Affjax.AJAX | e) m) => String -> m (Either Error JsonResponse)
getUser user = liftAff $ attempt $ Affjax.get $ "http://someservice.com?user=" ++ user
Now I want to use that in combination with a Maybe
. Easy enough just use map
(or the alias operator)
applyUser' = getUser <$> Just "Bob"