[Haskell-beginners] A question about pattern matching

ARJANEN Loïc Jean David arjanen.loic at gmail.com
Sat Feb 18 21:23:16 CET 2012

"(Eq a) =>" means that the type a in the function's signature must be an 
instance of the Eq typeclass.
Instances of Eq are types where equality is defined, Eq's member functions are 
(==) and (/=), equality and inequality tests.

Le samedi 18 février 2012 20:16:05, bahadýr altan a écrit :
> Hello. I'm wondering what " (Eq a) =>" part in the code below does.. I
> couldn't figure it myself.. Thanks in advance :) isPalindrome :: (Eq a) =>
> [a] -> Bool isPalindrome xs = xs == (reverse xs)

More information about the Beginners mailing list