data mystack = Empty | Elem Char mystack deriving Show
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.