tokens_haskell.json 3.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156
  1. [[
  2. "start",
  3. ["punctuation.definition.comment.haskell","-- Type annotation (optional)"]
  4. ],[
  5. "start",
  6. ["entity.name.function.haskell","fib"],
  7. ["meta.function.type-declaration.haskell"," "],
  8. ["keyword.other.double-colon.haskell","::"],
  9. ["meta.function.type-declaration.haskell"," "],
  10. ["support.type.prelude.haskell","Int"],
  11. ["meta.function.type-declaration.haskell"," "],
  12. ["keyword.other.arrow.haskell","->"],
  13. ["meta.function.type-declaration.haskell"," "],
  14. ["support.type.prelude.haskell","Integer"]
  15. ],[
  16. "start",
  17. ["text"," "]
  18. ],[
  19. "start",
  20. ["punctuation.definition.comment.haskell","-- With self-referencing data"]
  21. ],[
  22. "start",
  23. ["text","fib n "],
  24. ["keyword.operator.haskell","="],
  25. ["text"," fibs "],
  26. ["keyword.operator.haskell","!!"],
  27. ["text"," n"]
  28. ],[
  29. "start",
  30. ["text"," "],
  31. ["keyword.other.haskell","where"],
  32. ["text"," fibs "],
  33. ["keyword.operator.haskell","="],
  34. ["text"," "],
  35. ["constant.numeric.haskell","0"],
  36. ["text"," "],
  37. ["keyword.operator.haskell",":"],
  38. ["text"," "],
  39. ["support.function.prelude.haskell","scanl"],
  40. ["text"," "],
  41. ["entity.name.function.infix.haskell","(+)"],
  42. ["text"," "],
  43. ["constant.numeric.haskell","1"],
  44. ["text"," fibs"]
  45. ],[
  46. "start",
  47. ["text"," "],
  48. ["punctuation.definition.comment.haskell","-- 0,1,1,2,3,5,..."]
  49. ],[
  50. "start",
  51. ["text"," "]
  52. ],[
  53. "start",
  54. ["punctuation.definition.comment.haskell","-- Same, coded directly"]
  55. ],[
  56. "start",
  57. ["text","fib n "],
  58. ["keyword.operator.haskell","="],
  59. ["text"," fibs "],
  60. ["keyword.operator.haskell","!!"],
  61. ["text"," n"]
  62. ],[
  63. "start",
  64. ["text"," "],
  65. ["keyword.other.haskell","where"],
  66. ["text"," fibs "],
  67. ["keyword.operator.haskell","="],
  68. ["text"," "],
  69. ["constant.numeric.haskell","0"],
  70. ["text"," "],
  71. ["keyword.operator.haskell",":"],
  72. ["text"," "],
  73. ["constant.numeric.haskell","1"],
  74. ["text"," "],
  75. ["keyword.operator.haskell",":"],
  76. ["text"," next fibs"]
  77. ],[
  78. "start",
  79. ["text"," next (a "],
  80. ["keyword.operator.haskell",":"],
  81. ["text"," t@(b"],
  82. ["keyword.operator.haskell",":"],
  83. ["text","_)) "],
  84. ["keyword.operator.haskell","="],
  85. ["text"," (a"],
  86. ["keyword.operator.haskell","+"],
  87. ["text","b) "],
  88. ["keyword.operator.haskell",":"],
  89. ["text"," next t"]
  90. ],[
  91. "start",
  92. ["text"," "]
  93. ],[
  94. "start",
  95. ["punctuation.definition.comment.haskell","-- Similar idea, using zipWith"]
  96. ],[
  97. "start",
  98. ["text","fib n "],
  99. ["keyword.operator.haskell","="],
  100. ["text"," fibs "],
  101. ["keyword.operator.haskell","!!"],
  102. ["text"," n"]
  103. ],[
  104. "start",
  105. ["text"," "],
  106. ["keyword.other.haskell","where"],
  107. ["text"," fibs "],
  108. ["keyword.operator.haskell","="],
  109. ["text"," "],
  110. ["constant.numeric.haskell","0"],
  111. ["text"," "],
  112. ["keyword.operator.haskell",":"],
  113. ["text"," "],
  114. ["constant.numeric.haskell","1"],
  115. ["text"," "],
  116. ["keyword.operator.haskell",":"],
  117. ["text"," "],
  118. ["support.function.prelude.haskell","zipWith"],
  119. ["text"," "],
  120. ["entity.name.function.infix.haskell","(+)"],
  121. ["text"," fibs ("],
  122. ["support.function.prelude.haskell","tail"],
  123. ["text"," fibs)"]
  124. ],[
  125. "start",
  126. ["text"," "]
  127. ],[
  128. "start",
  129. ["punctuation.definition.comment.haskell","-- Using a generator function"]
  130. ],[
  131. "start",
  132. ["text","fib n "],
  133. ["keyword.operator.haskell","="],
  134. ["text"," fibs ("],
  135. ["constant.numeric.haskell","0"],
  136. ["punctuation.separator.comma.haskell",","],
  137. ["constant.numeric.haskell","1"],
  138. ["text",") "],
  139. ["keyword.operator.haskell","!!"],
  140. ["text"," n"]
  141. ],[
  142. "start",
  143. ["text"," "],
  144. ["keyword.other.haskell","where"],
  145. ["text"," fibs (a"],
  146. ["punctuation.separator.comma.haskell",","],
  147. ["text","b) "],
  148. ["keyword.operator.haskell","="],
  149. ["text"," a "],
  150. ["keyword.operator.haskell",":"],
  151. ["text"," fibs (b"],
  152. ["punctuation.separator.comma.haskell",","],
  153. ["text","a"],
  154. ["keyword.operator.haskell","+"],
  155. ["text","b)"]
  156. ]]