diff --git a/Application/Helper/CrossHubPropagation.hs b/Application/Helper/CrossHubPropagation.hs index 5477978..17c589a 100644 --- a/Application/Helper/CrossHubPropagation.hs +++ b/Application/Helper/CrossHubPropagation.hs @@ -42,7 +42,7 @@ detectPropagations hubs annotations widgets frictionScores = do (List.nub (mapMaybe (\a -> widgetHub a.widgetId) catAnnots)) qualHubs = [ hid | (hid, cnt) <- hubCounts, cnt >= 3 ] guard (length qualHubs >= 2) - let srcHub = head qualHubs + let srcHub = List.head qualHubs summary = "Annotation category '" <> cat <> "' concentrated in " <> show (length qualHubs) <> " hubs" -- Skip if open/acknowledged record already exists with same summary @@ -63,7 +63,7 @@ detectPropagations hubs annotations widgets frictionScores = do , fs.score >= frictionThreshold ] guard (length hubsWithHighFriction >= 2) - let srcHub = head hubsWithHighFriction + let srcHub = List.head hubsWithHighFriction summary = "Widget type '" <> wtype <> "' has high friction in " <> show (length hubsWithHighFriction) <> " hubs" guard (not (any (\p -> p.patternType == "widget_type_friction" && p.summary == summary) existing)) diff --git a/Web/Controller/Sessions.hs b/Web/Controller/Sessions.hs index ce8b45f..26463ac 100644 --- a/Web/Controller/Sessions.hs +++ b/Web/Controller/Sessions.hs @@ -27,7 +27,7 @@ instance Controller SessionsController where redirectTo NewSessionAction action DeleteSessionAction = do - currentUserOrNothing @User >>= \case + case currentUserOrNothing @User of Just user -> logout user >> redirectTo NewSessionAction Nothing -> redirectTo NewSessionAction