-thenL_ m k loc scope errs
- = case m loc scope errs of
- (_, errs') -> k loc scope errs'
-
-thenMaybeL :: LintM (Maybe a) -> (a -> LintM (Maybe b)) -> LintM (Maybe b)
-thenMaybeL m k loc scope errs
- = case m loc scope errs of
- (Nothing, errs2) -> (Nothing, errs2)
- (Just r, errs2) -> k r loc scope errs2
-
-mapL :: (a -> LintM b) -> [a] -> LintM [b]
-mapL f [] = returnL []
-mapL f (x:xs)
- = f x `thenL` \ r ->
- mapL f xs `thenL` \ rs ->
- returnL (r:rs)
-
-mapMaybeL :: (a -> LintM (Maybe b)) -> [a] -> LintM (Maybe [b])
- -- Returns Nothing if anything fails
-mapMaybeL f [] = returnL (Just [])
-mapMaybeL f (x:xs)
- = f x `thenMaybeL` \ r ->
- mapMaybeL f xs `thenMaybeL` \ rs ->
- returnL (Just (r:rs))
+thenL_ m k = LintM $ \loc scope errs
+ -> case unLintM m loc scope errs of
+ (_, errs') -> unLintM k loc scope errs'