
On Tue, Mar 12, 2013 at 10:48 AM, doaltan
I have this stack data structure : data Stack = Empty | Element Char Stack deriving Show I want to check if it is equal to "Empty" When I try something like this : "a = Empty" or "a = (Empty)" in a haskell file and then write this on ghci : "a = Empty"
Have you studied any Haskell tutorials yet? Usually you want to use a pattern match, not an equality test; if you must for some reason use an equality test, you need an Eq instance (as the error message tells you). -- brandon s allbery kf8nh sine nomine associates allbery.b@gmail.com ballbery@sinenomine.net unix, openafs, kerberos, infrastructure, xmonad http://sinenomine.net