refactor: hlint

This commit is contained in:
Wolfgang Witt 2021-04-06 15:31:37 +02:00 committed by Gregor Kleen
parent 7896c0bb16
commit ebe676d39d
2 changed files with 3 additions and 3 deletions

View File

@ -48,12 +48,12 @@ postCFavouriteR tid ssh csh = void $ do
now <- liftIO getCurrentTime
-- Nothing means blacklist
-- should never return FavouriteCurrent
newReason <- storedFavouriteReason tid ssh csh muid >>= pure . \case
newReason <- storedFavouriteReason tid ssh csh muid <&> (\case
-- Maybe (Maybe reason, blacklist)
Nothing -> Just FavouriteManual
Just (_reason, True) -> Just FavouriteVisited
Just (Just FavouriteManual, False) -> Nothing
Just (_reason, False) -> Just FavouriteManual
Just (_reason, False) -> Just FavouriteManual)
-- change stored reason in DB
case newReason of
(Just reason) -> do

View File

@ -47,7 +47,7 @@ instance Button UniWorX CourseFavouriteToggleButton where
-- inspired by examAutoOccurrenceIgnoreRoomsForm
courseFavouriteToggleForm :: Maybe FavouriteReason -> Form ()
courseFavouriteToggleForm currentReason html
= over _1 (fmap $ const ()) <$> identifyForm FIDCourseFavouriteToggle (buttonForm' [btn]) html
= over _1 void <$> identifyForm FIDCourseFavouriteToggle (buttonForm' [btn]) html
where
btn :: CourseFavouriteToggleButton
btn = case currentReason of