[Haskell-beginners] Question about typeclasses

keke iamkeke at gmail.com
Sat Jan 3 03:17:17 EST 2009


Hi,

I am bit struggling with understanding the typeclasses usage in
Text.Regex.Posix (=~) while reading Real world haskell.

The type of (=~) is (RegexMaker Regex CompOption ExecOption source,
RegexContext Regex source1 target)  => source1 -> source -> target

I am from Java world. My question is that can I understand source1 in the
way which is a value has type of RegexMaker, Regex, CompOption and
ExecOption?

And the definiton of instance RegexMaker Regex CompOption ExecOption
Stringmakes it possible for us to pass a String as the parameter of
=~?

Where can I find some good metarials about GHC's type classes? I googled a
lot but can not find something mentioned above usage.

-- 
Cheers,
Keke
-----------------
We paranoid love life
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.haskell.org/pipermail/beginners/attachments/20090103/76e53996/attachment.htm


More information about the Beginners mailing list