Advertisement
Guest User

Untitled

a guest
Apr 21st, 2015
197
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.34 KB | None | 0 0
  1. re-create()∷ true
  2. post-create(r)∷ ( [ ] , [ ] , [ ] , [ ] )
  3.  
  4. pre-destroy(t):: true
  5. post-destroy(t; r):: r = ⊥
  6.  
  7. pre-init(t) :: true
  8. post-init∷ r = ( [ ] , [ ] , [ ] , [ ] )
  9.  
  10. pre-size(t)∷ true
  11. post-size((l, q, h, b); r)∷ ( l ^^ q ^^ h )
  12.  
  13. pre-size(t):: true
  14. post-size((l, q, h, b); r):: ( l ^^ q ^^ h ^^ b )
  15.  
  16. pre-cursorRight(t)∷ true
  17. post-cursorRight(l, q, h, b); r):: r = ( l ^^ h ^^ [Head q], [ ], Tail q, b )
  18.  
  19. pre-cursorLeft(t)∷ true
  20. post-cursorLeft((l, q, h, b); r):: r = ( l
  21.  
  22. pre-home(t)∷ true
  23. post-home((l, q, h, b); r)∷ r = ( [ ] , l ^^ h ^^ q , [ ] , b )
  24.  
  25. pre-end(t)∷ true
  26. post-end((l, q, h, b); r):: r = ( q ^^ h ^^ l, [ ] , [ ] , b )
  27.  
  28. pre-delete(t)∷ true
  29. post-delete((l, q, h, b); r)∷ if h = [ ]
  30. then
  31. r = ( l, tail.q, [ ], b )
  32. else
  33. r = ( l, q, [], b )
  34.  
  35. pre-backspace(t)∷ true
  36. post-backspace((l, q, h, b); r)∷ if h = [ ]
  37. then
  38. r = ( Reverse(Tail(Reverse(l), q , [ ], b )
  39. else
  40. r = ( l, q, [ ], b )
  41.  
  42. pre-highlightLeftCharacter∷ true
  43. post-highlightLeftCharacter∷
  44.  
  45. pre-highlightRightCharacter∷ true
  46. post-highlightRightCharacter∷
  47.  
  48. pre-highlightRightWord∷ true
  49. post-highlightRightWord((l, q, h, b); r)∷ r = highlightRightWord(L, Q, H, B)
  50. where
  51. highlightRightWord(l, [ ], h, b) = (l, q, h, b)
  52. hightlightRightWord(l, q, h, b) = if Head(q) = “ “ Then (l, q, h, b)
  53. else
  54. highlightRightWord(L, Tail(q), h ^^ [Head(q)], b)
  55.  
  56. pre-highlightLeftWord∷ true
  57. post-highlightLeftWord((l, q, h, b);r)∷ r = highlightLeftWord(l, q, h, b)
  58. where
  59. highlightLeftWord(l, q, [ ], b) = (l, q, h, b)
  60. highlightLeftWord(l, q, h, b) = if Head(q) = “ “ Then (l, q, h, b)
  61. else
  62. highlightLeftWord(l, Tail(q), h ^^ [Head(q)], b)
  63.  
  64. pre-copy(t)∷ true
  65. post-copy((l, q, h, b)); r)∷ r = ( l , q , h , [ ] ^^ h )
  66.  
  67. pre-paste(t)∷ if totalSize(t) > 254
  68. post-paste((l, q, h, b); r)∷ if h = [ ]
  69. then
  70. r = ( l, q ^^ b, [ ], b )
  71. else
  72. ( l, q, [ ] ^^ b, b )
  73.  
  74. pre-cut(t)∷ true
  75. post-cut((l, q, h, b); r)∷ r = ( l, q, [ ], [ ] ^^ h )
  76.  
  77. pre-selectAll(t)∷ true
  78. post-selectAll((l, q, h, b); r)∷ r = ( l ^^ h ^^ q, b)
  79.  
  80. pre-deleteAll(t):: true
  81. post-deleteAll((l, q, h, b); r):: r = ( [ ], [ ], [ ], b)
  82.  
  83. pre-addCharacter(t)∷ if size(t) > 254
  84. post-addCharacter((l, q, h, b); r)∷
  85.  
  86. pre-skipWord(t):: true
  87. post-skipWord(l, q, h, b); r)::
  88.  
  89. pre-backWord(t):: true
  90. post-backWord(l, q, h, b); r)::
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement