@@ -41,7 +41,7 @@
4141 <indentation>
4242 <increase>
4343 <expression>
44− (case|class|do|let|where).*
44+ (case|class|do|let|where|=).*
4545 </expression>
4646 </increase>
4747 <decrease>
@@ -57,8 +57,6 @@
5757 <include syntax="self" collection="type-family-definition" />
5858 <include syntax="self" collection="pattern-definition" />
5959 <include syntax="self" collection="type-definition" />
60− <!-- <include syntax="self" collection="type-annotation" /> -->
61− <include syntax="self" collection="data-definition" />
6260 <include syntax="self" collection="GADT-definition" />
6361 <include syntax="self" collection="instance" />
6462 <include syntax="self" collection="typeclass" />
@@ -67,7 +65,6 @@
6765
6866 <template-scopes>
6967 <include syntax="self" collection="Quote" />
70− <include syntax="self" collection="comments" />
7168 </template-scopes>
7269
7370 <collections>
@@ -80,53 +77,27 @@
8077 </collection>
8178
8279 <collection name="expressions">
83− <include syntax="self" collection="do-bind" />
80+ <scope name="haskell.construct.keyword.at">
81+ <expression>@</expression>
82+ </scope>
83+ <scope name="haskell.construct.keyword.case-arrow">
84+ <expression>-></expression>
85+ </scope>
86+ <scope name="haskell.construct.keyword.bind-arrow">
87+ <expression><-</expression>
88+ </scope>
89+ <include syntax="self" collection="keywords" />
8490 <include syntax="self" collection="literal" />
8591 <include syntax="self" collection="operators" />
92+ <include syntax="self" collection="record-match" />
8693 <include syntax="self" collection="list" />
94+ <include syntax="self" collection="view-pattern" />
8795 <include syntax="self" collection="lambda-case" />
8896 <include syntax="self" collection="lambda-head" />
89− <include syntax="self" collection="type-applications" />
9097 <include syntax="self" collection="case-expression" />
98+ <include syntax="self" collection="qconid" />
9199 <include syntax="self" collection="qvarid" />
92− <include syntax="self" collection="bind-arrow" />
93100 <include syntax="self" collection="tuple" />
94−
95−
96−
97− <!-- Needed for do binds -->
98− <!-- <include syntax="self" collection="pattern-match" /> -->
99− </collection>
100−
101− <collection name="pattern-match">
102− <include syntax="self" collection="literal" />
103− <include syntax="self" collection="view-pattern" />
104− <include syntax="self" collection="tuple-match" />
105−<!-- <include syntax="self" collection="at-pattern" /> -->
106− <include syntax="self" collection="varid" />
107− <include syntax="self" collection="qconid" />
108− <include syntax="self" collection="record-match" />
109− <include syntax="self" collection="list-pattern" />
110− </collection>
111−
112− <collection name="type-applications">
113− <scope name="type-applications">
114− <starts-with>
115− <expression>(\s@)\(</expression>
116− <capture number="1" name="haskell.keyword.operator.typeapplication" />
117− </starts-with>
118− <ends-with>
119− <expression>)</expression>
120− </ends-with>
121− <subscopes>
122− <include syntax="self" collection="type" />
123− </subscopes>
124− </scope>
125− <scope name="type-applications-single">
126− <expression>(@)(\w+)</expression>
127− <capture number="1" name="haskell.keyword.operator.typeapplication" />
128− <capture number="2" name="haskell.identifier.type" />
129− </scope>
130101 </collection>
131102
132103 <collection name="Quote">
@@ -165,8 +136,8 @@
165136 <capture number="1" name="haskell.pattern.record.bracket" />
166137 </ends-with>
167138 <subscopes>
168− <include syntax="self" collection="pattern-match" />
169− <include syntax="self" collection="varid" />
139+ <include syntax="self" collection="comments" />
140+ <include syntax="self" collection="expressions" />
170141 <scope name="record-sep">
171142 <expression>=</expression>
172143 </scope>
@@ -188,6 +159,7 @@
188159 <capture number="1" name="haskell.pattern.record.bracket" />
189160 </ends-with>
190161 <subscopes>
162+ <include syntax="self" collection="comments" />
191163 <scope name="haskell.pattern.record.wildcard">
192164 <expression>\.\.</expression>
193165 </scope>
@@ -214,29 +186,12 @@
214186 <capture number="1" name="haskell.list.bracket" />
215187 </ends-with>
216188 <subscopes>
189+ <include syntax="self" collection="comments" />
217190 <include syntax="self" collection="expressions" />
218191 </subscopes>
219192 </scope>
220193 </collection>
221194
222− <collection name="list-pattern">
223− <symbol type="expression" />
224− <scope name="haskell.pattern.list">
225− <starts-with>
226− <expression>(\[)</expression>
227− <capture number="1" name="haskell.pattern.list.bracket" />
228− </starts-with>
229− <ends-with>
230− <expression>(\])</expression>
231− <capture number="1" name="haskell.pattern.list.bracket" />
232− </ends-with>
233− <subscopes>
234− <include syntax="self" collection="pattern-match" />
235− </subscopes>
236− </scope>
237− </collection>
238−
239−
240195 <collection name="view-pattern">
241196 <scope name="haskell.pattern.view">
242197 <symbol type="expression" />
@@ -253,24 +208,7 @@
253208 <scope name="haskell.pattern.view.operator.arrow">
254209 <expression>-></expression>
255210 </scope>
256− <include syntax="self" collection="pattern-match" />
257− </subscopes>
258− </scope>
259− </collection>
260−
261− <collection name="tuple-match">
262− <symbol type="expression" />
263− <scope name="haskell.pattern.tuple">
264− <starts-with>
265− <expression>(\()</expression>
266− <capture number="1" name="haskell.pattern.tuple.bracket" />
267− </starts-with>
268− <ends-with>
269− <expression>(\))</expression>
270− <capture number="1" name="haskell.pattern.tuple.bracket" />
271− </ends-with>
272− <subscopes>
273− <include syntax="self" collection="pattern-match" />
211+ <include syntax="self" collection="expressions" />
274212 </subscopes>
275213 </scope>
276214 </collection>
@@ -285,7 +223,7 @@
285223 <expression>(of)</expression>
286224 <capture number="1" name="haskell.case.keyword.condition" />
287225 </ends-with>
288− <subscopes>
226+ <subscopes anchored="true">
289227 <include syntax="self" collection="expressions" />
290228 </subscopes>
291229 </scope>
@@ -303,70 +241,117 @@
303241 <capture number="1" name="haskell.tuple.bracket" />
304242 </ends-with>
305243 <subscopes>
244+ <include syntax="self" collection="comments" />
306245 <include syntax="self" collection="expressions" />
307246 </subscopes>
308247 </scope>
309248 </collection>
310249
311250 <collection name="typeclass">
312− <symbol type="interface" />
313− <scope name="haskell.definition.class">
251+ <scope name="haskell.definition.class.head">
252+ <symbol type="class" scope="global" name-selector="haskell.keyword.construct.class.name">
253+ <context behavior="whitespace" foldable="true" />
254+ </symbol>
314255 <starts-with>
315256 <expression>^(\h*)(class)($|\h)</expression>
316257 <capture number="2" name="haskell.keyword.construct.class" />
317258 </starts-with>
318− <ends-with>
319− <template>^(?!\s+\1\S)(?!\s*$)</template>
320− </ends-with>
321− <subscopes>
322− <scope name="haskell.keyword.construct.where">
259+ <ends-with />
260+ <subscopes anchored="true">
261+ <scope name="haskell.keyword.construct.class.name">
262+ <starts-with>
263+ <expression></expression>
264+ </starts-with>
265+ <ends-with>
266+ <expression>(?=(where|^\s*$))</expression>
267+ </ends-with>
268+ <subscopes>
269+ <include syntax="self" collection="comments" />
270+ <include syntax="self" collection="type" />
271+ </subscopes>
272+ </scope>
273+ <scope name="haskell.keyword.construct.where" optional="true">
323274 <expression>where</expression>
324275 </scope>
325− <include syntax="self" collection="type" />
326− <include syntax="self" collection="type-definition" />
327− <!-- <include syntax="self" collection="type-annotation" /> -->
328− <include syntax="self" collection="definition" />
329276 </subscopes>
330277 </scope>
331278 </collection>
332279
333280 <collection name="instance">
334281 <scope name="haskell.instance">
335− <symbol type="category" />
282+ <symbol type="category" name-selector="haskell.keyword.construct.instance.name">
283+ <context behavior="whitespace" foldable="true" />
284+ </symbol>
336285 <starts-with>
337286 <expression>^(\h*)(instance)($|\h)</expression>
338287 <capture number="2" name="haskell.keyword.construct.instance" />
339288 </starts-with>
340− <ends-with>
341− <template>^(?!\s+\1\S)(?!\s*$)</template>
342− </ends-with>
343− <subscopes>
344− <scope name="haskell.keyword.construct.where">
289+ <ends-with />
290+ <subscopes anchored="true">
291+ <scope name="haskell.keyword.construct.instance.name">
292+ <starts-with>
293+ <expression></expression>
294+ </starts-with>
295+ <ends-with>
296+ <expression>(?=(where|^\s*$))</expression>
297+ </ends-with>
298+ <subscopes>
299+ <include syntax="self" collection="type" />
300+ </subscopes>
301+ </scope>
302+ <scope name="haskell.keyword.construct.where" optional="true">
345303 <expression>where</expression>
346304 </scope>
347− <include syntax="self" collection="type" />
348− <include syntax="self" collection="type-definition" />
349− <include syntax="self" collection="type-annotation" />
350− <include syntax="self" collection="definition" />
351305 </subscopes>
352306 </scope>
353307 </collection>
354308
355309 <collection name="type-family-definition">
356− <scope name="haskell.definition.type.type-family">
357− <symbol type="type" />
310+ <scope name="haskell.definition.type-family.type">
358311 <starts-with>
359− <expression>^(\h*)(type\h+family)\h+`?(\w(\w|')*)`?($|\h)</expression>
312+ <expression>^(\h*)(type\h+family)</expression>
360313 <capture number="2" name="haskell.keyword.construct.type-family" />
361314 </starts-with>
362315 <ends-with>
363316 <template>^(?!\s+\1\S)(?!\s*$)</template>
364317 </ends-with>
318+ <subscopes anchored="true" skip-whitespace="false">
319+ <scope name="haskell.type-family.head">
320+ <starts-with>
321+ <expression></expression>
322+ </starts-with>
323+ <ends-with>
324+ <expression>where</expression>
325+ <capture number="0" name="haskell.keyword.construct.where" />
326+ </ends-with>
327+ <subscopes anchored="true">
328+ <scope name="haskell.identifier.type-family.type.name">
329+ <expression>\S+</expression>
330+ </scope>
331+ <include syntax="self" collection="type" repeat="true" optional="true" />
332+ </subscopes>
333+ </scope>
334+
335+ <include syntax="self" collection="type-family-case-definition" optional="true" repeat="true" />
336+ </subscopes>
337+ </scope>
338+ </collection>
339+
340+ <collection name="type-family-case-definition">
341+ <scope name="haskell.definition.type-family.type.case">
342+ <starts-with>
343+ <expression>^(\h*)(?=\S)</expression>
344+ </starts-with>
345+ <ends-with>
346+ <template>^(?!\s+\1\S)(?!\s*$)</template>
347+ </ends-with>
365348 <subscopes>
366− <scope name="haskell.keyword.construct.where">
367− <expression>where</expression>
349+ <include syntax="self" collection="comments" />
350+ <include syntax="self" collection="type" optional="true" repeat="true" />
351+ <scope>
352+ <expression>=</expression>
368353 </scope>
369− <include syntax="self" collection="type" />
354+ <include syntax="self" collection="type" optional="true" repeat="true" />
370355 </subscopes>
371356 </scope>
372357 </collection>
@@ -374,47 +359,26 @@
374359 <collection name="definition">
375360 <scope name="haskell.definition.type.function">
376361 <symbol type="function">
377− <display-name>
378− <component selector="haskell.definition.type.function" />
379− </display-name>
380−
362+ <context behavior="whitespace" foldable="true" />
381363 </symbol>
382364 <starts-with>
383365 <expression>^(?=(\h*)(default\h+)?`?(\w(\w|')*)`?($|\h))</expression>
384366 <capture number="2" name="haskell.keyword.construct.default" />
385− <capture number="3" name="haskell.identifier.function" />
367+ <capture number="3" name="haskell.identifier.function.name" />
386368 </starts-with>
387369 <ends-with>
388370 <template>^(?!\1\3\s)(?!\s+\1\S)(?!\s*$)</template>
389371 </ends-with>
390372 <subscopes>
373+ <include syntax="self" collection="comments" />
391374 <include syntax="self" collection="type-annotation" />
392375 <include syntax="self" collection="implementation" />
393376 </subscopes>
394377 </scope>
395378 </collection>
396379
397− <collection name="do-bind">
398− <scope name="do-bind">
399− <starts-with>
400− <expression>^(?=(\h*).+<-($|\h))</expression>
401− </starts-with>
402− <ends-with>
403− <template>^(?!\0)(?!\s+\1\S)(?!\s*$)</template>
404− </ends-with>
405− <subscopes anchored="true">
406− <include syntax="self" collection="pattern-match" />
407− <scope name="bind-arrow">
408− <expression><-</expression>
409− </scope>
410− <include syntax="self" collection="expressions" repeat="true" />
411− </subscopes>
412− </scope>
413− </collection>
414−
415380 <collection name="implementation">
416− <scope name="haskell.definition.type.function">
417− <local scope="within-construct" />
381+ <scope name="haskell.definition.type.function.implementation">
418382 <starts-with>
419383 <expression>^(\h*)(default\h+)?`?(\w(\w|')*)`?($|\h)</expression>
420384 <capture number="2" name="haskell.keyword.construct.default" />
@@ -424,14 +388,20 @@
424388 <template>^(?!\1\3\s)(?!\s+\1\S)(?!\s*$)</template>
425389 </ends-with>
426390 <subscopes>
427− <include syntax="self" collection="where-clause" />
428− <include syntax="self" collection="expressions" />
391+ <include syntax="self" collection="comments" />
392+ <include syntax="self" collection="pattern-match" optional="true" repeat="true" />
393+ <scope>
394+ <expression>=</expression>
395+ <capture number="0" name="haskell.construct.function.keyword.eq" />
396+ </scope>
397+ <include syntax="self" collection="expressions" optional="true" repeat="true" />
398+ <include syntax="self" collection="where-clause" optional="true" />
429399 </subscopes>
430400 </scope>
431401 </collection>
432402
433403 <collection name="type-annotation">
434− <scope name="haskell.definition.type.function">
404+ <scope name="haskell.definition.type.function.type-signature">
435405 <starts-with>
436406 <expression>^(\h*)`?(\w(\w|')*)`?\h*::($|\h)</expression>
437407 <capture number="2" name="haskell.identifier.function" />
@@ -440,6 +410,7 @@
440410 <template>^(?!\s+\1\S)(?!\s*$)</template>
441411 </ends-with>
442412 <subscopes>
413+ <include syntax="self" collection="comments" />
443414 <include syntax="self" collection="type" />
444415 </subscopes>
445416 </scope>
@@ -447,15 +418,19 @@
447418
448419 <collection name="type-definition">
449420 <scope name="haskell.definition.type">
421+ <symbol type="type" scope="global">
422+ <context behavior="whitespace" foldable="true" />
423+ </symbol>
450424 <starts-with>
451425 <expression>^(\h*)(type)\h+(\w(\w|')*)</expression>
452426 <capture number="2" name="haskell.keyword.construct.type" />
453− <capture number="3" name="haskell.identifier.type" />
427+ <capture number="3" name="haskell.identifier.type.name" />
454428 </starts-with>
455429 <ends-with>
456430 <template>^(?!\s+\1\S)(?!\s*$)</template>
457431 </ends-with>
458432 <subscopes>
433+ <include syntax="self" collection="comments" />
459434 <include syntax="self" collection="type" />
460435 </subscopes>
461436 </scope>
@@ -463,66 +438,72 @@
463438
464439 <collection name="GADT-definition">
465440 <scope name="haskell.definition.struct.GADT">
441+ <symbol type="struct" scope="global">
442+ <context behavior="subtree" foldable="false" />
443+ </symbol>
466444 <starts-with>
467− <expression>^(\h*)(data)\h+(\w(\w|')*)</expression>
445+ <expression>^(\h*)(data|newtype)\h+(\w(\w|')*)</expression>
468446 <capture number="2" name="haskell.keyword.construct.data.GADT" />
447+ <capture number="3" name="haskell.identifier.data.type.name" />
469448 </starts-with>
470449 <ends-with>
471450 <template>^(?!\s+\1\S)(?!\s*$)</template>
472451 </ends-with>
473452 <subscopes>
453+ <include syntax="self" collection="comments" />
454+ <scope name="haskell.keyword.construct.where">
455+ <expression>where</expression>
456+ </scope>
457+
458+ <include syntax="self" collection="deriving-clause" />
459+ <include syntax="self" collection="record-definition" />
474460 <include syntax="self" collection="gadt-constructor" />
475461 <include syntax="self" collection="type" />
476− <include syntax="self" collection="record-definition" />
477− <include syntax="self" collection="record-definition-field-name" />
478462 </subscopes>
479463 </scope>
480464 </collection>
481465
482466 <collection name="gadt-constructor">
483− <scope name="identifier.type.struct.GADT.constructor">
484− <expression>^\h+[A-Z](\w|')*</expression>
485− </scope>
486− </collection>
487−
488− <collection name="data-definition">
489− <scope name="haskell.definition.struct.data">
467+ <scope name="haskell.identifier.type.struct.data.constructor">
468+ <symbol type="constructor">
469+ <context behavior="subtree" foldable="true" />
470+ </symbol>
490471 <starts-with>
491− <expression>^(\h*)(data|newtype)\h+(\w(\w|')*)</expression>
492− <capture number="2" name="haskell.keyword.construct.data.newtype" />
493− <capture number="3" name="haskell.identifier.type" />
472+ <expression>(^|=|\||^)\h+([A-Z](\w|')*)</expression>
473+ <capture number="2" name="haskell.identifier.data.name" />
494474 </starts-with>
495− <ends-with>
496− <template>^(?!\s+\1\S)(?!\s*$)</template>
497− </ends-with>
498− <subscopes>
475+ <ends-with />
476+ <subscopes anchored="true">
499477 <include syntax="self" collection="record-definition" />
500− <include syntax="self" collection="data-constructor" />
501− <include syntax="self" collection="type" />
502478 </subscopes>
503479 </scope>
504480 </collection>
505481
506− <collection name="data-constructor">
507− <scope name="haskell.identifier.type.struct.data.constructor">
508− <expression>=\h+[A-Z](\w|')*</expression>
482+ <collection name="deriving-clause">
483+ <scope name="haskell.record.construct.deriving.keyword">
484+ <expression>deriving(\h+(newtype|stock|anyclass))?</expression>
509485 </scope>
510− <scope name="haskell.identifier.type.struct.data.constructor">
511− <expression>\|\h+[A-Z](\w|')*</expression>
486+ <scope name="haskell.record.construct.deriving.keyword">
487+ <include syntax="self" collection="comments" />
488+ <expression>via</expression>
512489 </scope>
513490 </collection>
514491
515492 <collection name="record-definition">
516493 <scope name="haskell.record">
494+ <symbol>
495+ <context behavior="subtree" foldable="true" />
496+ </symbol>
517497 <starts-with>
518− <expression>(\{)</expression>
519− <capture number="1" name="haskell.record.bracket" />
498+ <expression>(?=\{)</expression>
499+ <capture number="0" name="haskell.record.bracket" />
520500 </starts-with>
521501 <ends-with>
522502 <expression>(\})</expression>
523503 <capture number="1" name="haskell.record.bracket" />
524504 </ends-with>
525505 <subscopes>
506+ <include syntax="self" collection="comments" />
526507 <include syntax="self" collection="record-definition-field-name" />
527508 <include syntax="self" collection="type" />
528509 </subscopes>
@@ -531,26 +512,65 @@
531512
532513 <collection name="record-definition-field-name">
533514 <scope name="haskell.record.definition.property">
534− <expression>\w(\w|')*\h*::</expression>
515+ <symbol type="property" />
516+ <expression>(((?![A-Z])\w(\w|')*)\h*::|(^|\{|,)\h*((?![A-Z])\w(\w|')*))</expression>
517+ <capture number="5" name="haskell.record.definition.property.field.property.name" />
518+ <capture number="2" name="haskell.record.definition.property.field.property.name" />
535519 </scope>
536520 </collection>
537521
538522 <collection name="type">
523+ <scope name="haskell.keyword.construct.function-arrow">
524+ <expression>-></expression>
525+ </scope>
526+ <scope name="haskell.keyword.construct.fat-arrow">
527+ <expression>=></expression>
528+ </scope>
529+ <include syntax="self" collection="strings" />
530+ <scope name="haskell.type.construct.tuple">
531+ <starts-with>
532+ <expression>\(</expression>
533+ </starts-with>
534+ <ends-with>
535+ <expression>\)</expression>
536+ </ends-with>
537+ <subscopes>
538+ <include syntax="self" collection="comments" />
539+ <scope name="haskell.construct.type.typle.comma">
540+ <expression>\,</expression>
541+ </scope>
542+ <include syntax="self" collection="type" />
543+ </subscopes>
544+ </scope>
545+ <scope name="haskell.type.list">
546+ <starts-with>
547+ <expression>'?\[</expression>
548+ </starts-with>
549+ <ends-with>
550+ <expression>\]</expression>
551+ </ends-with>
552+ <subscopes>
553+ <include syntax="self" collection="comments" />
554+ <include syntax="self" collection="type" />
555+ </subscopes>
556+ </scope>
557+ <scope name="haskell.type.star">
558+ <expression>\*</expression>
559+ </scope>
560+ <scope name="haskell.keyword.construct.type-annotation-operator">
561+ <expression>::</expression>
562+ </scope>
539563 <include syntax="self" collection="type-list" />
540− <scope name="haskell.identifier.type">
541− <expression>([A-Z](\w|')*\.)*[A-Z](\w|')*</expression>
564+ <scope>
565+ <expression>(([A-Z](\w|')*\.)*)'*\!?([A-Z](\w|')*)</expression>
566+ <capture number="1" name="haskell.identifier.package.module" />
567+ <capture number="4" name="haskell.identifier.type" />
542568 </scope>
543569 <scope name="haskell.keyword.construct.forall">
544570 <expression>forall</expression>
545571 </scope>
546572 <scope name="haskell.identifier.type.variable">
547− <expression>\w(\w|')*</expression>
548− </scope>
549− <scope name="haskell.keyword.construct.function-arrow">
550− <expression>-></expression>
551− </scope>
552− <scope name="haskell.keyword.construct.fat-arrow">
553− <expression>=></expression>
573+ <expression>(?!where)(?!=)((?!(\(|\)|\,|\!))\S)((?!(\(|\)|\,))\w)*</expression>
554574 </scope>
555575 </collection>
556576
@@ -565,6 +585,7 @@
565585 <template>^(?!\s+\1\S)(?!\s*$)</template>
566586 </ends-with>
567587 <subscopes>
588+ <include syntax="self" collection="comments" />
568589 <scope name="haskell.keyword.construct.where">
569590 <expression>where</expression>
570591 </scope>
@@ -584,6 +605,7 @@
584605 <capture number="1" name="haskell.type-list.bracket" />
585606 </ends-with>
586607 <subscopes>
608+ <include syntax="self" collection="comments" />
587609 <include syntax="self" collection="type" />
588610 </subscopes>
589611 </scope>
@@ -600,6 +622,7 @@
600622 <capture number="1" name="haskell.keyword.construct.lambda" />
601623 </ends-with>
602624 <subscopes>
625+ <include syntax="self" collection="comments" />
603626 <include syntax="self" collection="pattern-match" />
604627 </subscopes>
605628 </scope>
@@ -613,7 +636,6 @@
613636
614637 <collection name="where-clause">
615638 <scope name="haskell.construct.where">
616− <local scope="within-parent" />
617639 <starts-with>
618640 <expression>^(\h*)(where)</expression>
619641 <capture number="2" name="haskell.construct.keyword.where" />
@@ -622,6 +644,7 @@
622644 <template>^(?!\1\s*\S)(?!s*$)</template>
623645 </ends-with>
624646 <subscopes>
647+ <include syntax="self" collection="comments" />
625648 <include syntax="self" collection="definition" />
626649 </subscopes>
627650 </scope>
@@ -630,7 +653,9 @@
630653
631654 <collection name="qvarid">
632655 <scope name="haskell.identifier.function">
633− <expression>([A-Z](\w|')*\.)*\w(\w|')*</expression>
656+ <expression>(([A-Z](\w|')*\.)*)(\w(\w|')*)</expression>
657+ <capture number="1" name="haskell.identifier.package.module" />
658+ <capture number="4" name="haskell.identifier.type" />
634659 </scope>
635660 </collection>
636661
@@ -659,12 +684,12 @@
659684
660685
661686 <collection name="strings">
662− <scope name="haskell.string.double-quoted">
687+ <scope name="haskell.string.double-quoted" spell-check="true">
663688 <starts-with>
664− <expression>"</expression>
689+ <expression>"</expression>
665690 </starts-with>
666691 <ends-with>
667− <expression>"</expression>
692+ <expression>"</expression>
668693 </ends-with>
669694 <subscopes>
670695 <scope name="haskell.string.escape-sequences">
@@ -687,8 +712,11 @@
687712
688713 <collection name="module">
689714 <scope name="haskell.definition.module.package">
715+ <symbol type="package">
716+ <context behavior="subtree" foldable="true" export-local="true" />
717+ </symbol>
690718 <starts-with>
691− <expression>^(module)\s+(\w|\.)+</expression>
719+ <expression>^(module)\s+((\w|\.)+)</expression>
692720 <capture number="1" name="haskell.construct.keyword.module" />
693721 <capture number="2" name="haskell.definition.module.package" />
694722 </starts-with>
@@ -696,32 +724,75 @@
696724 <expression>(where)</expression>
697725 <capture number="1" name="haskell.construct.keyword.module" />
698726 </ends-with>
699− <subscopes export-symbols="true">
700− <scope name="identifier.constant">
727+ <subscopes>
728+ <scope name="identifier.haskell.type">
729+ <symbol type="expression" />
730+ <symbol type="expression" />
731+ <expression>([A-Z](\w|')*)\h*(\(\h*\.\.\h*\))?</expression>
732+ <capture number="1" name="identifier.type" />
733+ </scope>
734+ <scope name="identifier.variable">
735+ <symbol type="expression" />
701736 <expression>(\w|')+</expression>
737+ <capture number="0" name="identifier.haskell.function" />
702738 </scope>
703739 </subscopes>
704740 </scope>
705741 </collection>
706742
707743 <collection name="import">
708− <scope name="haskell.construct.keyword.import">
709− <expression>^import\s</expression>
710− </scope>
711− <scope name="haskell.construct.keyword.qualified">
712− <expression>qualified</expression>
713− </scope>
714− <scope name="haskell.construct.keyword.as">
715− <expression>as</expression>
716− </scope>
717− <scope name="haskell.identifier.module.package">
718− <expression>([A-Z](\w|')*\.)*[A-Z](\w|')*</expression>
744+ <scope name="haskell.construct.import">
745+ <starts-with>
746+ <expression>^(import)\s</expression>
747+ <capture number="1" name="haskell.construct.keyword.import" />
748+ </starts-with>
749+ <ends-with>
750+ <expression>(?=^\S)</expression>
751+ </ends-with>
752+ <subscopes>
753+ <scope name="haskell.construct.qualified">
754+ <symbol type="expression" />
755+ <expression>qualified</expression>
756+ <capture number="0" name="haskell.construct.keyword.qualified" />
757+ </scope>
758+
759+ <scope name="haskell.construct.hiding">
760+ <symbol type="keyword">
761+ <context behavior="subtree" />
762+ </symbol>
763+ <starts-with>
764+ <expression>(hiding)\h*(?=\()</expression>
765+ <capture number="1" name="haskell.construct.keyword.hiding" />
766+ </starts-with>
767+ <ends-with>
768+ <expression>(?=\))</expression>
769+ </ends-with>
770+ <subscopes anchored="true">
771+ <include syntax="self" collection="import-list" />
772+ <symbol type="expression" />
773+ </subscopes>
774+ </scope>
775+
776+ <scope name="haskell.construct.keyword.as">
777+ <symbol type="package" />
778+ <expression>as(\h+([A-Z]\w*))?</expression>
779+ <capture number="2" name="haskell.package.qualified.name" />
780+ </scope>
781+ <scope name="haskell.identifier.module.package">
782+ <symbol type="package" />
783+ <expression>([A-Z](\w|')*\.)*[A-Z](\w|')*</expression>
784+ <capture number="0" name="haskell.package.name" />
785+ </scope>
786+ <include syntax="self" collection="import-list" />
787+ </subscopes>
719788 </scope>
720− <include syntax="self" collection="import-list" />
721789 </collection>
722790
723791 <collection name="import-list">
724792 <scope name="import-list">
793+ <symbol>
794+ <context behavior="subtree" export-local="true" />
795+ </symbol>
725796 <starts-with>
726797 <expression>(\()</expression>
727798 <capture number="1" name="haskell.import-list.bracket" />
@@ -731,20 +802,21 @@
731802 <capture number="1" name="haskell.import-list.bracket" />
732803 </ends-with>
733804 <subscopes>
734− <scope name="identifier.decorator">
735− <expression>([A-Z](\w|')*\.)*\w(\w|')*</expression>
805+ <scope name="haskell.identifier.struct">
806+ <symbol type="expression" />
807+ <symbol type="reference" scope="local" />
808+ <expression>([A-Z](\w|')*)\h*(\(\h*\.\.\h*\))?</expression>
809+ <capture number="1" name="haskell.import-list.identifier.type.name" />
810+ </scope>
811+ <scope name="haskell.identifier.function">
812+ <symbol type="reference" scope="local" />
813+ <expression>(\w|')+</expression>
814+ <capture number="0" name="haskell.import-list.function.name" />
736815 </scope>
737816 </subscopes>
738817 </scope>
739818 </collection>
740819
741− <!-- <collection name="special">
742− <scope>
743− <expression>(;|,)</expression>
744− </scope>
745− </collection> -->
746−
747−
748820 <collection name="reservedop">
749821 <scope name="keyword.operator">
750822 <expression>(\.\.|:|::|=|\\|\||<-|->|@|~|=>)</expression>
@@ -752,10 +824,11 @@
752824 </collection>
753825
754826 <collection name="keywords">
755− <scope name="haskell.keyword.modifier">
827+ <scope name="haskell.keyword.self">
756828 <symbol type="keyword" />
757829 <strings>
758830 <string>do</string>
831+ <string>mdo</string>
759832 <string>in</string>
760833 <string>infix</string>
761834 <string>infixl</string>
@@ -793,20 +866,18 @@
793866 <strings>
794867 <string>undefined</string>
795868 <string>_</string>
869+ <string>@</string>
796870 </strings>
797871 </scope>
798872 </collection>
799873
800874 <collection name="comments">
801875 <scope name="haskell.comment.single" spell-check="true">
802− <starts-with>
803− <expression>--</expression>
804− </starts-with>
805− <ends-with>
806− <expression>$</expression>
807− </ends-with>
876+ <symbol type="comment" />
877+ <expression> --.*$</expression>
808878 </scope>
809879 <scope name="haskell.comment.block" spell-check="true">
880+ <symbol type="comment" />
810881 <starts-with>
811882 <expression>{-</expression>
812883 </starts-with>