[Haskell-beginners] Writing a custom pop function for a stack data type
doaltan at yahoo.co.uk
Tue Mar 12 11:42:13 CET 2013
Hi I have such a stack data structure:
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?
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Beginners