Ambiguous occurrence in Haskell with “show”
I'm new in functional programming and I'm trying to create and show a Stack with Haskell. I'd like my program to show me the Stack I'm building with it. This is my code: module Stack (Stack, empty, push, pop, top, isEmpty) where data Stack a = EmptyStack | Stk a (Stack a) push x s = Stk x s top (Stk x s) = x pop (Stk _ s) = s empty = EmptyStack isEmpty EmptyStack = True isEmpty (Stk x s) = False` instance Show a => Show (Stack a) where show EmptyStack = "|" show (Stk a b) = (show a) ++ " <- " ++ (show b) With "show (push 1 empty)" I'd expect an answer (more or less) like: " 1 <- | " But I'm