fix: non-exhaustive patterns

This commit is contained in:
Gregor Kleen 2020-01-30 08:31:52 +01:00
parent 6a7442728f
commit 5bff34ed0a
2 changed files with 2 additions and 3 deletions

View File

@ -83,7 +83,7 @@ getEShowR tid ssh csh examn = do
showCloseWidget = lecturerInfoShown
showAutoOccurrenceCalculateWidget = lecturerInfoShown
sumMaxPoints = sum [ fromRational examPartWeight * mPoints | Entity _ ExamPart{..} <- examParts, let Just mPoints = examPartMaxPoints ]
sumMaxPoints = sum [ fromRational examPartWeight * mPoints | Entity _ ExamPart{..} <- examParts, mPoints <- examPartMaxPoints ^.. _Just ]
noBonus = fromMaybe False $ do
guardM $ bonusOnlyPassed <$> examBonusRule

View File

@ -249,8 +249,7 @@ examAutoOccurrence (hash -> seed) rule ExamAutoOccurrenceConfig{..} occurrences
= Map.fromListWith Set.union
[ (map CI.mk $ unpack matriculation', Set.singleton uid)
| (uid, (User{..}, Nothing)) <- Map.toList users
, let Just matriculation' = userMatrikelnummer
, not $ null matriculation'
, matriculation' <- userMatrikelnummer ^.. _Just . filtered (not . null)
]
in Map.mapKeysWith Set.union (take . F.minimum . Set.map length $ Map.keysSet matrUsers) matrUsers
_ -> Map.singleton [] $ Map.keysSet users