<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 -&gt; False; False -&gt; 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 -&gt; True) = False; emp (has -&gt; False) = True</span><br style="font-family: courier new,monospace;"><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">&lt;interactive&gt;:1:4:</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;">&nbsp;&nbsp;&nbsp; Warning: Pattern match(es) are overlapped</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; In the definition of `emp&#39;:</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; emp ((has -&gt; True)) = ...</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; emp ((has -&gt; 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&nbsp; and -XViewPatterns, ghc 6.10.1)<br>