From b289dee25ad8ce4c2622fadb2f4c31fb90914b39 Mon Sep 17 00:00:00 2001 From: Ben Sima Date: Fri, 29 Jan 2021 02:37:14 -0500 Subject: Lint 'return' into 'pure', replace bind operator --- Hero/Node.hs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'Hero/Node.hs') diff --git a/Hero/Node.hs b/Hero/Node.hs index e7eb687..a453a01 100644 --- a/Hero/Node.hs +++ b/Hero/Node.hs @@ -193,7 +193,7 @@ move ValidateUserPassword form = doLogin = do user <- getValue =<< Document.getElementById "user" pass <- getValue =<< Document.getElementById "pass" - sendLogin (ms user) (ms pass) >>= \case + sendLogin (ms user) (ms pass) +> \case Network.Success _ -> pure NoOp -- TODO: handle these error cases Network.Loading -> pure NoOp @@ -202,7 +202,7 @@ move ValidateUserPassword form = fetchComics :: IO (Network.RemoteData MisoString [Comic]) fetchComics = - Ajax.xhrByteString req /> Ajax.contents >>= \case + Ajax.xhrByteString req /> Ajax.contents +> \case Nothing -> pure <| Network.Failure "Could not fetch comics from server." Just json -> @@ -231,7 +231,7 @@ sendLogin :: User ) sendLogin u p = - Ajax.xhrByteString req /> Ajax.contents >>= \case + Ajax.xhrByteString req /> Ajax.contents +> \case Nothing -> pure <| Network.Failure "Could not send login request." Just json -> -- cgit v1.2.3