
18 Feb
2012
18 Feb
'12
3:23 p.m.
"(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)