[Haskell-cafe] view patterns
cetin.sert at gmail.com
Wed Nov 5 00:34:14 EST 2008
let has  = False; has _ = True
-- this one is ok
let empty list = case has list of True -> False; False -> True
-- the following is problematic
let emp (has -> True) = False; emp (has -> False) = True
Warning: Pattern match(es) are overlapped
In the definition of `emp':
emp ((has -> True)) = ...
emp ((has -> False)) = ...
Why do I get this error in ghc or when I try to compile a file with view
(using -fglasgow-exts and -XViewPatterns, ghc 6.10.1)
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Haskell-Cafe