<span style="font-family: courier new,monospace;">let has [] = False; has _ = True</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;"><br>-- this one is ok</span><span style="font-family: courier new,monospace;"></span><br>
<span style="font-family: courier new,monospace;">let empty list = case has list of True -> False; False -> True</span><br style="font-family: courier new,monospace;"><br><span style="font-family: courier new,monospace;">-- the following is problematic</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;">let emp (has -> True) = False; emp (has -> False) = True</span><br style="font-family: courier new,monospace;"><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;"><interactive>:1:4:</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;"> Warning: Pattern match(es) are overlapped</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;"> In the definition of `emp':</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;"> emp ((has -> True)) = ...</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;"> emp ((has -> False)) = ...</span><br>
<br>Why do I get this error in ghc or when I try to compile a file with view patterns?<br>(using -fglasgow-exts and -XViewPatterns, ghc 6.10.1)<br>