git.iko.soy/rowtype-yoga/purescript-native
on golang help sign in
Merge pull request #1845 from purescript/otherwise

Support new location of `otherwise` in exhaustivity checker

commitca66265abc3dd03a4ea6eb642e9d21ae426d7b50 authorGary Burgess <gary.burgess@gmail.com> dateFri 22 Jan 2016, 11:49 (11 years ago) parent04314995a3cb28
1 file changed+1
src/Language/PureScript/Linter/Exhaustive.hs+1
src/Language/PureScript/Linter/Exhaustive.hs+1
@@ -203,6 +203,7 @@ isExhaustiveGuard (Left gs) = not . null $ filter (\(g, _) -> isOtherwise g) gs
203203 isOtherwise :: Expr -> Bool
204204 isOtherwise (TypedValue _ (BooleanLiteral True) _) = True
205205 isOtherwise (TypedValue _ (Var (Qualified (Just (ModuleName [ProperName "Prelude"])) (Ident "otherwise"))) _) = True
206+ isOtherwise (TypedValue _ (Var (Qualified (Just (ModuleName [ProperName "Data", ProperName "Boolean"])) (Ident "otherwise"))) _) = True
206207 isOtherwise _ = False
207208isExhaustiveGuard (Right _) = True
208209