refactor: hlint

This commit is contained in:
Gregor Kleen 2021-05-04 19:40:50 +02:00
parent 3c7434479f
commit c2212a86e6
2 changed files with 9 additions and 25 deletions

View File

@ -271,8 +271,7 @@ yesod:test:hlint:
before_script: *haskell before_script: *haskell
script: script:
- stack install hlint - stack install hlint
- stack exec -- hlint --cc src > gl-code-quality-report.json - stack exec -- hlint --cc src > gl-code-quality-report.json || jq . gl-code-quality-report.json
- jq . gl-code-quality-report.json
artifacts: artifacts:
paths: paths:
@ -307,8 +306,7 @@ yesod:test:hlint:dev:
before_script: *haskell before_script: *haskell
script: script:
- stack install hlint - stack install hlint
- stack exec -- hlint --cc src > gl-code-quality-report.json - stack exec -- hlint --cc src > gl-code-quality-report.json || jq . gl-code-quality-report.json
- jq . gl-code-quality-report.json
artifacts: artifacts:
paths: paths:

View File

@ -1132,27 +1132,13 @@ instance Binary userid => Binary (WorkflowRole userid)
instance (Binary fileid, Binary userid, Typeable fileid, Typeable userid) => Binary (WorkflowAction fileid userid) instance (Binary fileid, Binary userid, Typeable fileid, Typeable userid) => Binary (WorkflowAction fileid userid)
instance (Binary fileid, Binary userid, Typeable fileid, Typeable userid) => Binary (WorkflowFieldPayloadW fileid userid) where instance (Binary fileid, Binary userid, Typeable fileid, Typeable userid) => Binary (WorkflowFieldPayloadW fileid userid) where
get = do get = Binary.get >>= \case
tag <- Binary.get WFPText' -> WorkflowFieldPayloadW . WFPText <$> Binary.get
case tag of WFPNumber' -> WorkflowFieldPayloadW . WFPNumber <$> Binary.get
WFPText' -> do WFPBool' -> WorkflowFieldPayloadW . WFPBool <$> Binary.get
t <- Binary.get WFPDay' -> WorkflowFieldPayloadW . WFPDay <$> Binary.get
return $ WorkflowFieldPayloadW $ WFPText t WFPFile' -> WorkflowFieldPayloadW . WFPFile <$> Binary.get
WFPNumber' -> do WFPUser' -> WorkflowFieldPayloadW . WFPUser <$> Binary.get
n <- Binary.get
return $ WorkflowFieldPayloadW $ WFPNumber n
WFPBool' -> do
b <- Binary.get
return $ WorkflowFieldPayloadW $ WFPBool b
WFPDay' -> do
d <- Binary.get
return $ WorkflowFieldPayloadW $ WFPDay d
WFPFile' -> do
fid <- Binary.get
return $ WorkflowFieldPayloadW $ WFPFile fid
WFPUser' -> do
uid <- Binary.get
return $ WorkflowFieldPayloadW $ WFPUser uid
put = \case put = \case
WorkflowFieldPayloadW (WFPText t ) -> Binary.put WFPText' >> Binary.put t WorkflowFieldPayloadW (WFPText t ) -> Binary.put WFPText' >> Binary.put t
WorkflowFieldPayloadW (WFPNumber n ) -> Binary.put WFPNumber' >> Binary.put n WorkflowFieldPayloadW (WFPNumber n ) -> Binary.put WFPNumber' >> Binary.put n