<div dir="ltr"><div class="gmail_extra">Hi Nikolay,</div><div class="gmail_extra"><br><div class="gmail_quote">On 16 June 2014 18:19, Nikolay Amiantov <span dir="ltr"><<a href="mailto:nikoamia@gmail.com" target="_blank">nikoamia@gmail.com</a>></span> wrote:<br>

<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><div id=":291" class="" style="overflow:hidden">If I disable OverloadedLists extension, warning goes away. Can someone<br>


clear this behaviour out for me? It looks like a bug, but I'm not<br>
sure.<br></div></blockquote></div><br>I am not sure if this is a bug or not, but this page seems to explain the desugaring of patterns with OverloadedLists:</div><div class="gmail_extra"><a href="https://ghc.haskell.org/trac/ghc/wiki/OverloadedLists">https://ghc.haskell.org/trac/ghc/wiki/OverloadedLists</a></div>

<div class="gmail_extra"><br></div><div class="gmail_extra">As a workaround, you could try calling `toList` explicitly in a case statement to implement a `len` function for types with an IsList instance.</div><div class="gmail_extra">

Maybe something like the following.</div><div class="gmail_extra"><br></div><div class="gmail_extra">len :: IsList l => l -> Int</div><div class="gmail_extra">len xs = case toList xs of [] -> ...</div><div class="gmail_extra">

<br></div><div class="gmail_extra">Or even:</div><div class="gmail_extra"><br></div><div class="gmail_extra">len :: IsList l => l -> Int<br></div><div class="gmail_extra">len = length . toList</div><div class="gmail_extra">

<br></div><div class="gmail_extra">Hope this helps.</div><div class="gmail_extra"><br></div><div class="gmail_extra">-- <br>Ozgur Akgun
</div></div>