[Haskell-cafe] view patterns

Cetin Sert 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

<interactive>:1:4:
    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
patterns?
(using -fglasgow-exts  and -XViewPatterns, ghc 6.10.1)
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.haskell.org/pipermail/haskell-cafe/attachments/20081105/619ee876/attachment.htm


More information about the Haskell-Cafe mailing list