Hi Nikolay,

On 16 June 2014 18:19, Nikolay Amiantov <nikoamia@gmail.com> wrote:
If I disable OverloadedLists extension, warning goes away. Can someone
clear this behaviour out for me? It looks like a bug, but I'm not
sure.

I am not sure if this is a bug or not, but this page seems to explain the desugaring of patterns with OverloadedLists:
https://ghc.haskell.org/trac/ghc/wiki/OverloadedLists

As a workaround, you could try calling `toList` explicitly in a case statement to implement a `len` function for types with an IsList instance.
Maybe something like the following.

len :: IsList l => l -> Int
len xs = case toList xs of [] -> ...

Or even:

len :: IsList l => l -> Int
len = length . toList

Hope this helps.

--
Ozgur Akgun