alpaca
alpaca copied to clipboard
Non-exhaustive patterns in "match" expressions
type maybe 'a = Just 'a | Nothing
val (>>=) 'a 'b : fn (maybe 'a) (fn 'a -> maybe 'b) -> (maybe 'b)
let (>>=) x f =
match x with
Nothing -> Nothing
-- | Just y -> f y
This code is compiled without warnings/errors, but it should not (because 2nd clause is commented out)
Only top level expressions have exhaustiveness checking at present -> https://github.com/alpaca-lang/alpaca#using-it
@lpil that's fine, but top-level expressions based variant is not compiling (even if patterns are exhaustive)
https://github.com/alpaca-lang/alpaca/issues/269