MINOR linter problems and curried rowWdgt -> uncurried rowWgt (obfuscates my Anwer to Felix' question, hence different commit)
This commit is contained in:
parent
939db750d2
commit
291064c03b
@ -196,8 +196,8 @@ postAdminTestR = do
|
||||
allowAdd _ _ l = l < 7 -- Limit list length; much more complicated checks are possible (this could in principle be monadic, but @massInput@ is probably already complicated enough to cover just current (2019-03) usecases)
|
||||
|
||||
-- The actual call to @massInput@ is comparatively simple:
|
||||
|
||||
((miResult, (fvInput -> miForm)), miEnc) <- runFormPost . identifyForm ("massinput" :: Text) $ massInput (MassInput mkAddForm mkCellForm deleteCell allowAdd) "" True Nothing
|
||||
|
||||
((miResult, fvInput -> miForm), miEnc) <- runFormPost . identifyForm ("massinput" :: Text) $ massInput (MassInput mkAddForm mkCellForm deleteCell allowAdd) "" True Nothing
|
||||
|
||||
|
||||
let locallyDefinedPageHeading = [whamlet|Admin TestPage for Uni2work|]
|
||||
|
||||
@ -25,7 +25,7 @@ gradeSummaryWidget title sts =
|
||||
hasMarkedPasses = positiveSum $ numMarkedPasses sumSummaries
|
||||
hasPoints = positiveSum $ numSheetsPoints sumSummaries
|
||||
hasMarkedPoints = positiveSum $ numMarkedPoints sumSummaries
|
||||
rowWdgt sumHeader summary = $(widgetFile "widgets/grading-summary/grading-summary-row") -- diese Funktonsdefinition darf leider nicht im .hamlet stehen!
|
||||
rowWgt (sumHeader, summary) = $(widgetFile "widgets/grading-summary/grading-summary-row") -- diese Funktonsdefinition darf leider nicht im .hamlet stehen!
|
||||
rowsShown = [ (MsgSheetTypeNormal' ,normalSummary)
|
||||
, (MsgSheetTypeBonus' ,bonusSummary)
|
||||
, (MsgSheetTypeInformational' ,informationalSummary)
|
||||
|
||||
11
src/Utils.hs
11
src/Utils.hs
@ -591,12 +591,19 @@ mconcatMapM f = foldM (\x my -> mappend x <$> my) mempty . map f . Fold.toList
|
||||
mconcatForM :: (Monoid b, Monad m, Foldable f) => f a -> (a -> m b) -> m b
|
||||
mconcatForM = flip mconcatMapM
|
||||
|
||||
|
||||
|
||||
-----------------
|
||||
-- Alternative --
|
||||
-----------------
|
||||
|
||||
choice :: forall f mono a. (Alternative f, MonoFoldable mono, Element mono ~ f a) => mono -> f a
|
||||
choice = foldr (<|>) empty
|
||||
-- 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 --
|
||||
|
||||
|
||||
|
||||
--------------
|
||||
-- Sessions --
|
||||
|
||||
@ -24,8 +24,8 @@ $# --
|
||||
<th .table__th>_{MsgSheetGradingPoints'}
|
||||
<th .table__th>_{MsgSheetGradingCount'}
|
||||
$# Number of Sheet/Submissions used for calculating maximum passes/points
|
||||
$forall (headMsg, summaryVal) <- rowsShown
|
||||
^{rowWdgt headMsg summaryVal}
|
||||
$forall someRow <- rowsShown
|
||||
^{rowWgt someRow}
|
||||
$maybe nrNoGrade <- positiveSum $ numNotGraded
|
||||
<tr .table__row>
|
||||
<th .table__th>_{MsgSheetTypeNotGraded}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user