refactor: hlint

This commit is contained in:
Gregor Kleen 2021-01-27 22:22:12 +01:00
parent cb0d528924
commit c7c4f50f5b
3 changed files with 3 additions and 5 deletions

View File

@ -568,7 +568,7 @@ appMain = runResourceT $ do
void . runMaybeT $ do void . runMaybeT $ do
results <- hoistMaybe mResults results <- hoistMaybe mResults
let latestResults = Map.fromListWith (flip const) $ Set.toAscList results let latestResults = Map.fromListWith (\_ x -> x) $ Set.toAscList results
Min status <- hoistMaybe $ ofoldMap1 (Min . healthReportStatus) <$> fromNullable latestResults Min status <- hoistMaybe $ ofoldMap1 (Min . healthReportStatus) <$> fromNullable latestResults
$logInfoS "NotifyStatus" $ toPathPiece status $logInfoS "NotifyStatus" $ toPathPiece status
liftIO . void . Systemd.notifyStatus . unpack $ toPathPiece status liftIO . void . Systemd.notifyStatus . unpack $ toPathPiece status

View File

@ -388,9 +388,7 @@ workflowWorkflowList (title, heading) WWListColumns{..} sqlPred = do
viewActors <- hoistMaybe $ preview _wgeViewActor =<< mVia viewActors <- hoistMaybe $ preview _wgeViewActor =<< mVia
guardM $ anyM (otoList viewActors) hasWorkflowRole' guardM $ anyM (otoList viewActors) hasWorkflowRole'
resUser <- lift . lift $ traverse getEntity wpUser' resUser <- lift . lift $ traverse getEntity wpUser'
return $ case resUser of return $ maybe JsonWorkflowUserAnonymous toJsonUser resUser
Just mEnt -> toJsonUser mEnt
Nothing -> JsonWorkflowUserAnonymous
payload <- do payload <- do
payload' <- fmap Map.fromList . forMaybeM (Map.toList currentPayload) $ \x@(payloadLbl, _) -> x <$ do payload' <- fmap Map.fromList . forMaybeM (Map.toList currentPayload) $ \x@(payloadLbl, _) -> x <$ do

View File

@ -465,7 +465,7 @@ assertMonoid f x = guardMonoid (f x) x
maybeMonoid :: Monoid m => Maybe m -> m maybeMonoid :: Monoid m => Maybe m -> m
-- ^ Identify `Nothing` with `mempty` -- ^ Identify `Nothing` with `mempty`
maybeMonoid = maybe mempty id maybeMonoid = fromMaybe mempty
------------ ------------
-- Tuples -- -- Tuples --