From c019ffde1b35cda5139ca65c80265603c23cd7b9 Mon Sep 17 00:00:00 2001 From: Cypher Date: Tue, 3 May 2022 15:19:21 -0500 Subject: Apply linting --- src/Ssb/Feed.hs | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) (limited to 'src/Ssb/Feed.hs') diff --git a/src/Ssb/Feed.hs b/src/Ssb/Feed.hs index ebdd2f4..57547a9 100644 --- a/src/Ssb/Feed.hs +++ b/src/Ssb/Feed.hs @@ -1,5 +1,3 @@ -{-# LANGUAGE GeneralisedNewtypeDeriving #-} - module Ssb.Feed where import Protolude hiding ( Identity @@ -220,7 +218,7 @@ withoutSignature buf = $ snd $ BS.breakSubstring (BS.reverse signaturePattern) (BS.reverse buf) where - appendToEnd = \x y -> BS.append y x + appendToEnd = flip BS.append signaturePattern = ",\n \"signature\":" newVerifiableMessage @@ -251,9 +249,9 @@ atMayFeed i (Feed _ msgs) = atMay msgs i -- verification fails. append :: ToJSON a => Feed a -> VerifiableMessage a -> Either Text (Feed a) append (Feed id msgs) msg = do - if (verify id msg) - then (return (Feed id (msgs ++ [msg]))) - else (error "verification failed") + if verify id msg + then return (Feed id (msgs ++ [msg])) + else error "verification failed" appendContent :: ToJSON a => Feed a -> a -> IO (Either Text (Feed a)) appendContent (Feed id msgs) content = do @@ -290,9 +288,9 @@ signMessage id msg = do msg { signature = Just signature } return $ do vMsg' <- vMsg - if (verify id vMsg') - then (return vMsg') - else (error "signing failed verification") + if verify id vMsg' + then return vMsg' + else error "signing failed verification" Left err -> return $ error err verify :: ToJSON a => Identity -> VerifiableMessage a -> Bool -- cgit v1.2.3