<div dir="ltr">You need to write `toList` in both branches:<div><br></div><div><span style="font-size:12.8px">f (toList -> ('9':_)) = 1</span><br style="font-size:12.8px"><span style="font-size:12.8px">f (toList -> ('1':_)) = 2</span><br></div></div><div class="gmail_extra"><br><div class="gmail_quote">2015-11-06 16:20 GMT+01:00 Vlatko Basic <span dir="ltr"><<a href="mailto:vlatko.basic@gmail.com" target="_blank">vlatko.basic@gmail.com</a>></span>:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hello Cafe,<br>
<br>
wiki for OverloadedLists says that<br>
<br>
g  [x,y,z]  =  ...<br>
<br>
is treated as<br>
<br>
g  (toList->  [x,y,z])  =<br>
<br>
<br>
Shouldn't this work? Both 'f's should be treated the same.<br>
<br>
f :: Text -> Int<br>
f (toList -> ('9':_)) = 1   -- OK<br>
f                 ('1':_)  = 2   -- Couldn't match expected type ‘Text’ with actual type ‘[Char]’<br>
<br>
(OverloadedStrings is also on)<br>
<br>
Am I missing something?<br>
<br>
br,<br>
vlatko<br>
<br>
<br>
<br>
_______________________________________________<br>
Haskell-Cafe mailing list<br>
<a href="mailto:Haskell-Cafe@haskell.org" target="_blank">Haskell-Cafe@haskell.org</a><br>
<a href="http://mail.haskell.org/cgi-bin/mailman/listinfo/haskell-cafe" rel="noreferrer" target="_blank">http://mail.haskell.org/cgi-bin/mailman/listinfo/haskell-cafe</a><br>
</blockquote></div><br></div>