bkerby

Untitled

Sep 9th, 2012
340
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.73 KB | None | 0 0
  1. signature Stack =
  2. sig
  3. type a Stack
  4.  
  5. val empty : a Stack
  6. val isEmpty : a Stack -> bool
  7.  
  8. val cons : a * a Stack -> a Stack
  9. val head : a Stack -> a
  10. val tail : a Stack -> a Stack
  11. end
  12.  
  13. structure List : Stack =
  14. struct
  15. type a Stack = a list
  16.  
  17. val empty = []
  18. fun isEmpty s = null s
  19.  
  20. fun cons (x,s) = x :: s
  21. fun head s = hd s
  22. fun tail s = tl s
  23. end
  24. ----
  25.  
  26. Error: stack.sml 3.10.
  27. Syntax error: inserting AND.
  28. Error: stack.sml 15.3.
  29. Syntax error: replacing TYPE with FUN.
  30. Error: stack.sml 5.17.
  31. Type constructor Stack given 1 argument but wants 0.
  32. Error: stack.sml 6.17.
  33. Type constructor Stack given 1 argument but wants 0.
  34. Error: stack.sml 8.21.
  35. Type constructor Stack given 1 argument but wants 0.
  36. Error: stack.sml 8.32.
  37. Type constructor Stack given 1 argument but wants 0.
  38. Error: stack.sml 9.17.
  39. Type constructor Stack given 1 argument but wants 0.
  40. Error: stack.sml 10.17.
  41. Type constructor Stack given 1 argument but wants 0.
  42. Error: stack.sml 10.28.
  43. Type constructor Stack given 1 argument but wants 0.
  44. Error: stack.sml 15.20.
  45. Undefined variable list.
  46. Error: stack.sml 13.18.
  47. Type Stack in signature but not in structure.
  48. Error: stack.sml 13.18.
  49. Type a in signature but not in structure.
  50. Error: stack.sml 13.18.
  51. Variable type in structure disagrees with signature.
  52. variable: empty
  53. structure: [??? list]
  54. signature: [exn]
  55. Error: stack.sml 13.18.
  56. Variable type in structure disagrees with signature.
  57. variable: isEmpty
  58. structure: [??? list] -> _
  59. signature: [exn] -> _
  60. Error: stack.sml 13.18.
  61. Variable type in structure disagrees with signature.
  62. variable: tail
  63. structure: [??? list] -> [??? list]
  64. signature: [exn] -> [exn]
Advertisement
Add Comment
Please, Sign In to add comment