Guest User

Untitled

a guest
Feb 18th, 2018
89
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.35 KB | None | 0 0
  1. module TestStdStack2
  2.  
  3. import StdStack2, StdEnv
  4.  
  5. listStack :: Stack2 a
  6. listStack = { stack = []
  7. , push = \a x = {x & stack = [a : x.stack]}
  8. , pop = \ x = {x & stack = tl x.stack}
  9. , top = \ x = hd x.stack
  10. , elements = \ x = x.stack
  11. }
  12.  
  13. //charStack :: Stack2 Char
  14. //charStack = { stack = "", ... }
  15.  
  16. Start = 8
Add Comment
Please, Sign In to add comment