[Haskell-cafe] About Regex question

kenny lu haskellmail at gmail.com
Thu Nov 5 08:07:04 EST 2009


First of all

In ghci
> >guessKeys "modF1"
> "*** Exception: Test.hs:8:10-85: Irrefutable pattern failed for pattern (_,
> _, _
> , [key])
Because, the pattern "xK_(\\w+)" does not match with your input "modF1", as
you already tried in the bbb function.

*Main> bbb "modF1"

Note that the 4th component is an empty list, which does not match with your
specify in
2nd where clause
(_, _, _, [key]) = line =~ "xK_(\\w+)" :: (String, String, String, [String])

> > aaa "modF1"
> <interactive>:1:0:
>    No instance for (Text.Regex.Base.RegexLike.RegexContext
>                       Regex [Char] [[a]])
>      arising from a use of `aaa' at <interactive>:1:0-10
> You need to give a type annotation to the function aaa so that the type
class instance can be "resolved".

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.haskell.org/pipermail/haskell-cafe/attachments/20091105/014adb59/attachment.html

More information about the Haskell-Cafe mailing list