From f0d0e7444ac9267a85de3480f7d7c01d958914e0 Mon Sep 17 00:00:00 2001 From: Gregor Kleen Date: Mon, 12 Aug 2019 17:18:05 +0200 Subject: [PATCH] refactor: hlint --- src/Handler/Course/List.hs | 12 ++++++------ src/Utils.hs | 9 ++------- 2 files changed, 8 insertions(+), 13 deletions(-) diff --git a/src/Handler/Course/List.hs b/src/Handler/Course/List.hs index f2bab2d7c..4a29f3851 100644 --- a/src/Handler/Course/List.hs +++ b/src/Handler/Course/List.hs @@ -197,13 +197,13 @@ getTermCurrentR :: Handler Html getTermCurrentR = do termIds <- runDB $ selectKeysList [TermActive ==. True] [Desc TermName] case fromNullable termIds of - Nothing -> notFound - (Just (maximum -> tid)) -> - redirect $ (CourseListR, [("courses-term", toPathPiece tid)]) -- redirect avoids problematic breadcrumbs, headings, etc. + Nothing + -> notFound + Just (maximum -> tid) + -> redirect (CourseListR, [("courses-term", toPathPiece tid)]) -- redirect avoids problematic breadcrumbs, headings, etc. getTermSchoolCourseListR :: TermId -> SchoolId -> Handler Html -getTermSchoolCourseListR tid ssh = redirect $ (CourseListR, [("courses-term", toPathPiece tid), ("courses-schoolshort", toPathPiece ssh)]) - +getTermSchoolCourseListR tid ssh = redirect (CourseListR, [("courses-term", toPathPiece tid), ("courses-schoolshort", toPathPiece ssh)]) getTermCourseListR :: TermId -> Handler Html -getTermCourseListR tid = redirect $ (CourseListR, [("courses-term", toPathPiece tid)]) +getTermCourseListR tid = redirect (CourseListR, [("courses-term", toPathPiece tid)]) diff --git a/src/Utils.hs b/src/Utils.hs index e284921da..795787841 100644 --- a/src/Utils.hs +++ b/src/Utils.hs @@ -676,13 +676,8 @@ peekN n = do -- Alternative -- ----------------- --- Linter complains to use asum instead, but requires a more specific type signature: --- choice :: forall f mono a. (Alternative f, MonoFoldable mono, Element mono ~ f a) => mono -> f a --- choice = foldr (<|>) empty -choice :: (Foldable t, Alternative f) => t (f a) -> f a -choice = asum -- - - +choice :: forall f mono a. (Alternative f, MonoFoldable mono, Element mono ~ f a) => mono -> f a +choice = foldr (<|>) empty -------------- -- Sessions --