
Actually I'm getting the error with this :
data Stack = Empty | Elem Char Stack deriving Show
pophead :: Stack -> Char
pophead Empty = Empty
pophead (Elem x stack) = x
________________________________
From: divyanshu ranjan
datamystack =Empty |Elem Char mystack derivingShow
I'm trying to get the head of the stack using this: pophead :: Stack -> Char pophead Empty = Empty pophead (Element x stack) = x And I'm getting this error for the last sentence of the function : Not in scope: data constructor `Stack' Can you tell me how to fix it? Thanks.
_______________________________________________ Beginners mailing list Beginners@haskell.org http://www.haskell.org/mailman/listinfo/beginners