@@ -1 +1,118 @@
1−; inherits: haskell
1+; ----------------------------------------------------------------------------
2+; Literals and comments
3+
4+ (integer) @constant.numeric.integer
5+ (exp_negation) @constant.numeric.integer
6+ (exp_literal (float)) @constant.numeric.float
7+ (char) @constant.character
8+ (string) @string
9+
10+ (con_unit) @constant.builtin ; unit, as in ()
11+
12+ (comment) @comment
13+
14+
15+; ----------------------------------------------------------------------------
16+; Punctuation
17+
18+ [
19+ "("
20+ ")"
21+ "{"
22+ "}"
23+ "["
24+ "]"
25+ ] @punctuation.bracket
26+
27+ [
28+ (comma)
29+ ";"
30+ ] @punctuation.delimiter
31+
32+
33+; ----------------------------------------------------------------------------
34+; Keywords, operators, includes
35+
36+ [
37+ "if"
38+ "then"
39+ "else"
40+ "case"
41+ "of"
42+ ] @keyword.control.conditional
43+
44+ [
45+ "import"
46+ "module"
47+ ] @keyword.control.import
48+
49+ [
50+ (operator)
51+ (constructor_operator)
52+ (type_operator)
53+ (tycon_arrow)
54+ (qualified_module) ; grabs the `.` (dot), ex: import System.IO
55+ (all_names)
56+ "="
57+ "|"
58+ "::"
59+ "=>"
60+ "->"
61+ "<-"
62+ "\\"
63+ "`"
64+ "@"
65+ ] @operator
66+
67+ (qualified_module (module) @constructor)
68+ (module) @namespace
69+ (qualified_type (module) @namespace)
70+ (qualified_variable (module) @namespace)
71+ (import (module) @namespace)
72+
73+ [
74+ (where)
75+ "let"
76+ "in"
77+ "class"
78+ "instance"
79+ "derive"
80+ "foreign"
81+ "data"
82+ "newtype"
83+ "type"
84+ "as"
85+ "do"
86+ "ado"
87+ "forall"
88+ "∀"
89+ "infix"
90+ "infixl"
91+ "infixr"
92+ ] @keyword
93+
94+
95+; ----------------------------------------------------------------------------
96+; Functions and variables
97+
98+ (signature name: (variable) @type)
99+ (function name: (variable) @function)
100+
101+ ; true or false
102+((variable) @constant.builtin.boolean
103+ (#match? @constant.builtin.boolean "^(true|false)$"))
104+
105+ (variable) @variable
106+
107+ (exp_infix (variable) @operator) ; consider infix functions as operators
108+
109+ ("@" @namespace) ; "as" pattern operator, e.g. x@Constructor
110+
111+
112+; ----------------------------------------------------------------------------
113+; Types
114+
115+ (type) @type
116+
117+ (constructor) @constructor
118+