
11 Jul
2005
11 Jul
'05
10:45 p.m.
Anyone please tell me what is wrong with the function: isEmpty ::[a]->Bool isEmpty xs | xs == [] = True |otherwise =False When I tried to load it into the interpreter,it says the following: Could not deduce (Eq a) from the context () arising from use of `==' at mylab2.hs:16 Probable fix: Add (Eq a) to the type signature(s) for `isEmpty' In a pattern guard for the definition of `isEmpty': xs == [] In the definition of `isEmpty': isEmpty xs | xs == [] = True -- X.W.D