git.iko.soy/rowtype-yoga/pose
on main help sign in
Feed the dog
commit3a46a64f37c008bf15a1930c2d862e973af8e8e2 authorMark Eibes <mark.eibes@gmail.com> dateSun 4 Jul 2021, 17:42 (5 years ago) parent613e090
7 files changed+1722−868
packages/core/spago.dhall+1 packages/core/src/Format.purs+775−764 packages/core/testfiles/golden/Where.purs+8 packages/core/testfiles/original/Where.purs+8−1 packages/prettier-plugin-purescript/index.js+887−101 packages/prettier-plugin-purescript/package-lock.json+36 packages/prettier-plugin-purescript/package.json+7−2
packages/core/spago.dhall+1
@@ -31,6 +31,7 @@ to generate this file without the comments in this block.
3131 , "node-fs-aff"
3232 , "node-path"
3333 , "nullable"
34+ , "partial"
3435 , "prelude"
3536 , "psci-support"
3637 , "simple-json"
packages/core/src/Format.purs+775−764
@@ -1,42 +1,54 @@
11module Format (format) where
22
33import Prelude
4−
54import Data.Array as Array
65import Data.Array.NonEmpty as NE
76import Data.Foldable (fold, foldMap)
87import Data.Maybe (Maybe(..), maybe)
8+import Data.Monoid.Additive (Additive(..))
9+import Data.Newtype (ala)
910import Data.Semigroup.Foldable (intercalateMap)
1011import Data.Tuple (fst, snd)
1112import Data.Tuple.Nested (type (/\), (/\))
12−import Debug (spy)
13+import Partial.Unsafe (unsafeCrashWith)
1314import PureScript.CST.Print as Print
14−import PureScript.CST.Range (class RangeOf, rangeOf, tokensOf)
15+import PureScript.CST.Range (class RangeOf, class TokensOf, rangeOf, tokensOf)
1516import PureScript.CST.Range.TokenList as TokensOf
1617import PureScript.CST.Types as CST
1718import Settings (Settings)
1819
1920data Lines
20− = SingleLine | MultipleLines
21−
22−precedingEmptyLines :: Array (CST.Comment CST.LineFeed) -> Int
23−precedingEmptyLines =
24− Array.reverse >>> Array.dropWhile commentIsSpace >>> Array.head >>> case _ of
25− Just (CST.Line _ n) -> n
26− _ -> 0
27−
28−commentIsSpace :: forall c. CST.Comment c -> Boolean
29−commentIsSpace = case _ of
30− CST.Space _ -> true
31− _ -> false
32−
33−singleOrMultiline :: forall a. RangeOf a => a -> Lines
21+ = SingleLine
22+ | MultipleLines
23+
24+precedingEmptyLines ∷ Array (CST.Comment CST.LineFeed) → Int
25+precedingEmptyLines =
26+ Array.takeWhile commentIsSpaceOrLineFeed
27+ >>> map toLines
28+ >>> ala Additive foldMap
29+ where
30+ toLines = case _ of
31+ CST.Line _ n → n
32+ _ → 0
33+
34+isPrecededByBlankLines ∷ ∀ t. TokensOf t ⇒ t → Boolean
35+isPrecededByBlankLines x = case TokensOf.head (tokensOf x) of
36+ Just { leadingComments } → precedingEmptyLines leadingComments > 1
37+ Nothing → unsafeCrashWith "Unexpectedly got no tokens"
38+
39+commentIsSpaceOrLineFeed ∷ ∀ c. CST.Comment c → Boolean
40+commentIsSpaceOrLineFeed = case _ of
41+ CST.Space _ → true
42+ CST.Line _ _ → true
43+ _ → false
44+
45+singleOrMultiline ∷ ∀ a. RangeOf a ⇒ a → Lines
3446singleOrMultiline value = singleOrMultilineFromRange (rangeOf value)
3547
36−singleOrMultilineFromRange :: CST.SourceRange -> Lines
48+singleOrMultilineFromRange ∷ CST.SourceRange → Lines
3749singleOrMultilineFromRange { start, end } = if start.line == end.line then SingleLine else MultipleLines
3850
39−singleOrMultilineBetween :: forall a b. RangeOf a => RangeOf b => a -> b -> Lines
51+singleOrMultilineBetween ∷ ∀ a b. RangeOf a ⇒ RangeOf b ⇒ a → b → Lines
4052singleOrMultilineBetween a b = do
4153 let
4254 { start } = rangeOf a
@@ -44,18 +56,18 @@ singleOrMultilineBetween a b = do
4456 { end } = rangeOf b
4557 singleOrMultilineFromRange { start, end }
4658
47−rangeOfInstanceHead :: CST.InstanceHead Void -> Lines
59+rangeOfInstanceHead ∷ CST.InstanceHead Void → Lines
4860rangeOfInstanceHead { keyword, className, types } = do
4961 let
5062 { end } = case Array.last types of
51− Nothing -> rangeOf className
52− Just ty -> rangeOf ty
63+ Nothing → rangeOf className
64+ Just ty → rangeOf ty
5365 singleOrMultilineFromRange
5466 { start: keyword.range.start
5567 , end
5668 }
5769
58−rangeOfPatternGuard :: (CST.PatternGuard Void) -> CST.SourceRange
70+rangeOfPatternGuard ∷ (CST.PatternGuard Void) → CST.SourceRange
5971rangeOfPatternGuard (CST.PatternGuard { binder, expr }) = do
6072 let
6173 { start } = maybe (rangeOf expr) (fst >>> rangeOf) binder
@@ -63,28 +75,28 @@ rangeOfPatternGuard (CST.PatternGuard { binder, expr }) = do
6375 { end } = rangeOf expr
6476 { start, end }
6577
66−rangeOfSeparated ::
67− forall a.
68− (a -> CST.SourceRange) ->
69− CST.Separated a ->
78+rangeOfSeparated ∷
79+ ∀ a.
80+ (a → CST.SourceRange) →
81+ CST.Separated a →
7082 CST.SourceRange
7183rangeOfSeparated f separated = case separated of
72− CST.Separated { head, tail } -> do
84+ CST.Separated { head, tail } → do
7385 let
7486 headRange = f head
7587 let
7688 tailRange = maybe headRange f (Array.last tail <#> snd)
7789 { start: headRange.start, end: tailRange.end }
7890
79−format :: Settings -> CST.Module Void -> String
91+format ∷ Settings → CST.Module Void → String
8092format = formatModule -- Indentation is two spaces
8193
82−formatModule :: Settings -> CST.Module Void -> String
94+formatModule ∷ Settings → CST.Module Void → String
8395formatModule settings (CST.Module { header, body }) =
8496 formatModuleHeader settings header
8597 <> formatModuleBody settings body
8698
87−formatModuleHeader :: Settings -> CST.ModuleHeader Void -> String
99+formatModuleHeader ∷ Settings → CST.ModuleHeader Void → String
88100formatModuleHeader settings (CST.ModuleHeader header) =
89101 formatSourceToken settings blank blank header.keyword
90102 <> formatName settings blank space header.name
@@ -93,19 +105,19 @@ formatModuleHeader settings (CST.ModuleHeader header) =
93105 <> newline
94106 <> formatImports settings header.imports
95107
96−formatExports ::
97− Settings ->
98− Maybe (CST.DelimitedNonEmpty (CST.Export Void)) ->
108+formatExports ∷
109+ Settings →
110+ Maybe (CST.DelimitedNonEmpty (CST.Export Void)) →
99111 String
100112formatExports settings@{ indentation } exports'' = case exports'' of
101− Nothing -> blank
102− Just exports' -> do
113+ Nothing → blank
114+ Just exports' → do
103115 let
104116 indent = indentation
105117
106118 prefix = case lines of
107− MultipleLines -> newline <> indent
108− SingleLine -> space
119+ MultipleLines → newline <> indent
120+ SingleLine → space
109121 prefix
110122 <> formatDelimitedNonEmpty
111123 settings
@@ -116,66 +128,66 @@ formatExports settings@{ indentation } exports'' = case exports'' of
116128 where
117129 lines = singleOrMultiline exports'
118130
119−formatExport ::
120− Settings ->
121− Indent ->
122− CST.Export Void ->
131+formatExport ∷
132+ Settings →
133+ Indent →
134+ CST.Export Void →
123135 String
124136formatExport settings@{ indentation } indent' export' = case export' of
125− CST.ExportClass class' name' -> do
137+ CST.ExportClass class' name' → do
126138 formatSourceToken settings indent' blank class'
127139 <> formatName settings indent' space name'
128− CST.ExportKind kind name' -> do
140+ CST.ExportKind kind name' → do
129141 formatSourceToken settings indent' blank kind
130142 <> formatName settings indent' space name'
131− CST.ExportModule module'' name' -> do
143+ CST.ExportModule module'' name' → do
132144 formatSourceToken settings indent' blank module''
133145 <> formatName settings indent' space name'
134− CST.ExportOp name' -> do
146+ CST.ExportOp name' → do
135147 formatName settings indent' blank name'
136− CST.ExportType name' dataMembers' -> do
148+ CST.ExportType name' dataMembers' → do
137149 let
138150 indentTrick = indent' <> indentation
139151
140152 indent /\ prefix = case lines of
141− MultipleLines -> indentTrick /\ (newline <> indentTrick)
142− SingleLine -> indent' /\ blank
153+ MultipleLines → indentTrick /\ (newline <> indentTrick)
154+ SingleLine → indent' /\ blank
143155 formatName settings indent' blank name'
144156 <> prefix
145157 <> foldMap (formatDataMembers settings indent) dataMembers'
146− CST.ExportTypeOp type'' name' -> do
158+ CST.ExportTypeOp type'' name' → do
147159 formatSourceToken settings indent' blank type''
148160 <> formatName settings indent' space name'
149− CST.ExportValue name' -> do
161+ CST.ExportValue name' → do
150162 formatName settings indent' blank name'
151− CST.ExportError e -> absurd e
163+ CST.ExportError e → absurd e
152164 where
153165 lines = singleOrMultiline export'
154166
155−formatImports ::
156− Settings ->
157− Array (CST.ImportDecl Void) ->
167+formatImports ∷
168+ Settings →
169+ Array (CST.ImportDecl Void) →
158170 String
159171formatImports settings imports' = case imports' of
160− [] -> blank
161− _ -> do
172+ [] → blank
173+ _ → do
162174 let
163175 indent = blank
164176 foldMap
165− ( \importDecl ->
177+ ( \importDecl →
166178 newline
167179 <> formatImportDeclaration settings indent importDecl
168180 )
169181 imports'
170182 <> newline
171183
172−formatImportDeclaration ::
173− Settings ->
174− Indent ->
175− CST.ImportDecl Void ->
184+formatImportDeclaration ∷
185+ Settings →
186+ Indent →
187+ CST.ImportDecl Void →
176188 String
177189formatImportDeclaration settings@{ indentation } indent'' importDecl' = case importDecl' of
178− CST.ImportDecl { keyword: import'', module: name'', names: imports'', qualified: rename } -> do
190+ CST.ImportDecl { keyword: import'', module: name'', names: imports'', qualified: rename } → do
179191 let
180192 span = singleOrMultiline importDecl'
181193 let
@@ -183,16 +195,16 @@ formatImportDeclaration settings@{ indentation } indent'' importDecl' = case imp
183195 formatSourceToken settings indent'' blank import''
184196 <> formatName settings indent'' space name''
185197 <> foldMap
186− ( \(hiding' /\ imports') -> case hiding' of
187− Just hiding -> do
198+ ( \(hiding' /\ imports') → case hiding' of
199+ Just hiding → do
188200 let
189201 hidingPrefix = case span of
190− MultipleLines -> newline <> indent'
191− SingleLine -> space
202+ MultipleLines → newline <> indent'
203+ SingleLine → space
192204
193205 importPrefix = case span of
194− MultipleLines -> newline <> indent
195− SingleLine -> space
206+ MultipleLines → newline <> indent
207+ SingleLine → space
196208
197209 indent = indent' <> indentation
198210 hidingPrefix
@@ -204,11 +216,11 @@ formatImportDeclaration settings@{ indentation } indent'' importDecl' = case imp
204216 indent
205217 (formatImport settings indent')
206218 imports'
207− Nothing -> do
219+ Nothing → do
208220 let
209221 importPrefix = case span of
210− MultipleLines -> newline <> indent'
211− SingleLine -> space
222+ MultipleLines → newline <> indent'
223+ SingleLine → space
212224 importPrefix
213225 <> formatDelimitedNonEmpty
214226 settings
@@ -219,60 +231,60 @@ formatImportDeclaration settings@{ indentation } indent'' importDecl' = case imp
219231 )
220232 imports''
221233 <> foldMap
222− ( \(as /\ name') -> do
234+ ( \(as /\ name') → do
223235 let
224236 prefix = case span of
225− MultipleLines -> newline <> indent'
226− SingleLine -> space
237+ MultipleLines → newline <> indent'
238+ SingleLine → space
227239 prefix
228240 <> formatSourceToken settings indent' blank as
229241 <> formatName settings indent' space name'
230242 )
231243 rename
232244
233−formatImport ::
234− Settings ->
235− Indent ->
236− CST.Import Void ->
245+formatImport ∷
246+ Settings →
247+ Indent →
248+ CST.Import Void →
237249 String
238250formatImport settings@{ indentation } indent' import'' = case import'' of
239− CST.ImportClass class' name' -> do
251+ CST.ImportClass class' name' → do
240252 formatSourceToken settings indent' blank class'
241253 <> formatName settings indent' space name'
242− CST.ImportKind kind name' -> do
254+ CST.ImportKind kind name' → do
243255 formatSourceToken settings indent' blank kind
244256 <> formatName settings indent' space name'
245− CST.ImportOp name' -> do
257+ CST.ImportOp name' → do
246258 formatName settings indent' blank name'
247− CST.ImportType name' dataMembers' -> do
259+ CST.ImportType name' dataMembers' → do
248260 let
249261 indent = case lines of
250− MultipleLines -> indent' <> indentation
251− SingleLine -> indent'
262+ MultipleLines → indent' <> indentation
263+ SingleLine → indent'
252264 formatName settings indent' blank name'
253265 <> foldMap (formatDataMembers settings indent) dataMembers'
254− CST.ImportTypeOp type'' name' -> do
266+ CST.ImportTypeOp type'' name' → do
255267 formatSourceToken settings indent' blank type''
256268 <> formatName settings indent' space name'
257− CST.ImportValue name' -> do
269+ CST.ImportValue name' → do
258270 formatName settings indent' blank name'
259− CST.ImportError e -> absurd e
271+ CST.ImportError e → absurd e
260272 where
261273 lines = singleOrMultiline import''
262274
263−formatDataMembers ::
264− Settings ->
265− Indent ->
266− CST.DataMembers ->
275+formatDataMembers ∷
276+ Settings →
277+ Indent →
278+ CST.DataMembers →
267279 String
268280formatDataMembers settings@{ indentation } indent' dataMembers' = case dataMembers' of
269− CST.DataAll sourceToken' -> do
281+ CST.DataAll sourceToken' → do
270282 formatSourceToken settings indent' blank sourceToken'
271− CST.DataEnumerated delimited' -> do
283+ CST.DataEnumerated delimited' → do
272284 let
273285 (indent /\ prefix) = case span of
274− MultipleLines -> (indent' <> indentation) /\ (newline <> indent')
275− SingleLine -> (indent' /\ blank)
286+ MultipleLines → (indent' <> indentation) /\ (newline <> indent')
287+ SingleLine → (indent' /\ blank)
276288 prefix
277289 <> formatDelimited
278290 settings
@@ -282,12 +294,12 @@ formatDataMembers settings@{ indentation } indent' dataMembers' = case dataMembe
282294 where
283295 span = singleOrMultiline dataMembers'
284296
285−formatDelimited ::
286− forall a.
287− Settings ->
288− Indent ->
289− (a -> String) ->
290− CST.Delimited a ->
297+formatDelimited ∷
298+ ∀ a.
299+ Settings →
300+ Indent →
301+ (a → String) →
302+ CST.Delimited a →
291303 String
292304formatDelimited settings indent formatValue delimited = do
293305 formatWrapped
@@ -298,22 +310,22 @@ formatDelimited settings indent formatValue delimited = do
298310 where
299311 lines = singleOrMultiline delimited
300312
301−formatModuleBody :: Settings -> CST.ModuleBody Void -> String
313+formatModuleBody ∷ Settings → CST.ModuleBody Void → String
302314formatModuleBody settings@{ indentation } (CST.ModuleBody { decls, trailingComments }) =
303315 formatDeclarations settings decls
304316 <> formatCommentsTrailingModule trailingComments
305317
306−formatDeclarations ::
307− Settings ->
308− Array (CST.Declaration Void) ->
318+formatDeclarations ∷
319+ Settings →
320+ Array (CST.Declaration Void) →
309321 String
310322formatDeclarations settings = foldMap formatOne
311323 where
312324 formatOne declaration = newline <> formatDeclaration settings blank declaration
313325
314−formatDeclaration :: Settings -> Indent -> CST.Declaration Void -> String
326+formatDeclaration ∷ Settings → Indent → CST.Declaration Void → String
315327formatDeclaration settings@{ indentation } indent declaration = case declaration of
316− CST.DeclData dataHead maybeConstructors -> do
328+ CST.DeclData dataHead maybeConstructors → do
317329 formatDataHead settings indent dataHead
318330 <> foldMap formatDataConstructors maybeConstructors
319331 <> newline
@@ -328,7 +340,7 @@ formatDeclaration settings@{ indentation } indent declaration = case declaration
328340 blank
329341 (formatDataConstructor settings indented)
330342 constructors
331− CST.DeclType dataHead equals typo ->
343+ CST.DeclType dataHead equals typo →
332344 formatDataHead settings indent dataHead
333345 <> newline
334346 <> indented
@@ -336,7 +348,7 @@ formatDeclaration settings@{ indentation } indent declaration = case declaration
336348 <> space
337349 <> formatType settings (indented <> indentation) (singleOrMultiline typo) typo
338350 <> newline
339− CST.DeclNewtype dataHead equals name typo -> do
351+ CST.DeclNewtype dataHead equals name typo → do
340352 formatDataHead settings indent dataHead
341353 <> (newline <> indented)
342354 <> formatSourceToken settings indented blank equals
@@ -347,9 +359,9 @@ formatDeclaration settings@{ indentation } indent declaration = case declaration
347359 <> newline
348360 where
349361 prefix = case singleOrMultilineBetween name typo of
350− MultipleLines -> newline <> indented
351− SingleLine -> space
352− CST.DeclClass classHead members -> do
362+ MultipleLines → newline <> indented
363+ SingleLine → space
364+ CST.DeclClass classHead members → do
353365 formatClassHead lines settings indent classHead
354366 <> foldMap formatMember members
355367 <> newline
@@ -359,7 +371,7 @@ formatDeclaration settings@{ indentation } indent declaration = case declaration
359371 <> intercalateMap (newline <> indented) formatLabeledMember labeleds
360372
361373 formatLabeledMember labeled = newline <> indented <> formatLabeledNameType settings indented labeled
362− CST.DeclInstanceChain instances ->
374+ CST.DeclInstanceChain instances →
363375 formatSeparated
364376 settings
365377 (singleOrMultiline instances)
@@ -368,89 +380,89 @@ formatDeclaration settings@{ indentation } indent declaration = case declaration
368380 (formatInstance settings indent)
369381 instances
370382 <> newline
371− CST.DeclDerive sourceToken newtype' instanceHead ->
383+ CST.DeclDerive sourceToken newtype' instanceHead →
372384 formatSourceToken settings indent blank sourceToken
373385 <> foldMap (formatSourceToken settings indent space) newtype'
374386 <> space
375387 <> formatInstanceHead settings indent instanceHead
376388 <> newline
377− CST.DeclKindSignature kindOfDeclaration labeled ->
389+ CST.DeclKindSignature kindOfDeclaration labeled →
378390 formatSourceToken settings indentation indent kindOfDeclaration
379391 <> space
380392 <> formatLabeledNameType settings indent labeled
381− CST.DeclSignature labeled -> formatLabeledNameType settings indent labeled
382− CST.DeclValue valueBindingFields ->
393+ CST.DeclSignature labeled → formatLabeledNameType settings indent labeled
394+ CST.DeclValue valueBindingFields →
383395 formatValueBindingFields settings indent valueBindingFields
384396 <> newline
385− CST.DeclFixity fixityFields -> formatFixityFields settings indent fixityFields <> newline
386− CST.DeclForeign foreign'' import'' foreign''' ->
397+ CST.DeclFixity fixityFields → formatFixityFields settings indent fixityFields <> newline
398+ CST.DeclForeign foreign'' import'' foreign''' →
387399 formatSourceToken settings indent blank foreign''
388400 <> formatSourceToken settings indent space import''
389401 <> space
390402 <> formatForeign settings indent foreign'''
391403 <> newline
392− CST.DeclRole type'' role'' name' roles -> do
404+ CST.DeclRole type'' role'' name' roles → do
393405 formatSourceToken settings indentation indent type''
394406 <> space
395407 <> formatSourceToken settings indentation indent role''
396408 <> space
397409 <> formatName settings indent blank name'
398410 <> foldMap
399− ( \role' ->
411+ ( \role' →
400412 space <> formatRole settings indent role'
401413 )
402414 roles
403415 <> newline
404− CST.DeclError e -> absurd e
416+ CST.DeclError e → absurd e
405417 where
406418 indented = indent <> indentation
407419
408420 lines = singleOrMultiline declaration
409421
410−formatRole ::
411− Settings ->
412− Indent ->
413− (CST.SourceToken /\ CST.Role) ->
422+formatRole ∷
423+ Settings →
424+ Indent →
425+ (CST.SourceToken /\ CST.Role) →
414426 String
415427formatRole settings@{ indentation } indent (sourceToken /\ role) = do
416428 formatSourceToken settings indentation indent sourceToken
417429
418−formatForeign ::
419− Settings ->
420− Indent ->
421− CST.Foreign Void ->
430+formatForeign ∷
431+ Settings →
432+ Indent →
433+ CST.Foreign Void →
422434 String
423435formatForeign settings indent' foreign'' = case foreign'' of
424− CST.ForeignData data' labeled' -> do
436+ CST.ForeignData data' labeled' → do
425437 formatSourceToken settings indent' blank data'
426438 <> space
427439 <> formatLabeledNameKind settings indent' labeled'
428− CST.ForeignKind kind name' -> do
440+ CST.ForeignKind kind name' → do
429441 formatSourceToken settings indent' blank kind
430442 <> formatName settings indent' space name'
431− CST.ForeignValue labeled' -> do
443+ CST.ForeignValue labeled' → do
432444 formatLabeledNameType settings indent' labeled'
433445
434−formatLabeledNameKind ::
435− forall a.
436− Settings ->
437− Indent ->
446+formatLabeledNameKind ∷
447+ ∀ a.
448+ Settings →
449+ Indent →
438450 CST.Labeled
439451 (CST.Name a)
440− (CST.Type Void) ->
452+ (CST.Type Void) →
441453 String
442454formatLabeledNameKind settings indent labeled =
443455 formatLabeled
444456 settings
445457 indent
446458 (formatName settings indent blank)
447− (\x -> formatType settings x (singleOrMultiline labeled))
459+ (\x → formatType settings x (singleOrMultiline labeled))
448460 labeled
449461
450−formatFixityFields ::
451− Settings ->
452− Indent ->
453− CST.FixityFields ->
462+formatFixityFields ∷
463+ Settings →
464+ Indent →
465+ CST.FixityFields →
454466 String
455467formatFixityFields settings indent { keyword: infix' /\ _, prec: precedence /\ _, operator } = do
456468 formatSourceToken settings indent blank infix'
@@ -458,26 +470,26 @@ formatFixityFields settings indent { keyword: infix' /\ _, prec: precedence /\ _
458470 <> space
459471 <> formatFixityOp settings indent operator
460472
461−formatFixityOp ::
462− Settings ->
463− Indent ->
464− CST.FixityOp ->
473+formatFixityOp ∷
474+ Settings →
475+ Indent →
476+ CST.FixityOp →
465477 String
466478formatFixityOp settings indent fixityOp' = case fixityOp' of
467− CST.FixityType type'' name' as op -> do
479+ CST.FixityType type'' name' as op → do
468480 formatSourceToken settings indent blank type''
469481 <> formatQualifiedName settings indent space name'
470482 <> formatSourceToken settings indent space as
471483 <> formatName settings indent space op
472− CST.FixityValue name' as op -> do
484+ CST.FixityValue name' as op → do
473485 formatQualifiedName settings indent blank name'
474486 <> formatSourceToken settings indent space as
475487 <> formatName settings indent space op
476488
477−formatInstance ::
478− Settings ->
479− Indent ->
480− CST.Instance Void ->
489+formatInstance ∷
490+ Settings →
491+ Indent →
492+ CST.Instance Void →
481493 String
482494formatInstance settings@{ indentation } indent (CST.Instance { head, body }) =
483495 formatInstanceHead settings indent head
@@ -491,10 +503,10 @@ formatInstance settings@{ indentation } indent (CST.Instance { head, body }) =
491503
492504 indented = indent <> indentation
493505
494−formatInstanceHead ::
495− Settings ->
496− Indent ->
497− CST.InstanceHead Void ->
506+formatInstanceHead ∷
507+ Settings →
508+ Indent →
509+ CST.InstanceHead Void →
498510 String
499511formatInstanceHead settings@{ indentation } indent'' instanceHead@{ keyword: instance''
500512, nameAndSeparator
@@ -506,50 +518,50 @@ formatInstanceHead settings@{ indentation } indent'' instanceHead@{ keyword: ins
506518 lines = rangeOfInstanceHead instanceHead
507519
508520 (indent /\ indent' /\ prefix) = case lines of
509− MultipleLines ->
521+ MultipleLines →
510522 (indent'' <> indentation <> indentation)
511523 /\ (indent'' <> indentation)
512524 /\ (newline <> indent'' <> indentation)
513− SingleLine -> (indent'' /\ indent'' /\ space)
525+ SingleLine → (indent'' /\ indent'' /\ space)
514526
515527 typePrefix = case Array.last types of
516− Just lastType -> case singleOrMultilineBetween className lastType of
517− MultipleLines -> newline <> indent
518− SingleLine -> space
519− Nothing -> space
528+ Just lastType → case singleOrMultilineBetween className lastType of
529+ MultipleLines → newline <> indent
530+ SingleLine → space
531+ Nothing → space
520532 formatSourceToken settings indent'' blank instance''
521533 <> foldMap
522− ( \{ name: name', separator: colons } ->
534+ ( \{ name: name', separator: colons } →
523535 formatName settings indent'' space name'
524536 <> formatSourceToken settings indent'' space colons
525537 )
526538 nameAndSeparator
527539 <> foldMap
528− ( \(constraints /\ arrow) ->
540+ ( \(constraints /\ arrow) →
529541 prefix
530542 <> formatOneOrDelimited
531543 settings
532544 lines
533545 indent'
534− (\t -> formatType settings indent (singleOrMultiline t) t)
546+ (\t → formatType settings indent (singleOrMultiline t) t)
535547 constraints
536548 <> formatSourceToken settings indent' space arrow
537549 )
538550 constraints'
539551 <> formatQualifiedName settings indent' prefix className
540552 <> foldMap
541− (\type'' -> typePrefix <> formatType settings indent (singleOrMultiline type'') type'')
553+ (\type'' → typePrefix <> formatType settings indent (singleOrMultiline type'') type'')
542554 types
543555
544−formatInstanceBinding ::
545− Settings ->
546− Indent ->
547− CST.InstanceBinding Void ->
556+formatInstanceBinding ∷
557+ Settings →
558+ Indent →
559+ CST.InstanceBinding Void →
548560 String
549561formatInstanceBinding settings indent = case _ of
550− CST.InstanceBindingSignature labeled -> do
562+ CST.InstanceBindingSignature labeled → do
551563 formatLabeledNameType settings indent labeled
552− CST.InstanceBindingName valueBindingFields -> do
564+ CST.InstanceBindingName valueBindingFields → do
553565 formatValueBindingFields settings indent valueBindingFields
554566
555567-- | This is for basics like function or value definitions
@@ -558,10 +570,10 @@ formatInstanceBinding settings indent = case _ of
558570-- | x <- [1,2,3]
559571-- | x | x `mod` 2 == 0 -> [1,2,3]
560572-- | ```
561−formatValueBindingFields ::
562− Settings ->
563− Indent ->
564− CST.ValueBindingFields Void ->
573+formatValueBindingFields ∷
574+ Settings →
575+ Indent →
576+ CST.ValueBindingFields Void →
565577 String
566578formatValueBindingFields settings indent { name, binders, guarded } =
567579 formatName settings indent blank name
@@ -570,55 +582,55 @@ formatValueBindingFields settings indent { name, binders, guarded } =
570582 where
571583 formatValueBinder binder = space <> formatBinder settings indent binder
572584
573−formatBinder ::
574− Settings ->
575− Indent ->
576− CST.Binder Void ->
585+formatBinder ∷
586+ Settings →
587+ Indent →
588+ CST.Binder Void →
577589 String
578590formatBinder settings@{ indentation } indent' binder = case binder of
579− CST.BinderArray delimited -> do
591+ CST.BinderArray delimited → do
580592 formatArray
581593 settings
582594 lines
583595 indent'
584596 (formatBinder settings indent')
585597 delimited
586− CST.BinderBoolean boolean _ -> do
598+ CST.BinderBoolean boolean _ → do
587599 formatSourceToken settings indent' blank boolean
588− CST.BinderChar char _ -> do
600+ CST.BinderChar char _ → do
589601 formatSourceToken settings indent' blank char
590− CST.BinderConstructor name' binders -> do
602+ CST.BinderConstructor name' binders → do
591603 let
592604 prefix = case singleOrMultiline binder of
593− MultipleLines -> newline <> indent' <> indentation
594− SingleLine -> space
605+ MultipleLines → newline <> indent' <> indentation
606+ SingleLine → space
595607 formatQualifiedName settings indent' blank name'
596608 <> foldMap
597− (\binder' -> prefix <> formatBinder settings indent' binder')
609+ (\binder' → prefix <> formatBinder settings indent' binder')
598610 binders
599− CST.BinderNamed name' at binder' -> do
611+ CST.BinderNamed name' at binder' → do
600612 formatName settings indent' blank name'
601613 <> formatSourceToken settings indent' blank at
602614 <> formatBinder settings indent' binder'
603− CST.BinderNumber negative number _ -> do
615+ CST.BinderNumber negative number _ → do
604616 foldMap (formatSourceToken settings indent' blank) negative
605617 <> formatSourceToken settings indent' blank number
606− CST.BinderOp binder1 binders -> do
618+ CST.BinderOp binder1 binders → do
607619 formatBinder (settings { indentation = indent' }) prefix binder1 -- [TODO] check
608620 <> foldMap formatNamedBinder binders
609621 where
610622 indentTrick = indent' <> indentation
611623
612624 indent /\ prefix = case lines of
613− MultipleLines -> indentTrick /\ (newline <> indentTrick)
614− SingleLine -> indent' /\ space
625+ MultipleLines → indentTrick /\ (newline <> indentTrick)
626+ SingleLine → indent' /\ space
615627
616628 formatNamedBinder (name /\ binder) =
617629 formatQualifiedName settings indent' prefix name
618630 <> prefix
619631 <> formatBinder settings indent binder
620− CST.BinderParens wrapped -> formatParens lines settings indent' (formatBinder settings) wrapped
621− CST.BinderRecord delimited -> do
632+ CST.BinderParens wrapped → formatParens lines settings indent' (formatBinder settings) wrapped
633+ CST.BinderRecord delimited → do
622634 formatRecord
623635 settings
624636 indent'
@@ -628,110 +640,118 @@ formatBinder settings@{ indentation } indent' binder = case binder of
628640 (formatBinder settings)
629641 )
630642 delimited
631− CST.BinderString string _ -> do
643+ CST.BinderString string _ → do
632644 formatSourceToken settings indent' blank string
633− CST.BinderTyped binder' colons type'' -> do
645+ CST.BinderTyped binder' colons type'' → do
634646 let
635647 indentTrick = indent' <> indentation
636648
637649 indent /\ prefix = case lines of
638− MultipleLines -> indentTrick /\ (newline <> indentTrick)
639− SingleLine -> indent' /\ space
650+ MultipleLines → indentTrick /\ (newline <> indentTrick)
651+ SingleLine → indent' /\ space
640652 formatBinder settings indent' binder'
641653 <> formatSourceToken settings indent' space colons
642654 <> prefix
643655 <> formatType settings indent lines type''
644− CST.BinderVar name' -> formatName settings indent' blank name'
645− CST.BinderWildcard wildcard -> formatSourceToken settings indent' blank wildcard
646− CST.BinderInt negative int _ ->
656+ CST.BinderVar name' → formatName settings indent' blank name'
657+ CST.BinderWildcard wildcard → formatSourceToken settings indent' blank wildcard
658+ CST.BinderInt negative int _ →
647659 foldMap (formatSourceToken settings indent' blank) negative
648660 <> formatSourceToken settings indent' blank int
649− CST.BinderError x -> absurd x
661+ CST.BinderError x → absurd x
650662 where
651663 lines = singleOrMultiline binder
652664
653−formatGuarded ::
654− Settings ->
655− Indent ->
656− CST.Guarded Void ->
665+formatGuarded ∷
666+ Settings →
667+ Indent →
668+ CST.Guarded Void →
657669 String
658670formatGuarded settings@{ indentation } indent' = case _ of
659− CST.Guarded guardedExprs -> do
671+ CST.Guarded guardedExprs → do
660672 let
661673 indent = indent' <> indentation
662674 foldMap
663− ( \guardedExpr ->
675+ ( \guardedExpr →
664676 (newline <> indent)
665677 <> formatGuardedExpr settings indent guardedExpr
666678 )
667679 guardedExprs
668− CST.Unconditional separator whereToken -> do
680+ CST.Unconditional separator whereToken → do
669681 formatSourceToken settings indent' space separator
670682 <> formatWhere settings indent' whereToken
671683
672−formatWhere ::
673− Settings ->
674− Indent ->
675− CST.Where Void ->
684+formatWhere ∷
685+ Settings →
686+ Indent →
687+ CST.Where Void →
676688 String
677689formatWhere settings@{ indentation } indent' (CST.Where { expr: expr', bindings: letBindings'' }) = do
678690 formatExprPrefix (singleOrMultiline expr') settings indent' expr'
679691 <> foldMap formatWhereAndBindings letBindings''
680692 where
681− indent = indent' <> indentation
682− formatWhereAndBindings (where'' /\ letBindings') = do
683− (newline <> indent)
684− <> formatSourceToken settings indent blank where''
685− <> formatLetBindings letBindings'
686− formatLetBindings letBindings' =
687− foldMap
688− formatLetBindingWithFollowing
689− ( NE.zip letBindings'
690− (NE.snoc' (Just <$> NE.tail letBindings') Nothing)
691− )
692−
693− formatLetBindingWithFollowing (current /\ maybeFollowing) =
694− formatLetBinding settings indent (newline <> indent) suffix current
695− where
696− suffix = case maybeFollowing of
697− Nothing -> blank -- no newline on last entry
698− Just followingLetBinding -> case TokensOf.head (tokensOf followingLetBinding) of
699− Just { leadingComments } ->
700− if precedingEmptyLines leadingComments > 1 then
701− newline
702− else blank
703− Nothing -> blank
704−
705−formatLetBinding ::
706− Settings ->
707− Indent ->
708− Prefix ->
709− Suffix ->
710− CST.LetBinding Void ->
693+ indent = indent' <> indentation
694+
695+ formatWhereAndBindings (where'' /\ letBindings') = do
696+ (wherePrefix <> newline <> indent)
697+ <> formatSourceToken settings indent blank where''
698+ <> whereSuffix
699+ <> formatLetBindings letBindings'
700+ where
701+ wherePrefix = if precedingEmptyLines where''.leadingComments > 1 then newline else blank
702+ whereSuffix =
703+ if isPrecededByBlankLines (NE.head letBindings') then
704+ newline
705+ else
706+ blank
707+
708+ formatLetBindings letBindings' =
709+ foldMap
710+ formatLetBindingWithFollowing
711+ ( NE.zip letBindings'
712+ (NE.snoc' (Just <$> NE.tail letBindings') Nothing)
713+ )
714+
715+ formatLetBindingWithFollowing (current /\ maybeFollowing) = formatLetBinding settings indent (newline <> indent) suffix current
716+ where
717+ suffix = case maybeFollowing of
718+ Nothing → blank -- no newline on last entry
719+ Just followingLetBinding →
720+ if isPrecededByBlankLines followingLetBinding then
721+ newline
722+ else
723+ blank
724+
725+formatLetBinding ∷
726+ Settings →
727+ Indent →
728+ Prefix →
729+ Suffix →
730+ CST.LetBinding Void →
711731 String
712732formatLetBinding settings@{ indentation } indent' prefix suffix = case _ of
713− CST.LetBindingName valueBindingFields' -> do
733+ CST.LetBindingName valueBindingFields' → do
714734 prefix
715735 <> formatValueBindingFields settings indent' valueBindingFields'
716736 <> suffix
717− CST.LetBindingPattern binder' equals where'' -> do
737+ CST.LetBindingPattern binder' equals where'' → do
718738 prefix
719739 <> formatBinder settings indent' binder'
720740 <> formatSourceToken settings indent' space equals
721741 <> formatWhere settings indent' where''
722742 <> suffix
723− CST.LetBindingSignature labeled' -> do
743+ CST.LetBindingSignature labeled' → do
724744 prefix
725745 <> formatLabeledNameType settings indent' labeled'
726− CST.LetBindingError e -> absurd e
746+ CST.LetBindingError e → absurd e
727747
728−formatGuardedExpr ::
729− Settings ->
730− Indent ->
731− CST.GuardedExpr Void ->
748+formatGuardedExpr ∷
749+ Settings →
750+ Indent →
751+ CST.GuardedExpr Void →
732752 String
733753formatGuardedExpr settings@{ indentation } indent' expr = case expr of
734− CST.GuardedExpr { bar, patterns: patternGuards, separator, where: where'' } -> do
754+ CST.GuardedExpr { bar, patterns: patternGuards, separator, where: where'' } → do
735755 let
736756 indent = indent' <> indentation
737757 formatSourceToken settings indent' blank bar
@@ -747,162 +767,162 @@ formatGuardedExpr settings@{ indentation } indent' expr = case expr of
747767 <> formatSourceToken settings indent' blank separator
748768 <> formatWhere settings indent' where''
749769
750−formatPatternGuard ::
751− Settings ->
752− Indent ->
753− CST.PatternGuard Void ->
770+formatPatternGuard ∷
771+ Settings →
772+ Indent →
773+ CST.PatternGuard Void →
754774 String
755775formatPatternGuard settings@{ indentation } indent patternGuard@(CST.PatternGuard { binder, expr: expr' }) = case binder of
756− Just (binder' /\ arrow) ->
776+ Just (binder' /\ arrow) →
757777 formatBinder settings indent binder'
758778 <> formatSourceToken settings indent space arrow
759779 <> formatExprPrefix lines settings indent expr'
760− Nothing -> formatExpr settings indent expr'
780+ Nothing → formatExpr settings indent expr'
761781 where
762782 lines = singleOrMultilineFromRange (rangeOfPatternGuard patternGuard)
763783
764−formatExprPrefix :: Lines -> Settings -> Indent -> CST.Expr Void -> String
784+formatExprPrefix ∷ Lines → Settings → Indent → CST.Expr Void → String
765785formatExprPrefix lines settings@{ indentation } indent' expr = prefix <> formatExpr settings indent expr
766786 where
767787 indent = case expr of
768− CST.ExprAdo _ -> indent'
769− CST.ExprApp _ _ -> indent' <> indentation
770− CST.ExprArray _ -> indent' <> indentation
771− CST.ExprBoolean _ _ -> indent' <> indentation
772− CST.ExprCase _ -> indent'
773− CST.ExprChar _ _ -> indent' <> indentation
774− CST.ExprConstructor _ -> indent' <> indentation
775− CST.ExprDo _ -> indent'
776− CST.ExprHole _ -> indent' <> indentation
777− CST.ExprIdent _ -> indent' <> indentation
778− CST.ExprIf _ -> indent' <> indentation
779− CST.ExprInfix _ _ -> indent' <> indentation
780− CST.ExprLambda _ -> indent'
781− CST.ExprLet _ -> indent' <> indentation
782− CST.ExprNegate _ _ -> indent' <> indentation
783− CST.ExprNumber _ _ -> indent' <> indentation
784− CST.ExprOp _ _ -> indent' <> indentation
785− CST.ExprOpName _ -> indent' <> indentation
786− CST.ExprParens _ -> indent' <> indentation
787− CST.ExprRecord _ -> indent' <> indentation
788− CST.ExprRecordAccessor _ -> indent' <> indentation
789− CST.ExprRecordUpdate _ _ -> indent' <> indentation
790− CST.ExprSection _ -> indent' <> indentation
791− CST.ExprString _ _ -> indent' <> indentation
792− CST.ExprTyped _ _ _ -> indent' <> indentation
793− CST.ExprInt _ _ -> indent' <> indentation
794− CST.ExprError e -> absurd e
788+ CST.ExprAdo _ → indent'
789+ CST.ExprApp _ _ → indent' <> indentation
790+ CST.ExprArray _ → indent' <> indentation
791+ CST.ExprBoolean _ _ → indent' <> indentation
792+ CST.ExprCase _ → indent'
793+ CST.ExprChar _ _ → indent' <> indentation
794+ CST.ExprConstructor _ → indent' <> indentation
795+ CST.ExprDo _ → indent'
796+ CST.ExprHole _ → indent' <> indentation
797+ CST.ExprIdent _ → indent' <> indentation
798+ CST.ExprIf _ → indent' <> indentation
799+ CST.ExprInfix _ _ → indent' <> indentation
800+ CST.ExprLambda _ → indent'
801+ CST.ExprLet _ → indent' <> indentation
802+ CST.ExprNegate _ _ → indent' <> indentation
803+ CST.ExprNumber _ _ → indent' <> indentation
804+ CST.ExprOp _ _ → indent' <> indentation
805+ CST.ExprOpName _ → indent' <> indentation
806+ CST.ExprParens _ → indent' <> indentation
807+ CST.ExprRecord _ → indent' <> indentation
808+ CST.ExprRecordAccessor _ → indent' <> indentation
809+ CST.ExprRecordUpdate _ _ → indent' <> indentation
810+ CST.ExprSection _ → indent' <> indentation
811+ CST.ExprString _ _ → indent' <> indentation
812+ CST.ExprTyped _ _ _ → indent' <> indentation
813+ CST.ExprInt _ _ → indent' <> indentation
814+ CST.ExprError e → absurd e
795815
796816 multiLine = case expr of
797− CST.ExprAdo _ -> space
798− CST.ExprApp _ _ -> newline <> indent
799− CST.ExprArray _ -> newline <> indent
800− CST.ExprBoolean _ _ -> newline <> indent
801− CST.ExprCase _ -> space
802− CST.ExprChar _ _ -> newline <> indent
803− CST.ExprConstructor _ -> newline <> indent
804− CST.ExprDo _ -> space
805− CST.ExprHole _ -> newline <> indent
806− CST.ExprIdent _ -> newline <> indent
807− CST.ExprIf _ -> newline <> indent
808− CST.ExprInfix _ _ -> newline <> indent
809− CST.ExprLambda _ -> space
810− CST.ExprLet _ -> newline <> indent
811− CST.ExprNegate _ _ -> newline <> indent
812− CST.ExprNumber _ _ -> newline <> indent
813− CST.ExprOp _ _ -> newline <> indent
814− CST.ExprOpName _ -> newline <> indent
815− CST.ExprParens _ -> newline <> indent
816− CST.ExprRecord _ -> newline <> indent
817− CST.ExprRecordAccessor _ -> newline <> indent
818− CST.ExprRecordUpdate _ _ -> newline <> indent
819− CST.ExprSection _ -> newline <> indent
820− CST.ExprString _ _ -> newline <> indent
821− CST.ExprTyped _ _ _ -> newline <> indent
822− CST.ExprInt _ _ -> newline <> indent
823− CST.ExprError e -> absurd e
824−
825− prefix :: String
817+ CST.ExprAdo _ → space
818+ CST.ExprApp _ _ → newline <> indent
819+ CST.ExprArray _ → newline <> indent
820+ CST.ExprBoolean _ _ → newline <> indent
821+ CST.ExprCase _ → space
822+ CST.ExprChar _ _ → newline <> indent
823+ CST.ExprConstructor _ → newline <> indent
824+ CST.ExprDo _ → space
825+ CST.ExprHole _ → newline <> indent
826+ CST.ExprIdent _ → newline <> indent
827+ CST.ExprIf _ → newline <> indent
828+ CST.ExprInfix _ _ → newline <> indent
829+ CST.ExprLambda _ → space
830+ CST.ExprLet _ → newline <> indent
831+ CST.ExprNegate _ _ → newline <> indent
832+ CST.ExprNumber _ _ → newline <> indent
833+ CST.ExprOp _ _ → newline <> indent
834+ CST.ExprOpName _ → newline <> indent
835+ CST.ExprParens _ → newline <> indent
836+ CST.ExprRecord _ → newline <> indent
837+ CST.ExprRecordAccessor _ → newline <> indent
838+ CST.ExprRecordUpdate _ _ → newline <> indent
839+ CST.ExprSection _ → newline <> indent
840+ CST.ExprString _ _ → newline <> indent
841+ CST.ExprTyped _ _ _ → newline <> indent
842+ CST.ExprInt _ _ → newline <> indent
843+ CST.ExprError e → absurd e
844+
845+ prefix ∷ String
826846 prefix = case lines of
827− MultipleLines -> multiLine
828− SingleLine -> space
847+ MultipleLines → multiLine
848+ SingleLine → space
829849
830−formatExpr ::
831− Settings ->
832− Indent ->
833− CST.Expr Void ->
850+formatExpr ∷
851+ Settings →
852+ Indent →
853+ CST.Expr Void →
834854 String
835855formatExpr settings@{ indentation } indent'' expr'' = case expr'' of
836− CST.ExprAdo adoBlock' -> formatAdoBlock lines settings indent'' adoBlock'
837− CST.ExprApp expr1 expressions -> -- [CHECK] Verify
856+ CST.ExprAdo adoBlock' → formatAdoBlock lines settings indent'' adoBlock'
857+ CST.ExprApp expr1 expressions → -- [CHECK] Verify
838858 formatExpr settings indent'' expr1
839859 <> foldMap formatApp expressions
840860 where
841861 formatApp curr = (formatExprPrefix (singleOrMultilineBetween expr1 curr) settings indent'' curr)
842− CST.ExprArray delimited' -> do
862+ CST.ExprArray delimited' → do
843863 let
844864 indent' = case lines of
845− MultipleLines -> indent'' <> indentation
846− SingleLine -> indent''
865+ MultipleLines → indent'' <> indentation
866+ SingleLine → indent''
847867 formatArray
848868 settings
849869 lines
850870 indent''
851871 (formatExpr settings indent')
852872 delimited'
853− CST.ExprBoolean boolean _ -> formatSourceToken settings indent'' blank boolean
854− CST.ExprCase caseOf -> formatCaseOf lines settings indent'' caseOf
855− CST.ExprChar char _ -> formatSourceToken settings indent'' blank char
856− CST.ExprConstructor name -> formatQualifiedName settings indent'' blank name
857− CST.ExprDo doBlock -> formatDoBlock lines settings indent'' doBlock
858− CST.ExprHole hole -> formatName settings indent'' blank hole
859− CST.ExprIdent name -> formatQualifiedName settings indent'' blank name
860− CST.ExprIf ifThenElse -> formatIfThenElse lines settings indent'' ifThenElse
861− CST.ExprInfix expr1 expressions ->
873+ CST.ExprBoolean boolean _ → formatSourceToken settings indent'' blank boolean
874+ CST.ExprCase caseOf → formatCaseOf lines settings indent'' caseOf
875+ CST.ExprChar char _ → formatSourceToken settings indent'' blank char
876+ CST.ExprConstructor name → formatQualifiedName settings indent'' blank name
877+ CST.ExprDo doBlock → formatDoBlock lines settings indent'' doBlock
878+ CST.ExprHole hole → formatName settings indent'' blank hole
879+ CST.ExprIdent name → formatQualifiedName settings indent'' blank name
880+ CST.ExprIf ifThenElse → formatIfThenElse lines settings indent'' ifThenElse
881+ CST.ExprInfix expr1 expressions →
862882 formatExpr settings indent'' expr1
863883 <> prefix
864884 <> foldMap formatOne expressions
865885 where
866886 (indent /\ indent' /\ prefix /\ prefix') = case lines of
867− MultipleLines ->
887+ MultipleLines →
868888 ( (indent'' <> indentation <> indentation)
869889 /\ (indent'' <> indentation)
870890 /\ (newline <> indent'' <> indentation)
871891 /\ (newline <> (indent'' <> indentation) <> indentation)
872892 )
873− SingleLine -> (indent'' /\ indent'' /\ space /\ space)
893+ SingleLine → (indent'' /\ indent'' /\ space /\ space)
874894
875895 formatOne (wrapped /\ expression) =
876896 formatWrapped settings indent (formatExpr settings indent') wrapped
877897 <> prefix'
878898 <> formatExpr settings indent expression
879− CST.ExprLambda lambda -> do
899+ CST.ExprLambda lambda → do
880900 formatLambda lines settings indent'' lambda
881− CST.ExprLet letIn -> do
901+ CST.ExprLet letIn → do
882902 formatLetIn lines settings indent'' letIn
883− CST.ExprNegate negative expression -> do
903+ CST.ExprNegate negative expression → do
884904 formatSourceToken settings indent'' blank negative
885905 <> formatExpr settings indent'' expression
886− CST.ExprNumber number _ -> do
906+ CST.ExprNumber number _ → do
887907 formatSourceToken settings indent'' blank number
888− CST.ExprOp expr1 expressions -> do
908+ CST.ExprOp expr1 expressions → do
889909 let
890910 indent /\ indent' /\ prefix = case lines of
891− MultipleLines -> (indent'' <> indentation <> indentation) /\ (indent'' <> indentation) /\ (newline <> indent'' <> indentation)
892− SingleLine -> (indent'' <> indentation) /\ indent'' /\ space
911+ MultipleLines → (indent'' <> indentation <> indentation) /\ (indent'' <> indentation) /\ (newline <> indent'' <> indentation)
912+ SingleLine → (indent'' <> indentation) /\ indent'' /\ space
893913 formatExpr settings indent'' expr1
894914 <> foldMap
895− ( \(op /\ expr) ->
915+ ( \(op /\ expr) →
896916 formatQualifiedName settings indent' prefix op
897917 <> space
898918 <> formatExpr settings indent expr
899919 )
900920 expressions
901− CST.ExprOpName name' -> do
921+ CST.ExprOpName name' → do
902922 formatQualifiedName settings indent'' blank name'
903− CST.ExprParens wrapped' -> do
923+ CST.ExprParens wrapped' → do
904924 formatParens lines settings indent'' (formatExpr settings) wrapped'
905− CST.ExprRecord delimited -> do
925+ CST.ExprRecord delimited → do
906926 formatRecord
907927 settings
908928 indent''
@@ -912,13 +932,13 @@ formatExpr settings@{ indentation } indent'' expr'' = case expr'' of
912932 (formatExpr settings)
913933 )
914934 delimited
915− CST.ExprRecordAccessor recordAccessor' -> do
935+ CST.ExprRecordAccessor recordAccessor' → do
916936 formatRecordAccessor lines settings indent'' recordAccessor'
917− CST.ExprRecordUpdate expr' delimitedNonEmpty -> do
937+ CST.ExprRecordUpdate expr' delimitedNonEmpty → do
918938 let
919939 indent' /\ prefix = case lines of
920− MultipleLines -> (indent'' <> indentation) /\ (newline <> indent'' <> indentation)
921− SingleLine -> indent'' /\ space
940+ MultipleLines → (indent'' <> indentation) /\ (newline <> indent'' <> indentation)
941+ SingleLine → indent'' /\ space
922942 formatExpr settings indent'' expr'
923943 <> prefix
924944 <> formatRecordNonEmpty
@@ -926,56 +946,56 @@ formatExpr settings@{ indentation } indent'' expr'' = case expr'' of
926946 indent'
927947 (formatRecordUpdate settings indent')
928948 delimitedNonEmpty
929− CST.ExprSection section -> formatSourceToken settings indent'' blank section
930− CST.ExprString string _ -> formatSourceToken settings indent'' blank string
931− CST.ExprTyped expr' colons type'' -> do
949+ CST.ExprSection section → formatSourceToken settings indent'' blank section
950+ CST.ExprString string _ → formatSourceToken settings indent'' blank string
951+ CST.ExprTyped expr' colons type'' → do
932952 let
933953 indent' /\ prefix = case lines of
934− MultipleLines -> (indent'' <> indentation) /\ (newline <> indent'' <> indentation)
935− SingleLine -> indent'' /\ space
954+ MultipleLines → (indent'' <> indentation) /\ (newline <> indent'' <> indentation)
955+ SingleLine → indent'' /\ space
936956 formatExpr settings indent'' expr'
937957 <> formatSourceToken settings indent'' space colons
938958 <> prefix
939959 <> formatType settings indent' lines type''
940− CST.ExprInt int _ -> formatSourceToken settings indent'' blank int
941− CST.ExprError e -> absurd e
960+ CST.ExprInt int _ → formatSourceToken settings indent'' blank int
961+ CST.ExprError e → absurd e
942962 where
943963 lines = singleOrMultiline expr''
944964
945−formatRecord ::
946− forall a.
947− Settings ->
948− Indent ->
949− (a -> String) ->
950− CST.Delimited a ->
965+formatRecord ∷
966+ ∀ a.
967+ Settings →
968+ Indent →
969+ (a → String) →
970+ CST.Delimited a →
951971 String
952972formatRecord settings indent formatValue = case _ of
953− CST.Wrapped { open, value: Nothing, close } -> do
973+ CST.Wrapped { open, value: Nothing, close } → do
954974 formatSourceToken settings indent blank open
955975 <> formatSourceToken settings indent blank close
956− CST.Wrapped { open, value: Just record', close } ->
976+ CST.Wrapped { open, value: Just record', close } →
957977 formatRecordNonEmpty
958978 settings
959979 indent
960980 formatValue
961981 (CST.Wrapped { open, value: record', close })
962982
963−formatRecordNonEmpty ::
964− forall a.
965− Settings ->
966− Indent ->
967− (a -> String) ->
968− CST.DelimitedNonEmpty a ->
983+formatRecordNonEmpty ∷
984+ ∀ a.
985+ Settings →
986+ Indent →
987+ (a → String) →
988+ CST.DelimitedNonEmpty a →
969989 String
970990formatRecordNonEmpty settings indent formatValue record' = do
971991 let
972992 (before /\ after) = case lines of
973− MultipleLines -> (blank /\ blank)
974− SingleLine -> (space /\ space)
993+ MultipleLines → (blank /\ blank)
994+ SingleLine → (space /\ space)
975995 formatWrapped
976996 settings
977997 indent
978− ( \separated' ->
998+ ( \separated' →
979999 before
9801000 <> formatSeparated settings lines indent space formatValue separated' -- [CHECK] is the lines correct
9811001 <> after
@@ -984,47 +1004,46 @@ formatRecordNonEmpty settings indent formatValue record' = do
9841004 where
9851005 lines = singleOrMultiline record'
9861006
987−formatRecordAccessor ::
988− Lines ->
989− Settings ->
990− Indent ->
991− CST.RecordAccessor Void ->
1007+formatRecordAccessor ∷
1008+ Lines →
1009+ Settings →
1010+ Indent →
1011+ CST.RecordAccessor Void →
9921012 String
9931013formatRecordAccessor lines settings@{ indentation } indent' recordAccessor' = case recordAccessor' of
994− { expr: expr', dot, path } -> do
1014+ { expr: expr', dot, path } → do
9951015 let
9961016 indentTrick = indent' <> indentation
9971017
9981018 indent /\ prefix = case lines of
999− MultipleLines -> indentTrick /\ (newline <> indentTrick)
1000− SingleLine -> indent' /\ blank
1019+ MultipleLines → indentTrick /\ (newline <> indentTrick)
1020+ SingleLine → indent' /\ blank
10011021 formatExpr settings indent expr'
10021022 <> prefix
10031023 <> formatSourceToken settings indent blank dot
10041024 <> formatSeparated
10051025 settings
1006− lines -- (lines.separated SourceRange.label path)
1026+ lines
10071027 indent
10081028 blank
10091029 (formatName settings indent' blank)
10101030 path
10111031
1012−-- [CHECK] Verify lines stuff
1013−formatRecordUpdate ::
1014− Settings ->
1015− Indent ->
1016− CST.RecordUpdate Void ->
1032+formatRecordUpdate ∷
1033+ Settings →
1034+ Indent →
1035+ CST.RecordUpdate Void →
10171036 String
10181037formatRecordUpdate settings@{ indentation } indent' recordUpdate' = case recordUpdate' of
1019− CST.RecordUpdateBranch label' delimitedNonEmpty' -> do
1038+ CST.RecordUpdateBranch label' delimitedNonEmpty' → do
10201039 let
10211040 lines = singleOrMultiline delimitedNonEmpty'
10221041
10231042 indentTrick = indent' <> indentation
10241043
10251044 indent /\ prefix = case lines of
1026− MultipleLines -> indentTrick /\ (newline <> indentTrick)
1027− SingleLine -> indent' /\ space
1045+ MultipleLines → indentTrick /\ (newline <> indentTrick)
1046+ SingleLine → indent' /\ space
10281047 formatName settings indent' blank label'
10291048 <> prefix
10301049 <> formatRecordNonEmpty
@@ -1032,57 +1051,57 @@ formatRecordUpdate settings@{ indentation } indent' recordUpdate' = case recordU
10321051 indent
10331052 (formatRecordUpdate settings indent)
10341053 delimitedNonEmpty'
1035− CST.RecordUpdateLeaf label' equals expr' -> do
1054+ CST.RecordUpdateLeaf label' equals expr' → do
10361055 let
10371056 lines = singleOrMultiline expr'
10381057
10391058 indentTrick = indent' <> indentation
10401059
10411060 indent /\ prefix = case lines of
1042− MultipleLines -> indentTrick /\ (newline <> indentTrick)
1043− SingleLine -> indent' /\ space
1061+ MultipleLines → indentTrick /\ (newline <> indentTrick)
1062+ SingleLine → indent' /\ space
10441063 formatName settings indent' blank label'
10451064 <> formatSourceToken settings indent' space equals
10461065 <> prefix
10471066 <> formatExpr settings indent expr'
10481067
1049−formatRecordLabeled ::
1050− forall a.
1051− RangeOf a =>
1052− Settings ->
1053− Indent ->
1054− (Indent -> a -> String) ->
1055− CST.RecordLabeled a ->
1068+formatRecordLabeled ∷
1069+ ∀ a.
1070+ RangeOf a ⇒
1071+ Settings →
1072+ Indent →
1073+ (Indent → a → String) →
1074+ CST.RecordLabeled a →
10561075 String
10571076formatRecordLabeled settings@{ indentation } indent' f recordLabeled' = case recordLabeled' of
1058− CST.RecordPun name' -> do
1077+ CST.RecordPun name' → do
10591078 formatName settings indent' blank name'
1060− CST.RecordField label' colon a -> do
1079+ CST.RecordField label' colon a → do
10611080 let
10621081 indent /\ prefix = case singleOrMultilineBetween label' a of
1063− MultipleLines -> (indent' <> indentation <> indentation) /\ (newline <> indent' <> indentation <> indentation)
1064− SingleLine -> indent' /\ space
1082+ MultipleLines → (indent' <> indentation <> indentation) /\ (newline <> indent' <> indentation <> indentation)
1083+ SingleLine → indent' /\ space
10651084 formatName settings indent' blank label'
10661085 <> formatSourceToken settings indent' blank colon
10671086 <> prefix
10681087 <> f indent a
10691088
1070−formatLetIn ::
1071− Lines ->
1072− Settings ->
1073− Indent ->
1074− CST.LetIn Void ->
1089+formatLetIn ∷
1090+ Lines →
1091+ Settings →
1092+ Indent →
1093+ CST.LetIn Void →
10751094 String
10761095formatLetIn lines settings@{ indentation } indent' letIn' = case letIn' of
10771096 { keyword: let'
10781097 , bindings: letBindings
10791098 , in: in'
10801099 , body: bodyExpression
1081− } -> do
1100+ } → do
10821101 let
10831102 inPrefix /\ indent /\ prefix = case lines of
1084− MultipleLines -> (newline <> indent') /\ (indent' <> indentation) /\ (newline <> indent' <> indentation)
1085− SingleLine -> space /\ indent' /\ space
1103+ MultipleLines → (newline <> indent') /\ (indent' <> indentation) /\ (newline <> indent' <> indentation)
1104+ SingleLine → space /\ indent' /\ space
10861105 formatSourceToken settings indent' blank let'
10871106 <> foldMap
10881107 (formatLetBinding settings indent prefix newline)
@@ -1093,59 +1112,59 @@ formatLetIn lines settings@{ indentation } indent' letIn' = case letIn' of
10931112 <> prefix
10941113 <> formatExpr settings indent bodyExpression
10951114
1096−formatLambda ::
1097− Lines ->
1098− Settings ->
1099− Indent ->
1100− CST.Lambda Void ->
1115+formatLambda ∷
1116+ Lines →
1117+ Settings →
1118+ Indent →
1119+ CST.Lambda Void →
11011120 String
11021121formatLambda lines settings@{ indentation } indent' lambda' = case lambda' of
1103− { symbol: reverseSolidus, binders, arrow, body: expr' } -> do
1122+ { symbol: reverseSolidus, binders, arrow, body: expr' } → do
11041123 formatSourceToken settings indent' blank reverseSolidus
1105− <> foldMap (\binder' -> formatBinder settings indent' binder' <> space) binders
1124+ <> foldMap (\binder' → formatBinder settings indent' binder' <> space) binders
11061125 <> formatSourceToken settings indent' blank arrow
11071126 <> formatExprPrefix lines settings indent' expr'
11081127
1109−formatExprPrefixElseIf ::
1110− Lines ->
1111− Settings ->
1112− Indent ->
1113− CST.Expr Void ->
1128+formatExprPrefixElseIf ∷
1129+ Lines →
1130+ Settings →
1131+ Indent →
1132+ CST.Expr Void →
11141133 String
11151134formatExprPrefixElseIf lines settings@{ indentation } indent expr' = case expr' of
1116− CST.ExprAdo _ -> formatExprPrefix lines settings indent expr'
1117− CST.ExprApp _ _ -> formatExprPrefix lines settings indent expr'
1118− CST.ExprArray _ -> formatExprPrefix lines settings indent expr'
1119− CST.ExprBoolean _ _ -> formatExprPrefix lines settings indent expr'
1120− CST.ExprCase _ -> formatExprPrefix lines settings indent expr'
1121− CST.ExprChar _ _ -> formatExprPrefix lines settings indent expr'
1122− CST.ExprConstructor _ -> formatExprPrefix lines settings indent expr'
1123− CST.ExprDo _ -> formatExprPrefix lines settings indent expr'
1124− CST.ExprHole _ -> formatExprPrefix lines settings indent expr'
1125− CST.ExprIdent _ -> formatExprPrefix lines settings indent expr'
1126− CST.ExprIf _ -> space <> formatExpr settings indent expr'
1127− CST.ExprInfix _ _ -> formatExprPrefix lines settings indent expr'
1128− CST.ExprLambda _ -> formatExprPrefix lines settings indent expr'
1129− CST.ExprLet _ -> formatExprPrefix lines settings indent expr'
1130− CST.ExprNegate _ _ -> formatExprPrefix lines settings indent expr'
1131− CST.ExprNumber _ _ -> formatExprPrefix lines settings indent expr'
1132− CST.ExprOp _ _ -> formatExprPrefix lines settings indent expr'
1133− CST.ExprOpName _ -> formatExprPrefix lines settings indent expr'
1134− CST.ExprParens _ -> formatExprPrefix lines settings indent expr'
1135− CST.ExprRecord _ -> formatExprPrefix lines settings indent expr'
1136− CST.ExprRecordAccessor _ -> formatExprPrefix lines settings indent expr'
1137− CST.ExprRecordUpdate _ _ -> formatExprPrefix lines settings indent expr'
1138− CST.ExprSection _ -> formatExprPrefix lines settings indent expr'
1139− CST.ExprString _ _ -> formatExprPrefix lines settings indent expr'
1140− CST.ExprTyped _ _ _ -> formatExprPrefix lines settings indent expr'
1141− CST.ExprInt _ _ -> formatExprPrefix lines settings indent expr'
1142− CST.ExprError e -> absurd e
1143−
1144−formatIfThenElse ::
1145− Lines ->
1146− Settings ->
1147− Indent ->
1148− CST.IfThenElse Void ->
1135+ CST.ExprAdo _ → formatExprPrefix lines settings indent expr'
1136+ CST.ExprApp _ _ → formatExprPrefix lines settings indent expr'
1137+ CST.ExprArray _ → formatExprPrefix lines settings indent expr'
1138+ CST.ExprBoolean _ _ → formatExprPrefix lines settings indent expr'
1139+ CST.ExprCase _ → formatExprPrefix lines settings indent expr'
1140+ CST.ExprChar _ _ → formatExprPrefix lines settings indent expr'
1141+ CST.ExprConstructor _ → formatExprPrefix lines settings indent expr'
1142+ CST.ExprDo _ → formatExprPrefix lines settings indent expr'
1143+ CST.ExprHole _ → formatExprPrefix lines settings indent expr'
1144+ CST.ExprIdent _ → formatExprPrefix lines settings indent expr'
1145+ CST.ExprIf _ → space <> formatExpr settings indent expr'
1146+ CST.ExprInfix _ _ → formatExprPrefix lines settings indent expr'
1147+ CST.ExprLambda _ → formatExprPrefix lines settings indent expr'
1148+ CST.ExprLet _ → formatExprPrefix lines settings indent expr'
1149+ CST.ExprNegate _ _ → formatExprPrefix lines settings indent expr'
1150+ CST.ExprNumber _ _ → formatExprPrefix lines settings indent expr'
1151+ CST.ExprOp _ _ → formatExprPrefix lines settings indent expr'
1152+ CST.ExprOpName _ → formatExprPrefix lines settings indent expr'
1153+ CST.ExprParens _ → formatExprPrefix lines settings indent expr'
1154+ CST.ExprRecord _ → formatExprPrefix lines settings indent expr'
1155+ CST.ExprRecordAccessor _ → formatExprPrefix lines settings indent expr'
1156+ CST.ExprRecordUpdate _ _ → formatExprPrefix lines settings indent expr'
1157+ CST.ExprSection _ → formatExprPrefix lines settings indent expr'
1158+ CST.ExprString _ _ → formatExprPrefix lines settings indent expr'
1159+ CST.ExprTyped _ _ _ → formatExprPrefix lines settings indent expr'
1160+ CST.ExprInt _ _ → formatExprPrefix lines settings indent expr'
1161+ CST.ExprError e → absurd e
1162+
1163+formatIfThenElse ∷
1164+ Lines →
1165+ Settings →
1166+ Indent →
1167+ CST.IfThenElse Void →
11491168 String
11501169formatIfThenElse lines settings@{ indentation } indent { keyword: if', cond, then: then', true: true', else: else', false: false' } = do
11511170 formatSourceToken settings indent blank if'
@@ -1159,44 +1178,44 @@ formatIfThenElse lines settings@{ indentation } indent { keyword: if', cond, the
11591178 <> formatExprPrefixElseIf lines settings indent false'
11601179 where
11611180 prefix = case lines of
1162− MultipleLines -> newline <> indent
1163− SingleLine -> space
1164−
1165−formatDoBlock ::
1166− Lines ->
1167− Settings ->
1168− Indent ->
1169− CST.DoBlock Void ->
1181+ MultipleLines → newline <> indent
1182+ SingleLine → space
1183+
1184+formatDoBlock ∷
1185+ Lines →
1186+ Settings →
1187+ Indent →
1188+ CST.DoBlock Void →
11701189 String
11711190formatDoBlock lines settings@{ indentation } indent' doBlock' = case doBlock' of
1172− { keyword: do', statements: doStatements } -> do
1191+ { keyword: do', statements: doStatements } → do
11731192 let
11741193 indentTrick = indent' <> indentation
11751194
11761195 indent /\ prefix = case lines of
1177− MultipleLines -> indentTrick /\ (newline <> indentTrick)
1178− SingleLine -> indent' /\ space
1196+ MultipleLines → indentTrick /\ (newline <> indentTrick)
1197+ SingleLine → indent' /\ space
11791198 formatSourceToken settings indent' blank do'
11801199 <> foldMap
1181− ( \doStatement' ->
1200+ ( \doStatement' →
11821201 prefix
11831202 <> formatDoStatement settings indent doStatement'
11841203 )
11851204 doStatements
11861205
1187−formatDoStatement ::
1188− Settings ->
1189− Indent ->
1190− CST.DoStatement Void ->
1206+formatDoStatement ∷
1207+ Settings →
1208+ Indent →
1209+ CST.DoStatement Void →
11911210 String
11921211formatDoStatement settings@{ indentation } indent' doStatement' = case doStatement' of
1193− CST.DoBind binder' arrow expr' -> do
1212+ CST.DoBind binder' arrow expr' → do
11941213 formatBinder settings indent' binder'
11951214 <> formatSourceToken settings indent' space arrow
11961215 <> formatExprPrefix (singleOrMultiline doStatement') settings indent' expr'
1197− CST.DoDiscard expr' -> do
1216+ CST.DoDiscard expr' → do
11981217 formatExpr settings indent' expr'
1199− CST.DoLet let' letBindings -> do
1218+ CST.DoLet let' letBindings → do
12001219 let
12011220 indent = indent' <> indentation
12021221 formatSourceToken settings indent' blank let'
@@ -1209,20 +1228,20 @@ formatDoStatement settings@{ indentation } indent' doStatement' = case doStateme
12091228 (newline <> indent)
12101229 blank
12111230 (NE.last letBindings)
1212− CST.DoError e -> absurd e
1231+ CST.DoError e → absurd e
12131232
1214−formatCaseOf ::
1215− Lines ->
1216− Settings ->
1217− Indent ->
1218− CST.CaseOf Void ->
1233+formatCaseOf ∷
1234+ Lines →
1235+ Settings →
1236+ Indent →
1237+ CST.CaseOf Void →
12191238 String
12201239formatCaseOf lines settings@{ indentation } indent' caseOf' = case caseOf' of
1221− { keyword: case', head, of: of', branches } -> do
1240+ { keyword: case', head, of: of', branches } → do
12221241 let
12231242 indent /\ prefix = case lines of
1224− MultipleLines -> (indent' <> indentation) /\ (newline <> indent' <> indentation)
1225− SingleLine -> indent' /\ space
1243+ MultipleLines → (indent' <> indentation) /\ (newline <> indent' <> indentation)
1244+ SingleLine → indent' /\ space
12261245 formatSourceToken settings indent' blank case'
12271246 <> space
12281247 <> formatSeparated
@@ -1235,7 +1254,7 @@ formatCaseOf lines settings@{ indentation } indent' caseOf' = case caseOf' of
12351254 <> space
12361255 <> formatSourceToken settings indent' blank of'
12371256 <> foldMap
1238− ( \(binders /\ guarded) ->
1257+ ( \(binders /\ guarded) →
12391258 prefix
12401259 <> formatSeparated
12411260 settings
@@ -1248,21 +1267,21 @@ formatCaseOf lines settings@{ indentation } indent' caseOf' = case caseOf' of
12481267 )
12491268 branches
12501269
1251−formatArray ::
1252− forall a.
1253− RangeOf a =>
1254− Settings ->
1255− Lines ->
1256− Indent ->
1257− (a -> String) ->
1258− CST.Delimited a ->
1270+formatArray ∷
1271+ ∀ a.
1272+ RangeOf a ⇒
1273+ Settings →
1274+ Lines →
1275+ Indent →
1276+ (a → String) →
1277+ CST.Delimited a →
12591278 String
12601279formatArray settings lines indent formatValue = case _ of
12611280 -- Empty array
1262− CST.Wrapped { open, value: Nothing, close } -> do
1281+ CST.Wrapped { open, value: Nothing, close } → do
12631282 formatSourceToken settings indent blank open
12641283 <> formatSourceToken settings indent blank close
1265− CST.Wrapped { open, value: Just array, close } ->
1284+ CST.Wrapped { open, value: Just array, close } →
12661285 formatArrayNonEmpty
12671286 settings
12681287 lines
@@ -1270,68 +1289,68 @@ formatArray settings lines indent formatValue = case _ of
12701289 formatValue
12711290 (CST.Wrapped { open, value: array, close })
12721291
1273−formatArrayNonEmpty ::
1274− forall a.
1275− RangeOf a =>
1276− Settings ->
1277− Lines ->
1278− Indent ->
1279− (a -> String) ->
1280− CST.DelimitedNonEmpty a ->
1292+formatArrayNonEmpty ∷
1293+ ∀ a.
1294+ RangeOf a ⇒
1295+ Settings →
1296+ Lines →
1297+ Indent →
1298+ (a → String) →
1299+ CST.DelimitedNonEmpty a →
12811300 String
12821301formatArrayNonEmpty settings lines indent formatValue = formatWrapped settings indent formatOne
12831302 where
12841303 before /\ after = case lines of
1285− MultipleLines -> blank /\ blank
1286− SingleLine -> space /\ space
1304+ MultipleLines → blank /\ blank
1305+ SingleLine → space /\ space
12871306
1288− formatOne (separated :: CST.Separated a) =
1307+ formatOne (separated ∷ CST.Separated a) =
12891308 before
12901309 <> formatSeparated settings (singleOrMultiline separated) indent space formatValue separated
12911310 <> after
12921311
1293−formatAdoBlock ::
1294− Lines ->
1295− Settings ->
1296− Indent ->
1297− CST.AdoBlock Void ->
1312+formatAdoBlock ∷
1313+ Lines →
1314+ Settings →
1315+ Indent →
1316+ CST.AdoBlock Void →
12981317 String
12991318formatAdoBlock lines settings@{ indentation } indent' { keyword, statements: doStatements, in: in', result: expr' } = do
13001319 let
13011320 { indent, prefix } = case lines of
1302− MultipleLines -> do
1321+ MultipleLines → do
13031322 let
13041323 indent = indent' <> indentation
13051324 { indent, prefix: newline <> indent }
1306− SingleLine -> { indent: indent', prefix: space }
1325+ SingleLine → { indent: indent', prefix: space }
13071326 formatSourceToken settings indent' blank keyword
13081327 <> foldMap
1309− (\doStatement' -> prefix <> formatDoStatement settings indent doStatement')
1328+ (\doStatement' → prefix <> formatDoStatement settings indent doStatement')
13101329 doStatements
13111330 <> prefix
13121331 <> formatSourceToken settings indent' blank in'
13131332 <> space
13141333 <> formatExpr settings indent expr'
13151334
1316−formatLabeledNameType ::
1317− forall a.
1318− Settings ->
1319− Indent ->
1320− CST.Labeled (CST.Name a) (CST.Type Void) ->
1335+formatLabeledNameType ∷
1336+ ∀ a.
1337+ Settings →
1338+ Indent →
1339+ CST.Labeled (CST.Name a) (CST.Type Void) →
13211340 String
13221341formatLabeledNameType settings indent labeled =
13231342 formatLabeled
13241343 settings
13251344 indent
13261345 (formatName settings indent blank)
1327− (\x -> formatType settings x (singleOrMultiline labeled))
1346+ (\x → formatType settings x (singleOrMultiline labeled))
13281347 labeled
13291348
1330−formatClassHead ::
1331− Lines ->
1332− Settings ->
1333− Indent ->
1334− CST.ClassHead Void ->
1349+formatClassHead ∷
1350+ Lines →
1351+ Settings →
1352+ Indent →
1353+ CST.ClassHead Void →
13351354 String
13361355formatClassHead lines settings@{ indentation } indent { keyword, super, name, vars, fundeps } = do
13371356 formatSourceToken settings indented blank keyword
@@ -1341,11 +1360,11 @@ formatClassHead lines settings@{ indentation } indent { keyword, super, name, va
13411360 <> foldMap formatFunctionalDependency fundeps
13421361 where
13431362 { indented, prefix } = case lines of
1344− MultipleLines -> do
1363+ MultipleLines → do
13451364 let
13461365 indented = indent <> indentation
13471366 { indented, prefix: newline <> indented }
1348− SingleLine -> { indented: indent, prefix: space }
1367+ SingleLine → { indented: indent, prefix: space }
13491368
13501369 formatTypeVariableBinding binding = space <> formatTypeVarBinding settings indent binding
13511370
@@ -1370,48 +1389,48 @@ formatClassHead lines settings@{ indentation } indent { keyword, super, name, va
13701389 constraints
13711390 <> formatSourceToken settings indent space arrow
13721391
1373−formatClassFundep ::
1374− Settings ->
1375− Indent ->
1376− CST.ClassFundep ->
1392+formatClassFundep ∷
1393+ Settings →
1394+ Indent →
1395+ CST.ClassFundep →
13771396 String
13781397formatClassFundep settings indent = case _ of
1379− CST.FundepDetermined arrow names ->
1398+ CST.FundepDetermined arrow names →
13801399 formatSourceToken settings indent blank arrow
13811400 <> foldMap (formatName settings indent space) names
1382− CST.FundepDetermines names arrow moreNames -> do
1383− foldMap (\name -> formatName settings indent blank name <> space) names
1401+ CST.FundepDetermines names arrow moreNames → do
1402+ foldMap (\name → formatName settings indent blank name <> space) names
13841403 <> formatSourceToken settings indent blank arrow
13851404 <> foldMap (formatName settings indent space) moreNames
13861405
1387−formatOneOrDelimited ::
1388− forall a.
1389− RangeOf a =>
1390− Settings ->
1391− Lines ->
1392− Indent ->
1393− (a -> String) ->
1394− CST.OneOrDelimited a ->
1406+formatOneOrDelimited ∷
1407+ ∀ a.
1408+ RangeOf a ⇒
1409+ Settings →
1410+ Lines →
1411+ Indent →
1412+ (a → String) →
1413+ CST.OneOrDelimited a →
13951414 String
13961415formatOneOrDelimited settings lines indent formatValue oneOrDelimited = case oneOrDelimited of
1397− CST.One a -> formatValue a
1398− CST.Many delimitedNonEmpty -> formatDelimitedNonEmpty settings lines indent formatValue delimitedNonEmpty
1399−
1400−formatDelimitedNonEmpty ::
1401− forall a.
1402− RangeOf a =>
1403− Settings ->
1404− Lines ->
1405− Indent ->
1406− (a -> String) ->
1407− CST.DelimitedNonEmpty a ->
1416+ CST.One a → formatValue a
1417+ CST.Many delimitedNonEmpty → formatDelimitedNonEmpty settings lines indent formatValue delimitedNonEmpty
1418+
1419+formatDelimitedNonEmpty ∷
1420+ ∀ a.
1421+ RangeOf a ⇒
1422+ Settings →
1423+ Lines →
1424+ Indent →
1425+ (a → String) →
1426+ CST.DelimitedNonEmpty a →
14081427 String
14091428formatDelimitedNonEmpty settings lines indent formatValue = formatWrapped settings indent (formatSeparated settings lines indent space formatValue)
14101429
1411−formatDataConstructor ::
1412− Settings ->
1413− Indent ->
1414− CST.DataCtor Void ->
1430+formatDataConstructor ∷
1431+ Settings →
1432+ Indent →
1433+ CST.DataCtor Void →
14151434 String
14161435formatDataConstructor settings@{ indentation } indent constructor@(CST.DataCtor { name, fields }) =
14171436 space
@@ -1421,48 +1440,48 @@ formatDataConstructor settings@{ indentation } indent constructor@(CST.DataCtor
14211440 lines = singleOrMultiline constructor
14221441
14231442 { indented, prefix } = case lines of
1424− MultipleLines -> do
1443+ MultipleLines → do
14251444 let
14261445 indented = indent <> indentation
14271446 { indented, prefix: newline <> indented }
1428− SingleLine ->
1447+ SingleLine →
14291448 { indented: indent
1430− , prefix: space
1449+ , prefix: space
14311450 }
14321451
14331452 formatField typo = prefix <> formatType settings indented lines typo
14341453
14351454-- | Formats the `data Maybe a` part of `data Maybe a = Just a | Nothing`
1436−formatDataHead :: Settings -> Indent -> CST.DataHead Void -> String
1455+formatDataHead ∷ Settings → Indent → CST.DataHead Void → String
14371456formatDataHead settings indent { keyword, name, vars } =
14381457 formatSourceToken settings indent blank keyword
14391458 <> formatName settings indent space name
14401459 <> formatTypeVarBindings settings indent vars
14411460
1442−formatTypeVarBindings ::
1443− Settings ->
1444− Indent ->
1445− Array (CST.TypeVarBinding Void) ->
1461+formatTypeVarBindings ∷
1462+ Settings →
1463+ Indent →
1464+ Array (CST.TypeVarBinding Void) →
14461465 String
14471466formatTypeVarBindings settings indent = foldMap (pure space <> formatTypeVarBinding settings indent)
14481467
1449−formatTypeVarBinding ::
1450− Settings ->
1451− Indent ->
1452− CST.TypeVarBinding Void ->
1468+formatTypeVarBinding ∷
1469+ Settings →
1470+ Indent →
1471+ CST.TypeVarBinding Void →
14531472 String
14541473formatTypeVarBinding settings indent = case _ of
1455− CST.TypeVarName name -> formatName settings indent blank name
1456− CST.TypeVarKinded wrapped -> formatWrapped settings indent (formatLabeledName settings indent) wrapped
1457−
1458−formatType ::
1459− Settings ->
1460− Indent ->
1461− Lines ->
1462− CST.Type Void ->
1474+ CST.TypeVarName name → formatName settings indent blank name
1475+ CST.TypeVarKinded wrapped → formatWrapped settings indent (formatLabeledName settings indent) wrapped
1476+
1477+formatType ∷
1478+ Settings →
1479+ Indent →
1480+ Lines →
1481+ CST.Type Void →
14631482 String
14641483formatType settings@{ indentation } indent lines t = case t of
1465− CST.TypeApp typo types ->
1484+ CST.TypeApp typo types →
14661485 formatType settings indent (singleOrMultiline typo) typo
14671486 <> foldMap formatTypeWithPredecessor
14681487 (Array.zip typesArray (typo Array.: typesArray))
@@ -1472,9 +1491,9 @@ formatType settings@{ indentation } indent lines t = case t of
14721491 formatTypeWithPredecessor (curr /\ pred) = prefix <> formatType settings indented (singleOrMultiline curr) curr
14731492 where
14741493 { indented, prefix } = case singleOrMultilineBetween curr pred of
1475− MultipleLines -> { indented: indent <> indentation, prefix: newline <> indent <> indentation }
1476− SingleLine -> { indented: indent, prefix: space }
1477− CST.TypeArrow t1 arrow t2 ->
1494+ MultipleLines → { indented: indent <> indentation, prefix: newline <> indent <> indentation }
1495+ SingleLine → { indented: indent, prefix: space }
1496+ CST.TypeArrow t1 arrow t2 →
14781497 formatType settings indent (singleOrMultiline t1) t1
14791498 <> space
14801499 <> formatSourceToken settings indent blank arrow
@@ -1482,17 +1501,17 @@ formatType settings@{ indentation } indent lines t = case t of
14821501 <> formatType settings indent (singleOrMultiline t2) t2
14831502 where
14841503 prefix = case lines of
1485− MultipleLines -> newline <> indent
1486− SingleLine -> space
1487− CST.TypeArrowName arrowName -> formatSourceToken settings indent blank arrowName
1488− CST.TypeVar name -> formatName settings indent blank name
1489− CST.TypeConstructor qualifiedName -> formatQualifiedName settings indent blank qualifiedName
1490− CST.TypeWildcard wildcard -> formatSourceToken settings indent blank wildcard
1491− CST.TypeHole name -> formatName settings indent blank name
1492− CST.TypeString typeString _ -> formatSourceToken settings indent blank typeString
1493− CST.TypeRow wrappedRow -> formatWrappedRow settings indent wrappedRow
1494− CST.TypeRecord wrappedRow -> formatWrappedRow settings indent wrappedRow
1495− CST.TypeForall forAll typeVarBindings dot tailType ->
1504+ MultipleLines → newline <> indent
1505+ SingleLine → space
1506+ CST.TypeArrowName arrowName → formatSourceToken settings indent blank arrowName
1507+ CST.TypeVar name → formatName settings indent blank name
1508+ CST.TypeConstructor qualifiedName → formatQualifiedName settings indent blank qualifiedName
1509+ CST.TypeWildcard wildcard → formatSourceToken settings indent blank wildcard
1510+ CST.TypeHole name → formatName settings indent blank name
1511+ CST.TypeString typeString _ → formatSourceToken settings indent blank typeString
1512+ CST.TypeRow wrappedRow → formatWrappedRow settings indent wrappedRow
1513+ CST.TypeRecord wrappedRow → formatWrappedRow settings indent wrappedRow
1514+ CST.TypeForall forAll typeVarBindings dot tailType →
14961515 formatSourceToken settings indent blank forAll
14971516 <> formatTypeVarBindings settings indent (NE.toArray typeVarBindings)
14981517 <> formatSourceToken settings indent blank dot
@@ -1500,9 +1519,9 @@ formatType settings@{ indentation } indent lines t = case t of
15001519 <> formatType settings indent lines tailType
15011520 where
15021521 prefix = case lines of
1503− MultipleLines -> newline <> indent
1504− SingleLine -> space
1505− CST.TypeKinded typo colons kind ->
1522+ MultipleLines → newline <> indent
1523+ SingleLine → space
1524+ CST.TypeKinded typo colons kind →
15061525 formatType settings indent lines typo
15071526 <> space
15081527 <> formatSourceToken settings indent blank colons
@@ -1510,9 +1529,9 @@ formatType settings@{ indentation } indent lines t = case t of
15101529 <> formatType settings indented lines kind
15111530 where
15121531 { indented, prefix } = case lines of
1513− MultipleLines -> { indented: indent <> indentation, prefix: newline <> indent }
1514− SingleLine -> { indented: indent, prefix: space }
1515− CST.TypeOp typo types ->
1532+ MultipleLines → { indented: indent <> indentation, prefix: newline <> indent }
1533+ SingleLine → { indented: indent, prefix: space }
1534+ CST.TypeOp typo types →
15161535 formatType settings indent (singleOrMultiline typo) typo
15171536 <> foldMap formatOp types -- [TODO] Verify
15181537 where
@@ -1522,10 +1541,10 @@ formatType settings@{ indentation } indent lines t = case t of
15221541 <> formatType settings indented (singleOrMultiline anotherType) anotherType
15231542 where
15241543 { indented, prefix } = case lines of
1525− MultipleLines -> { indented: indent <> indentation, prefix: newline <> indent }
1526− SingleLine -> { indented: indent, prefix: space }
1527− CST.TypeOpName op -> formatQualifiedName settings indent blank op
1528− CST.TypeConstrained constraint arrow typo ->
1544+ MultipleLines → { indented: indent <> indentation, prefix: newline <> indent }
1545+ SingleLine → { indented: indent, prefix: space }
1546+ CST.TypeOpName op → formatQualifiedName settings indent blank op
1547+ CST.TypeConstrained constraint arrow typo →
15291548 formatType settings indent lines constraint
15301549 <> space
15311550 <> formatSourceToken settings indent blank arrow
@@ -1533,33 +1552,33 @@ formatType settings@{ indentation } indent lines t = case t of
15331552 <> formatType settings indent lines typo
15341553 where
15351554 prefix = case lines of
1536− MultipleLines -> newline <> indent
1537− SingleLine -> space
1538− CST.TypeParens wrapped ->
1555+ MultipleLines → newline <> indent
1556+ SingleLine → space
1557+ CST.TypeParens wrapped →
15391558 formatParens lines settings indent
1540− ( \x wrappedType ->
1559+ ( \x wrappedType →
15411560 formatType settings x (singleOrMultiline wrappedType) wrappedType
15421561 )
15431562 wrapped
1544− CST.TypeUnaryRow sourceToken typo ->
1563+ CST.TypeUnaryRow sourceToken typo →
15451564 formatSourceToken settings indent blank sourceToken
15461565 <> prefix
15471566 <> formatType settings indent lines typo
15481567 where
15491568 prefix = case lines of
1550− MultipleLines -> newline <> indent
1551− SingleLine -> space
1552− CST.TypeError e -> absurd e
1553−
1554−formatLabeled ::
1555− forall a b.
1556− RangeOf a =>
1557− RangeOf b =>
1558− Settings ->
1559− Indent ->
1560− (a -> String) ->
1561− (Indent -> b -> String) ->
1562− CST.Labeled a b ->
1569+ MultipleLines → newline <> indent
1570+ SingleLine → space
1571+ CST.TypeError e → absurd e
1572+
1573+formatLabeled ∷
1574+ ∀ a b.
1575+ RangeOf a ⇒
1576+ RangeOf b ⇒
1577+ Settings →
1578+ Indent →
1579+ (a → String) →
1580+ (Indent → b → String) →
1581+ CST.Labeled a b →
15631582 String
15641583formatLabeled settings@{ indentation } indent' formatLabel formatValue labeled@(CST.Labeled { label, separator, value }) =
15651584 formatLabel label
@@ -1568,61 +1587,61 @@ formatLabeled settings@{ indentation } indent' formatLabel formatValue labeled@(
15681587 <> formatValue indent value
15691588 where
15701589 { indent, prefix } = case singleOrMultiline labeled of
1571− MultipleLines -> do
1590+ MultipleLines → do
15721591 { indent: indent' <> indentation
15731592 , prefix: newline <> indent' <> indentation
15741593 }
1575− SingleLine -> { indent: indent', prefix: space }
1576−
1577−formatLabeledName ::
1578− forall n.
1579− RangeOf (CST.Name n) =>
1580− Settings ->
1581− Indent ->
1582− CST.Labeled (CST.Name n) (CST.Type Void) ->
1594+ SingleLine → { indent: indent', prefix: space }
1595+
1596+formatLabeledName ∷
1597+ ∀ n.
1598+ RangeOf (CST.Name n) ⇒
1599+ Settings →
1600+ Indent →
1601+ CST.Labeled (CST.Name n) (CST.Type Void) →
15831602 String
15841603formatLabeledName settings@{ indentation } indent labeledName =
15851604 formatLabeled
15861605 settings
15871606 indent
15881607 (formatName settings indent blank)
1589− (\x -> formatType settings x (singleOrMultiline labeledName))
1608+ (\x → formatType settings x (singleOrMultiline labeledName))
15901609 labeledName
15911610
1592−formatParens ::
1593− forall a.
1594− Lines ->
1595− Settings ->
1596− Indent ->
1597− (Indent -> a -> String) ->
1598− CST.Wrapped a ->
1611+formatParens ∷
1612+ ∀ a.
1613+ Lines →
1614+ Settings →
1615+ Indent →
1616+ (Indent → a → String) →
1617+ CST.Wrapped a →
15991618 String
16001619formatParens lines settings@{ indentation } indent formatValue wrapped = do
16011620 formatWrapped settings indent (formatValue indented) wrapped
16021621 where
16031622 indented = case lines of
1604− MultipleLines -> indent <> indentation
1605− SingleLine -> indent
1606−
1607−formatRow ::
1608− Lines ->
1609− Settings ->
1610− Indent ->
1611− CST.Row Void ->
1623+ MultipleLines → indent <> indentation
1624+ SingleLine → indent
1625+
1626+formatRow ∷
1627+ Lines →
1628+ Settings →
1629+ Indent →
1630+ CST.Row Void →
16121631 String
16131632formatRow lines settings@{ indentation } indent (CST.Row { labels, tail }) = case labels, tail of
1614− Nothing, Nothing -> blank
1615− Just ls, Nothing ->
1633+ Nothing, Nothing → blank
1634+ Just ls, Nothing →
16161635 before
16171636 <> formatSeparated settings lines indent space f ls
16181637 <> after
16191638 where
16201639 { before, indented, after } = case lines of
1621− MultipleLines -> { before: blank, indented: indent <> indentation, after: blank }
1622− SingleLine -> { before: space, indented: indent, after: space }
1640+ MultipleLines → { before: blank, indented: indent <> indentation, after: blank }
1641+ SingleLine → { before: space, indented: indent, after: space }
16231642
16241643 f = formatLabeledName settings indented
1625− Nothing, Just (bar /\ tailType) -> do
1644+ Nothing, Just (bar /\ tailType) → do
16261645 before
16271646 <> formatSourceToken settings indent blank bar
16281647 <> space
@@ -1630,9 +1649,9 @@ formatRow lines settings@{ indentation } indent (CST.Row { labels, tail }) = cas
16301649 <> after
16311650 where
16321651 { before, after } = case lines of
1633− MultipleLines -> { before: newline <> indent, after: blank }
1634− SingleLine -> { before: space, after: space }
1635− Just ls, Just (bar /\ tailType) -> do
1652+ MultipleLines → { before: newline <> indent, after: blank }
1653+ SingleLine → { before: space, after: space }
1654+ Just ls, Just (bar /\ tailType) → do
16361655 before
16371656 <> formatSeparated settings lines indent space f ls
16381657 <> prefix
@@ -1642,45 +1661,44 @@ formatRow lines settings@{ indentation } indent (CST.Row { labels, tail }) = cas
16421661 <> after
16431662 where
16441663 { before, indented, after, prefix } = case lines of
1645− MultipleLines -> { before: blank, indented: indent <> indentation, after: blank, prefix: newline <> indent }
1646− SingleLine -> { before: space, indented: indent, after: space, prefix: space }
1664+ MultipleLines → { before: blank, indented: indent <> indentation, after: blank, prefix: newline <> indent }
1665+ SingleLine → { before: space, indented: indent, after: space, prefix: space }
16471666
16481667 f = formatLabeledName settings indented
16491668
1650−formatSeparated ::
1651− forall a.
1652− Settings ->
1653− Lines ->
1654− Indent ->
1655− Prefix ->
1656− (a -> String) ->
1657− CST.Separated a ->
1669+formatSeparated ∷
1670+ ∀ a.
1671+ Settings →
1672+ Lines →
1673+ Indent →
1674+ Prefix →
1675+ (a → String) →
1676+ CST.Separated a →
16581677 String
16591678formatSeparated settings lines indent prefix' formatValue (CST.Separated { head, tail }) = formatValue head <> foldMap go tail
16601679 where
16611680 prefix = case lines of
1662− MultipleLines -> newline <> indent
1663− SingleLine -> blank
1681+ MultipleLines → newline <> indent
1682+ SingleLine → blank
16641683
1665− go :: CST.SourceToken /\ a -> String
1684+ go ∷ CST.SourceToken /\ a → String
16661685 go (separator /\ value) =
16671686 prefix
16681687 <> formatSourceToken settings indent blank separator
16691688 <> prefix'
16701689 <> formatValue value
16711690
1672−formatName :: forall a. Settings -> Indent -> Prefix -> CST.Name a -> String
1673−formatName settings indent prefix (CST.Name { token }) =
1674− formatSourceToken settings indent prefix token
1691+formatName ∷ ∀ a. Settings → Indent → Prefix → CST.Name a → String
1692+formatName settings indent prefix (CST.Name { token }) = formatSourceToken settings indent prefix token
16751693
1676−formatQualifiedName :: forall a. Settings -> Indent -> Prefix -> CST.QualifiedName a -> String
1694+formatQualifiedName ∷ ∀ a. Settings → Indent → Prefix → CST.QualifiedName a → String
16771695formatQualifiedName settings indent prefix (CST.QualifiedName { token }) = formatSourceToken settings indent prefix token
16781696
1679−formatSourceToken ::
1680− Settings ->
1681− Indent ->
1682− Prefix ->
1683− CST.SourceToken ->
1697+formatSourceToken ∷
1698+ Settings →
1699+ Indent →
1700+ Prefix →
1701+ CST.SourceToken →
16841702 String
16851703formatSourceToken settings indent prefix { leadingComments, trailingComments, value } =
16861704 formatCommentsLeading indent prefix leadingComments
@@ -1688,95 +1706,89 @@ formatSourceToken settings indent prefix { leadingComments, trailingComments, va
16881706 <> print value
16891707 <> formatCommentsTrailing prefix trailingComments
16901708 where
1691− print = case settings.sourceStyle of
1692− Nothing -> Print.printToken
1693− Just style -> printWithStyle style
1694− printWithStyle style v = case v of
1695− CST.TokLeftArrow _ ->
1696− case style of
1697− CST.ASCII -> "<-"
1698− CST.Unicode -> "←"
1699− CST.TokRightArrow _ ->
1700− case style of
1701− CST.ASCII -> "->"
1702− CST.Unicode -> "→"
1703− CST.TokRightFatArrow _ ->
1704− case style of
1705− CST.ASCII -> "=>"
1706− CST.Unicode -> "⇒"
1707− CST.TokDoubleColon _ ->
1708− case style of
1709− CST.ASCII -> "::"
1710− CST.Unicode -> "∷"
1711− CST.TokForall _ ->
1712− case style of
1713− CST.ASCII -> "forall"
1714− CST.Unicode -> "∀"
1715− CST.TokSymbolArrow _ ->
1716− case style of
1717− CST.ASCII -> "(->)"
1718− CST.Unicode -> "(→)"
1719− _ -> Print.printToken v
1720−
1721−formatCommentLeading ::
1722− Indent ->
1723− Prefix ->
1724− CST.Comment CST.LineFeed ->
1709+ print = case settings.sourceStyle of
1710+ Nothing → Print.printToken
1711+ Just style → printWithStyle style
1712+ printWithStyle style v = case v of
1713+ CST.TokLeftArrow _ → case style of
1714+ CST.ASCII → "<-"
1715+ CST.Unicode → "←"
1716+ CST.TokRightArrow _ → case style of
1717+ CST.ASCII → "->"
1718+ CST.Unicode → "→"
1719+ CST.TokRightFatArrow _ → case style of
1720+ CST.ASCII → "=>"
1721+ CST.Unicode → "⇒"
1722+ CST.TokDoubleColon _ → case style of
1723+ CST.ASCII → "::"
1724+ CST.Unicode → "∷"
1725+ CST.TokForall _ → case style of
1726+ CST.ASCII → "forall"
1727+ CST.Unicode → "∀"
1728+ CST.TokSymbolArrow _ → case style of
1729+ CST.ASCII → "(->)"
1730+ CST.Unicode → "(→)"
1731+ _ → Print.printToken v
1732+
1733+formatCommentLeading ∷
1734+ Indent →
1735+ Prefix →
1736+ CST.Comment CST.LineFeed →
17251737 String
17261738formatCommentLeading indent prefix = case _ of
1727− CST.Comment comment -> do
1739+ CST.Comment comment → do
17281740 prefix <> comment <> newline <> indent
1729− CST.Line _ _ -> blank
1730− CST.Space _ -> blank
1741+ CST.Line _ _ → blank
1742+ CST.Space _ → blank
17311743
1732−formatCommentTrailing ::
1733− Prefix ->
1734− CST.Comment Void ->
1744+formatCommentTrailing ∷
1745+ Prefix →
1746+ CST.Comment Void →
17351747 String
17361748formatCommentTrailing prefix comment'' = case comment'' of
1737− CST.Comment comment' -> prefix <> space <> comment'
1738− CST.Line _ _ -> blank
1739− CST.Space _ -> blank
1740−
1741−formatCommentsLeading ::
1742− Indent ->
1743− Prefix ->
1744− Array (CST.Comment CST.LineFeed) ->
1749+ CST.Comment comment' → prefix <> space <> comment'
1750+ CST.Line _ _ → blank
1751+ CST.Space _ → blank
1752+
1753+formatCommentsLeading ∷
1754+ Indent →
1755+ Prefix →
1756+ Array (CST.Comment CST.LineFeed) →
17451757 String
17461758formatCommentsLeading indent prefix commentsLeading' = case commentsLeading' of
1747− [] -> blank
1748− _ -> foldMap (formatCommentLeading indent prefix) commentsLeading'
1759+ [] → blank
1760+ _ → foldMap (formatCommentLeading indent prefix) commentsLeading'
17491761
1750−formatCommentsTrailing ::
1751− Prefix ->
1752− Array (CST.Comment Void) ->
1762+formatCommentsTrailing ∷
1763+ Prefix →
1764+ Array (CST.Comment Void) →
17531765 String
17541766formatCommentsTrailing prefix commentsTrailing' = case commentsTrailing' of
1755− [] -> blank
1756− _ -> foldMap (formatCommentTrailing prefix) commentsTrailing'
1767+ [] → blank
1768+ _ → foldMap (formatCommentTrailing prefix) commentsTrailing'
17571769
1758−formatCommentsTrailingModule ::
1759− Array (CST.Comment CST.LineFeed) ->
1770+formatCommentsTrailingModule ∷
1771+ Array (CST.Comment CST.LineFeed) →
17601772 String
17611773formatCommentsTrailingModule commentsTrailing' = do
17621774 let
17631775 comments = map formatComment commentsTrailing'
17641776 case NE.fromArray (Array.catMaybes comments) of
1765− Nothing -> blank
1766− Just comments -> newline <> fold (NE.intersperse newline comments) <> newline
1777+ Nothing → blank
1778+ Just comments → newline <> fold (NE.intersperse newline comments) <> newline
17671779
1768−formatComment :: forall lf. CST.Comment lf -> Maybe String
1780+formatComment ∷ ∀ lf. CST.Comment lf → Maybe String
17691781formatComment = case _ of
1770− CST.Comment comment -> Just comment
1771− CST.Space _ -> Nothing
1772− CST.Line _ _ -> Nothing
1773−
1774−formatWrapped ::
1775− forall a.
1776− Settings ->
1777− Indent ->
1778− (a -> String) ->
1779− CST.Wrapped a ->
1782+ CST.Comment comment → Just comment
1783+ CST.Space _ → Nothing
1784+ CST.Line _ _ → Nothing
1785+
1786+formatWrapped ∷
1787+ ∀ a.
1788+ Settings →
1789+ Indent →
1790+ (a → String) →
1791+ CST.Wrapped a →
17801792 String
17811793formatWrapped settings indent formatValue wrapped@(CST.Wrapped { open, value, close }) =
17821794 formatSourceToken settings indent blank open
@@ -1786,13 +1798,13 @@ formatWrapped settings indent formatValue wrapped@(CST.Wrapped { open, value, cl
17861798 <> formatSourceToken settings indent blank close
17871799 where
17881800 { before, after } = case singleOrMultiline wrapped of
1789− MultipleLines -> { before: space, after: newline <> indent }
1790− SingleLine -> { before: blank, after: blank }
1801+ MultipleLines → { before: space, after: newline <> indent }
1802+ SingleLine → { before: blank, after: blank }
17911803
1792−formatWrappedRow ::
1793− Settings ->
1794− Indent ->
1795− CST.Wrapped (CST.Row Void) ->
1804+formatWrappedRow ∷
1805+ Settings →
1806+ Indent →
1807+ CST.Wrapped (CST.Row Void) →
17961808 String
17971809formatWrappedRow settings@{ indentation } indent wrapped@(CST.Wrapped { open, value: row, close }) =
17981810 formatSourceToken settings indent blank open
@@ -1804,9 +1816,9 @@ formatWrappedRow settings@{ indentation } indent wrapped@(CST.Wrapped { open, va
18041816 lines = singleOrMultiline wrapped
18051817
18061818 before /\ after = case row, lines of
1807− CST.Row { labels: Just _ }, MultipleLines -> space /\ (newline <> indent)
1808− CST.Row { labels: Nothing }, MultipleLines -> blank /\ (newline <> indent)
1809− _, SingleLine -> blank /\ blank
1819+ CST.Row { labels: Just _ }, MultipleLines → space /\ (newline <> indent)
1820+ CST.Row { labels: Nothing }, MultipleLines → blank /\ (newline <> indent)
1821+ _, SingleLine → blank /\ blank
18101822
18111823type Indentation
18121824 = String -- [TODO] Use Numbers
@@ -1820,12 +1832,11 @@ type Prefix
18201832type Suffix
18211833 = String
18221834
1823−newline :: String
1835+newline ∷ String
18241836newline = "\n"
18251837
1826−blank :: String
1838+blank ∷ String
18271839blank = ""
18281840
1829−space :: String
1841+space ∷ String
18301842space = " "
1831−
packages/core/testfiles/golden/Where.purs+8
@@ -5,6 +5,13 @@ foo = x
55 x = y
66 y = 1
77
8+funk = x
9+
10+ where
11+ x = y
12+
13+ y = 1
14+
815girl = x
916 where
1017 x = y
@@ -16,4 +23,5 @@ boy = x
1623
1724 x = y
1825
26+ -- breaks
1927 y = 1
packages/core/testfiles/original/Where.purs+8−1
@@ -5,6 +5,13 @@ foo = x
55 x = y
66 y = 1
77
8+funk = x
9+
10+ where
11+ x = y
12+
13+ y = 1
14+
815girl = x
916 where
1017 x = y
@@ -17,5 +24,5 @@ boy = x
1724 x = y
1825
1926
20−
27+ -- breaks
2128 y = 1
packages/prettier-plugin-purescript/index.js+887−101
@@ -428,6 +428,18 @@ var PS = {};
428428 return xs.length;
429429 };
430430
431+ //------------------------------------------------------------------------------
432+ // Non-indexed reads -----------------------------------------------------------
433+ //------------------------------------------------------------------------------
434+
435+ exports.unconsImpl = function (empty) {
436+ return function (next) {
437+ return function (xs) {
438+ return xs.length === 0 ? empty({}) : next(xs[0])(xs.slice(1));
439+ };
440+ };
441+ };
442+
431443 //------------------------------------------------------------------------------
432444 // Indexed operations ----------------------------------------------------------
433445 //------------------------------------------------------------------------------
@@ -841,6 +853,11 @@ var PS = {};
841853 var unsafeIndex = function (dictPartial) {
842854 return $foreign.unsafeIndexImpl;
843855 };
856+ var tail = $foreign.unconsImpl(Data_Function["const"](Data_Maybe.Nothing.value))(function (v) {
857+ return function (xs) {
858+ return new Data_Maybe.Just(xs);
859+ };
860+ });
844861 var snoc = function (xs) {
845862 return function (x) {
846863 return Data_Array_ST.withArray(Data_Array_ST.push(x))(xs)();
@@ -892,6 +909,60 @@ var PS = {};
892909 var last = function (xs) {
893910 return index(xs)($foreign.length(xs) - 1 | 0);
894911 };
912+ var span = function (p) {
913+ return function (arr) {
914+ var go = function ($copy_i) {
915+ var $tco_done = false;
916+ var $tco_result;
917+ function $tco_loop(i) {
918+ var v = index(arr)(i);
919+ if (v instanceof Data_Maybe.Just) {
920+ var $74 = p(v.value0);
921+ if ($74) {
922+ $copy_i = i + 1 | 0;
923+ return;
924+ };
925+ $tco_done = true;
926+ return new Data_Maybe.Just(i);
927+ };
928+ if (v instanceof Data_Maybe.Nothing) {
929+ $tco_done = true;
930+ return Data_Maybe.Nothing.value;
931+ };
932+ throw new Error("Failed pattern match at Data.Array (line 966, column 5 - line 968, column 25): " + [ v.constructor.name ]);
933+ };
934+ while (!$tco_done) {
935+ $tco_result = $tco_loop($copy_i);
936+ };
937+ return $tco_result;
938+ };
939+ var breakIndex = go(0);
940+ if (breakIndex instanceof Data_Maybe.Just && breakIndex.value0 === 0) {
941+ return {
942+ init: [ ],
943+ rest: arr
944+ };
945+ };
946+ if (breakIndex instanceof Data_Maybe.Just) {
947+ return {
948+ init: $foreign.slice(0)(breakIndex.value0)(arr),
949+ rest: $foreign.slice(breakIndex.value0)($foreign.length(arr))(arr)
950+ };
951+ };
952+ if (breakIndex instanceof Data_Maybe.Nothing) {
953+ return {
954+ init: arr,
955+ rest: [ ]
956+ };
957+ };
958+ throw new Error("Failed pattern match at Data.Array (line 953, column 3 - line 959, column 30): " + [ breakIndex.constructor.name ]);
959+ };
960+ };
961+ var takeWhile = function (p) {
962+ return function (xs) {
963+ return (span(p)(xs)).init;
964+ };
965+ };
895966 var head = function (xs) {
896967 return index(xs)(0);
897968 };
@@ -915,9 +986,11 @@ var PS = {};
915986 exports["snoc"] = snoc;
916987 exports["head"] = head;
917988 exports["last"] = last;
989+ exports["tail"] = tail;
918990 exports["init"] = init;
919991 exports["intersperse"] = intersperse;
920992 exports["catMaybes"] = catMaybes;
993+ exports["takeWhile"] = takeWhile;
921994 exports["zip"] = zip;
922995 exports["length"] = $foreign.length;
923996})(PS);
@@ -1028,6 +1101,7 @@ var PS = {};
10281101 };
10291102 };
10301103 };
1104+ exports["Monoid"] = Monoid;
10311105 exports["mempty"] = mempty;
10321106 exports["monoidString"] = monoidString;
10331107 exports["monoidRecord"] = monoidRecord;
@@ -1237,6 +1311,21 @@ var PS = {};
12371311 var toArray = function (v) {
12381312 return v;
12391313 };
1314+ var zip = function (xs) {
1315+ return function (ys) {
1316+ return unsafeFromArray(Data_Array.zip(toArray(xs))(toArray(ys)));
1317+ };
1318+ };
1319+ var snoc$prime = function (xs) {
1320+ return function (x) {
1321+ return unsafeFromArray(Data_Array.snoc(xs)(x));
1322+ };
1323+ };
1324+ var snoc = function (xs) {
1325+ return function (x) {
1326+ return unsafeFromArray(Data_Array.snoc(toArray(xs))(x));
1327+ };
1328+ };
12401329 var singleton = function ($60) {
12411330 return unsafeFromArray(Data_Array.singleton($60));
12421331 };
@@ -1262,7 +1351,8 @@ var PS = {};
12621351 };
12631352 var head = adaptMaybe(Data_Array.head);
12641353 var init = adaptMaybe(Data_Array.init);
1265− var last = adaptMaybe(Data_Array.last);
1354+ var last = adaptMaybe(Data_Array.last);
1355+ var tail = adaptMaybe(Data_Array.tail);
12661356 var adaptAny = function (f) {
12671357 return function ($78) {
12681358 return f(toArray($78));
@@ -1285,10 +1375,13 @@ var PS = {};
12851375 exports["toArray"] = toArray;
12861376 exports["singleton"] = singleton;
12871377 exports["cons'"] = cons$prime;
1378+ exports["snoc'"] = snoc$prime;
12881379 exports["head"] = head;
12891380 exports["last"] = last;
1381+ exports["tail"] = tail;
12901382 exports["init"] = init;
12911383 exports["intersperse"] = intersperse;
1384+ exports["zip"] = zip;
12921385})(PS);
12931386(function(exports) {
12941387 "use strict";
@@ -1576,12 +1669,16 @@ var PS = {};
15761669 this.mul = mul;
15771670 this.one = one;
15781671 this.zero = zero;
1672+ };
1673+ var zero = function (dict) {
1674+ return dict.zero;
15791675 };
15801676 var semiringInt = new Semiring($foreign.intAdd, $foreign.intMul, 1, 0);
15811677 var add = function (dict) {
15821678 return dict.add;
15831679 };
15841680 exports["add"] = add;
1681+ exports["zero"] = zero;
15851682 exports["semiringInt"] = semiringInt;
15861683})(PS);
15871684(function($PS) {
@@ -2305,6 +2402,32 @@ var PS = {};
23052402 exports["insert"] = insert;
23062403 exports["member"] = member;
23072404})(PS);
2405+(function($PS) {
2406+ // Generated by purs version 0.14.2
2407+ "use strict";
2408+ $PS["Data.Monoid.Additive"] = $PS["Data.Monoid.Additive"] || {};
2409+ var exports = $PS["Data.Monoid.Additive"];
2410+ var Data_Monoid = $PS["Data.Monoid"];
2411+ var Data_Semigroup = $PS["Data.Semigroup"];
2412+ var Data_Semiring = $PS["Data.Semiring"];
2413+ var Additive = function (x) {
2414+ return x;
2415+ };
2416+ var semigroupAdditive = function (dictSemiring) {
2417+ return new Data_Semigroup.Semigroup(function (v) {
2418+ return function (v1) {
2419+ return Data_Semiring.add(dictSemiring)(v)(v1);
2420+ };
2421+ });
2422+ };
2423+ var monoidAdditive = function (dictSemiring) {
2424+ return new Data_Monoid.Monoid(function () {
2425+ return semigroupAdditive(dictSemiring);
2426+ }, Data_Semiring.zero(dictSemiring));
2427+ };
2428+ exports["Additive"] = Additive;
2429+ exports["monoidAdditive"] = monoidAdditive;
2430+})(PS);
23082431(function($PS) {
23092432 // Generated by purs version 0.14.2
23102433 "use strict";
@@ -2322,10 +2445,25 @@ var PS = {};
23222445 $PS["Data.Newtype"] = $PS["Data.Newtype"] || {};
23232446 var exports = $PS["Data.Newtype"];
23242447 var Safe_Coerce = $PS["Safe.Coerce"];
2448+ var wrap = function (dictNewtype) {
2449+ return Safe_Coerce.coerce();
2450+ };
23252451 var unwrap = function (dictNewtype) {
23262452 return Safe_Coerce.coerce();
23272453 };
2454+ var ala = function (dictCoercible) {
2455+ return function (dictNewtype) {
2456+ return function (dictNewtype1) {
2457+ return function (v) {
2458+ return function (f) {
2459+ return Safe_Coerce.coerce()(f(wrap()));
2460+ };
2461+ };
2462+ };
2463+ };
2464+ };
23282465 exports["unwrap"] = unwrap;
2466+ exports["ala"] = ala;
23292467})(PS);
23302468(function(exports) {
23312469 /* globals exports */
@@ -5038,20 +5176,591 @@ var PS = {};
50385176 var printToken = printTokenWithOption(HideLayout.value);
50395177 exports["printToken"] = printToken;
50405178})(PS);
5179+(function($PS) {
5180+ // Generated by purs version 0.14.2
5181+ "use strict";
5182+ $PS["PureScript.CST.Range.TokenList"] = $PS["PureScript.CST.Range.TokenList"] || {};
5183+ var exports = $PS["PureScript.CST.Range.TokenList"];
5184+ var Control_Lazy = $PS["Control.Lazy"];
5185+ var Data_Maybe = $PS["Data.Maybe"];
5186+ var Data_Monoid = $PS["Data.Monoid"];
5187+ var Data_Semigroup = $PS["Data.Semigroup"];
5188+ var Data_Unit = $PS["Data.Unit"];
5189+ var TokenEmpty = (function () {
5190+ function TokenEmpty() {
5191+
5192+ };
5193+ TokenEmpty.value = new TokenEmpty();
5194+ return TokenEmpty;
5195+ })();
5196+ var TokenCons = (function () {
5197+ function TokenCons(value0, value1) {
5198+ this.value0 = value0;
5199+ this.value1 = value1;
5200+ };
5201+ TokenCons.create = function (value0) {
5202+ return function (value1) {
5203+ return new TokenCons(value0, value1);
5204+ };
5205+ };
5206+ return TokenCons;
5207+ })();
5208+ var TokenWrap = (function () {
5209+ function TokenWrap(value0, value1, value2) {
5210+ this.value0 = value0;
5211+ this.value1 = value1;
5212+ this.value2 = value2;
5213+ };
5214+ TokenWrap.create = function (value0) {
5215+ return function (value1) {
5216+ return function (value2) {
5217+ return new TokenWrap(value0, value1, value2);
5218+ };
5219+ };
5220+ };
5221+ return TokenWrap;
5222+ })();
5223+ var TokenAppend = (function () {
5224+ function TokenAppend(value0, value1) {
5225+ this.value0 = value0;
5226+ this.value1 = value1;
5227+ };
5228+ TokenAppend.create = function (value0) {
5229+ return function (value1) {
5230+ return new TokenAppend(value0, value1);
5231+ };
5232+ };
5233+ return TokenAppend;
5234+ })();
5235+ var TokenDefer = (function () {
5236+ function TokenDefer(value0) {
5237+ this.value0 = value0;
5238+ };
5239+ TokenDefer.create = function (value0) {
5240+ return new TokenDefer(value0);
5241+ };
5242+ return TokenDefer;
5243+ })();
5244+ var TokenArray = (function () {
5245+ function TokenArray(value0, value1, value2) {
5246+ this.value0 = value0;
5247+ this.value1 = value1;
5248+ this.value2 = value2;
5249+ };
5250+ TokenArray.create = function (value0) {
5251+ return function (value1) {
5252+ return function (value2) {
5253+ return new TokenArray(value0, value1, value2);
5254+ };
5255+ };
5256+ };
5257+ return TokenArray;
5258+ })();
5259+ var wrap = TokenWrap.create;
5260+ var singleton = function (a) {
5261+ return new TokenCons(a, TokenEmpty.value);
5262+ };
5263+ var semigroupTokenList = new Data_Semigroup.Semigroup(function (v) {
5264+ return function (v1) {
5265+ if (v1 instanceof TokenEmpty) {
5266+ return v;
5267+ };
5268+ if (v instanceof TokenEmpty) {
5269+ return v1;
5270+ };
5271+ return new TokenAppend(v, v1);
5272+ };
5273+ });
5274+ var monoidTokenList = new Data_Monoid.Monoid(function () {
5275+ return semigroupTokenList;
5276+ }, TokenEmpty.value);
5277+ var lazyTokenList = new Control_Lazy.Lazy(TokenDefer.create);
5278+ var head = function ($copy_v) {
5279+ var $tco_done = false;
5280+ var $tco_result;
5281+ function $tco_loop(v) {
5282+ if (v instanceof TokenEmpty) {
5283+ $tco_done = true;
5284+ return Data_Maybe.Nothing.value;
5285+ };
5286+ if (v instanceof TokenCons) {
5287+ $tco_done = true;
5288+ return new Data_Maybe.Just(v.value0);
5289+ };
5290+ if (v instanceof TokenDefer) {
5291+ $copy_v = v.value0(Data_Unit.unit);
5292+ return;
5293+ };
5294+ if (v instanceof TokenWrap) {
5295+ $tco_done = true;
5296+ return new Data_Maybe.Just(v.value0);
5297+ };
5298+ if (v instanceof TokenAppend) {
5299+ $copy_v = v.value0;
5300+ return;
5301+ };
5302+ if (v instanceof TokenArray) {
5303+ $tco_done = true;
5304+ return new Data_Maybe.Just(v["value2"][v.value0]);
5305+ };
5306+ throw new Error("Failed pattern match at PureScript.CST.Range.TokenList (line 64, column 8 - line 70, column 67): " + [ v.constructor.name ]);
5307+ };
5308+ while (!$tco_done) {
5309+ $tco_result = $tco_loop($copy_v);
5310+ };
5311+ return $tco_result;
5312+ };
5313+ var cons = TokenCons.create;
5314+ exports["singleton"] = singleton;
5315+ exports["cons"] = cons;
5316+ exports["wrap"] = wrap;
5317+ exports["head"] = head;
5318+ exports["lazyTokenList"] = lazyTokenList;
5319+ exports["semigroupTokenList"] = semigroupTokenList;
5320+ exports["monoidTokenList"] = monoidTokenList;
5321+})(PS);
50415322(function($PS) {
50425323 // Generated by purs version 0.14.2
50435324 "use strict";
50445325 $PS["PureScript.CST.Range"] = $PS["PureScript.CST.Range"] || {};
50455326 var exports = $PS["PureScript.CST.Range"];
5327+ var Control_Lazy = $PS["Control.Lazy"];
50465328 var Data_Array = $PS["Data.Array"];
50475329 var Data_Array_NonEmpty = $PS["Data.Array.NonEmpty"];
5330+ var Data_Array_NonEmpty_Internal = $PS["Data.Array.NonEmpty.Internal"];
5331+ var Data_Foldable = $PS["Data.Foldable"];
50485332 var Data_Maybe = $PS["Data.Maybe"];
5333+ var Data_Semigroup = $PS["Data.Semigroup"];
50495334 var Data_Tuple = $PS["Data.Tuple"];
50505335 var Data_Void = $PS["Data.Void"];
5051− var PureScript_CST_Types = $PS["PureScript.CST.Types"];
5336+ var PureScript_CST_Range_TokenList = $PS["PureScript.CST.Range.TokenList"];
5337+ var PureScript_CST_Types = $PS["PureScript.CST.Types"];
5338+ var TokensOf = function (tokensOf) {
5339+ this.tokensOf = tokensOf;
5340+ };
50525341 var RangeOf = function (rangeOf) {
50535342 this.rangeOf = rangeOf;
50545343 };
5344+ var tokensOfVoid = new TokensOf(Data_Void.absurd);
5345+ var tokensOfQualifiedName = new TokensOf(function (v) {
5346+ return PureScript_CST_Range_TokenList.singleton(v.token);
5347+ });
5348+ var tokensOfName = new TokensOf(function (v) {
5349+ return PureScript_CST_Range_TokenList.singleton(v.token);
5350+ });
5351+ var tokensOf = function (dict) {
5352+ return dict.tokensOf;
5353+ };
5354+ var tokensOfArray = function (dictTokensOf) {
5355+ return new TokensOf(Data_Foldable.foldMap(Data_Foldable.foldableArray)(PureScript_CST_Range_TokenList.monoidTokenList)(function (a) {
5356+ return Control_Lazy.defer(PureScript_CST_Range_TokenList.lazyTokenList)(function (v) {
5357+ return tokensOf(dictTokensOf)(a);
5358+ });
5359+ }));
5360+ };
5361+ var tokensOfLabeled = function (dictTokensOf) {
5362+ return function (dictTokensOf1) {
5363+ return new TokensOf(function (v) {
5364+ return Data_Semigroup.append(PureScript_CST_Range_TokenList.semigroupTokenList)(tokensOf(dictTokensOf)(v.label))(Data_Semigroup.append(PureScript_CST_Range_TokenList.semigroupTokenList)(PureScript_CST_Range_TokenList.singleton(v.separator))(tokensOf(dictTokensOf1)(v.value)));
5365+ });
5366+ };
5367+ };
5368+ var tokensOfMaybe = function (dictTokensOf) {
5369+ return new TokensOf(Data_Foldable.foldMap(Data_Foldable.foldableMaybe)(PureScript_CST_Range_TokenList.monoidTokenList)(tokensOf(dictTokensOf)));
5370+ };
5371+ var tokensOfNonEmptyArray = function (dictTokensOf) {
5372+ return new TokensOf(Data_Foldable.foldMap(Data_Array_NonEmpty_Internal.foldableNonEmptyArray)(PureScript_CST_Range_TokenList.monoidTokenList)(function (a) {
5373+ return Control_Lazy.defer(PureScript_CST_Range_TokenList.lazyTokenList)(function (v) {
5374+ return tokensOf(dictTokensOf)(a);
5375+ });
5376+ }));
5377+ };
5378+ var tokensOfRecordLabeled = function (dictTokensOf) {
5379+ return new TokensOf(function (v) {
5380+ if (v instanceof PureScript_CST_Types.RecordPun) {
5381+ return tokensOf(tokensOfName)(v.value0);
5382+ };
5383+ if (v instanceof PureScript_CST_Types.RecordField) {
5384+ return Data_Semigroup.append(PureScript_CST_Range_TokenList.semigroupTokenList)(tokensOf(tokensOfName)(v.value0))(Control_Lazy.defer(PureScript_CST_Range_TokenList.lazyTokenList)(function (v1) {
5385+ return PureScript_CST_Range_TokenList.cons(v.value1)(tokensOf(dictTokensOf)(v.value2));
5386+ }));
5387+ };
5388+ throw new Error("Failed pattern match at PureScript.CST.Range (line 988, column 14 - line 992, column 52): " + [ v.constructor.name ]);
5389+ });
5390+ };
5391+ var tokensOfSeparated = function (dictTokensOf) {
5392+ return new TokensOf(function (v) {
5393+ return Data_Semigroup.append(PureScript_CST_Range_TokenList.semigroupTokenList)(tokensOf(dictTokensOf)(v.head))(Control_Lazy.defer(PureScript_CST_Range_TokenList.lazyTokenList)(function (v1) {
5394+ return Data_Foldable.foldMap(Data_Foldable.foldableArray)(PureScript_CST_Range_TokenList.monoidTokenList)(function (v2) {
5395+ return PureScript_CST_Range_TokenList.cons(v2.value0)(Control_Lazy.defer(PureScript_CST_Range_TokenList.lazyTokenList)(function (v3) {
5396+ return tokensOf(dictTokensOf)(v2.value1);
5397+ }));
5398+ })(v.tail);
5399+ }));
5400+ });
5401+ };
5402+ var tokensOfTuple = function (dictTokensOf) {
5403+ return function (dictTokensOf1) {
5404+ return new TokensOf(function (v) {
5405+ return Data_Semigroup.append(PureScript_CST_Range_TokenList.semigroupTokenList)(tokensOf(dictTokensOf)(v.value0))(tokensOf(dictTokensOf1)(v.value1));
5406+ });
5407+ };
5408+ };
5409+ var tokensOfWrapped = function (dictTokensOf) {
5410+ return new TokensOf(function (v) {
5411+ return PureScript_CST_Range_TokenList.wrap(v.open)(Control_Lazy.defer(PureScript_CST_Range_TokenList.lazyTokenList)(function (v1) {
5412+ return tokensOf(dictTokensOf)(v.value);
5413+ }))(v.close);
5414+ });
5415+ };
5416+ var tokensOfTypeVarBinding = function (dictTokensOf) {
5417+ return new TokensOf(function (v) {
5418+ if (v instanceof PureScript_CST_Types.TypeVarKinded) {
5419+ return tokensOf(tokensOfWrapped(tokensOfLabeled(tokensOfName)(tokensOfType(dictTokensOf))))(v.value0);
5420+ };
5421+ if (v instanceof PureScript_CST_Types.TypeVarName) {
5422+ return tokensOf(tokensOfName)(v.value0);
5423+ };
5424+ throw new Error("Failed pattern match at PureScript.CST.Range (line 247, column 14 - line 251, column 17): " + [ v.constructor.name ]);
5425+ });
5426+ };
5427+ var tokensOfType = function (dictTokensOf) {
5428+ return new TokensOf(function (v) {
5429+ if (v instanceof PureScript_CST_Types.TypeVar) {
5430+ return tokensOf(tokensOfName)(v.value0);
5431+ };
5432+ if (v instanceof PureScript_CST_Types.TypeConstructor) {
5433+ return tokensOf(tokensOfQualifiedName)(v.value0);
5434+ };
5435+ if (v instanceof PureScript_CST_Types.TypeWildcard) {
5436+ return PureScript_CST_Range_TokenList.singleton(v.value0);
5437+ };
5438+ if (v instanceof PureScript_CST_Types.TypeHole) {
5439+ return tokensOf(tokensOfName)(v.value0);
5440+ };
5441+ if (v instanceof PureScript_CST_Types.TypeString) {
5442+ return PureScript_CST_Range_TokenList.singleton(v.value0);
5443+ };
5444+ if (v instanceof PureScript_CST_Types.TypeRow) {
5445+ return tokensOf(tokensOfWrapped(tokensOfRow(dictTokensOf)))(v.value0);
5446+ };
5447+ if (v instanceof PureScript_CST_Types.TypeRecord) {
5448+ return tokensOf(tokensOfWrapped(tokensOfRow(dictTokensOf)))(v.value0);
5449+ };
5450+ if (v instanceof PureScript_CST_Types.TypeForall) {
5451+ return PureScript_CST_Range_TokenList.cons(v.value0)(Control_Lazy.defer(PureScript_CST_Range_TokenList.lazyTokenList)(function (v1) {
5452+ return Data_Semigroup.append(PureScript_CST_Range_TokenList.semigroupTokenList)(tokensOf(tokensOfNonEmptyArray(tokensOfTypeVarBinding(dictTokensOf)))(v.value1))(Data_Semigroup.append(PureScript_CST_Range_TokenList.semigroupTokenList)(PureScript_CST_Range_TokenList.singleton(v.value2))(tokensOf(tokensOfType(dictTokensOf))(v.value3)));
5453+ }));
5454+ };
5455+ if (v instanceof PureScript_CST_Types.TypeKinded) {
5456+ return Data_Semigroup.append(PureScript_CST_Range_TokenList.semigroupTokenList)(tokensOf(tokensOfType(dictTokensOf))(v.value0))(Control_Lazy.defer(PureScript_CST_Range_TokenList.lazyTokenList)(function (v1) {
5457+ return Data_Semigroup.append(PureScript_CST_Range_TokenList.semigroupTokenList)(PureScript_CST_Range_TokenList.singleton(v.value1))(tokensOf(tokensOfType(dictTokensOf))(v.value2));
5458+ }));
5459+ };
5460+ if (v instanceof PureScript_CST_Types.TypeApp) {
5461+ return Data_Semigroup.append(PureScript_CST_Range_TokenList.semigroupTokenList)(tokensOf(tokensOfType(dictTokensOf))(v.value0))(Control_Lazy.defer(PureScript_CST_Range_TokenList.lazyTokenList)(function (v1) {
5462+ return tokensOf(tokensOfNonEmptyArray(tokensOfType(dictTokensOf)))(v.value1);
5463+ }));
5464+ };
5465+ if (v instanceof PureScript_CST_Types.TypeOp) {
5466+ return Data_Semigroup.append(PureScript_CST_Range_TokenList.semigroupTokenList)(tokensOf(tokensOfType(dictTokensOf))(v.value0))(Control_Lazy.defer(PureScript_CST_Range_TokenList.lazyTokenList)(function (v1) {
5467+ return Data_Foldable.foldMap(Data_Array_NonEmpty_Internal.foldableNonEmptyArray)(PureScript_CST_Range_TokenList.monoidTokenList)(function (v2) {
5468+ return Data_Semigroup.append(PureScript_CST_Range_TokenList.semigroupTokenList)(tokensOf(tokensOfQualifiedName)(v2.value0))(tokensOf(tokensOfType(dictTokensOf))(v2.value1));
5469+ })(v.value1);
5470+ }));
5471+ };
5472+ if (v instanceof PureScript_CST_Types.TypeOpName) {
5473+ return tokensOf(tokensOfQualifiedName)(v.value0);
5474+ };
5475+ if (v instanceof PureScript_CST_Types.TypeArrow) {
5476+ return Data_Semigroup.append(PureScript_CST_Range_TokenList.semigroupTokenList)(tokensOf(tokensOfType(dictTokensOf))(v.value0))(Control_Lazy.defer(PureScript_CST_Range_TokenList.lazyTokenList)(function (v1) {
5477+ return Data_Semigroup.append(PureScript_CST_Range_TokenList.semigroupTokenList)(PureScript_CST_Range_TokenList.singleton(v.value1))(tokensOf(tokensOfType(dictTokensOf))(v.value2));
5478+ }));
5479+ };
5480+ if (v instanceof PureScript_CST_Types.TypeArrowName) {
5481+ return PureScript_CST_Range_TokenList.singleton(v.value0);
5482+ };
5483+ if (v instanceof PureScript_CST_Types.TypeConstrained) {
5484+ return Data_Semigroup.append(PureScript_CST_Range_TokenList.semigroupTokenList)(tokensOf(tokensOfType(dictTokensOf))(v.value0))(Control_Lazy.defer(PureScript_CST_Range_TokenList.lazyTokenList)(function (v1) {
5485+ return Data_Semigroup.append(PureScript_CST_Range_TokenList.semigroupTokenList)(PureScript_CST_Range_TokenList.singleton(v.value1))(tokensOf(tokensOfType(dictTokensOf))(v.value2));
5486+ }));
5487+ };
5488+ if (v instanceof PureScript_CST_Types.TypeParens) {
5489+ return tokensOf(tokensOfWrapped(tokensOfType(dictTokensOf)))(v.value0);
5490+ };
5491+ if (v instanceof PureScript_CST_Types.TypeUnaryRow) {
5492+ return PureScript_CST_Range_TokenList.cons(v.value0)(Control_Lazy.defer(PureScript_CST_Range_TokenList.lazyTokenList)(function (v1) {
5493+ return tokensOf(tokensOfType(dictTokensOf))(v.value1);
5494+ }));
5495+ };
5496+ if (v instanceof PureScript_CST_Types["TypeError"]) {
5497+ return tokensOf(dictTokensOf)(v.value0);
5498+ };
5499+ throw new Error("Failed pattern match at PureScript.CST.Range (line 188, column 14 - line 232, column 17): " + [ v.constructor.name ]);
5500+ });
5501+ };
5502+ var tokensOfRow = function (dictTokensOf) {
5503+ return new TokensOf(function (v) {
5504+ return Data_Semigroup.append(PureScript_CST_Range_TokenList.semigroupTokenList)(Data_Foldable.foldMap(Data_Foldable.foldableMaybe)(PureScript_CST_Range_TokenList.monoidTokenList)(tokensOf(tokensOfSeparated(tokensOfLabeled(tokensOfName)(tokensOfType(dictTokensOf)))))(v.labels))(Data_Foldable.foldMap(Data_Foldable.foldableMaybe)(PureScript_CST_Range_TokenList.monoidTokenList)(function (v1) {
5505+ return PureScript_CST_Range_TokenList.cons(v1.value0)(tokensOf(tokensOfType(dictTokensOf))(v1.value1));
5506+ })(v.tail));
5507+ });
5508+ };
5509+ var tokensOfBinder = function (dictTokensOf) {
5510+ return new TokensOf(function (v) {
5511+ if (v instanceof PureScript_CST_Types.BinderWildcard) {
5512+ return PureScript_CST_Range_TokenList.singleton(v.value0);
5513+ };
5514+ if (v instanceof PureScript_CST_Types.BinderVar) {
5515+ return tokensOf(tokensOfName)(v.value0);
5516+ };
5517+ if (v instanceof PureScript_CST_Types.BinderNamed) {
5518+ return Data_Semigroup.append(PureScript_CST_Range_TokenList.semigroupTokenList)(tokensOf(tokensOfName)(v.value0))(Control_Lazy.defer(PureScript_CST_Range_TokenList.lazyTokenList)(function (v1) {
5519+ return PureScript_CST_Range_TokenList.cons(v.value1)(tokensOf(tokensOfBinder(dictTokensOf))(v.value2));
5520+ }));
5521+ };
5522+ if (v instanceof PureScript_CST_Types.BinderConstructor) {
5523+ return Data_Semigroup.append(PureScript_CST_Range_TokenList.semigroupTokenList)(tokensOf(tokensOfQualifiedName)(v.value0))(Control_Lazy.defer(PureScript_CST_Range_TokenList.lazyTokenList)(function (v1) {
5524+ return tokensOf(tokensOfArray(tokensOfBinder(dictTokensOf)))(v.value1);
5525+ }));
5526+ };
5527+ if (v instanceof PureScript_CST_Types.BinderBoolean) {
5528+ return PureScript_CST_Range_TokenList.singleton(v.value0);
5529+ };
5530+ if (v instanceof PureScript_CST_Types.BinderChar) {
5531+ return PureScript_CST_Range_TokenList.singleton(v.value0);
5532+ };
5533+ if (v instanceof PureScript_CST_Types.BinderString) {
5534+ return PureScript_CST_Range_TokenList.singleton(v.value0);
5535+ };
5536+ if (v instanceof PureScript_CST_Types.BinderInt) {
5537+ return Data_Semigroup.append(PureScript_CST_Range_TokenList.semigroupTokenList)(Data_Foldable.foldMap(Data_Foldable.foldableMaybe)(PureScript_CST_Range_TokenList.monoidTokenList)(PureScript_CST_Range_TokenList.singleton)(v.value0))(PureScript_CST_Range_TokenList.singleton(v.value1));
5538+ };
5539+ if (v instanceof PureScript_CST_Types.BinderNumber) {
5540+ return Data_Semigroup.append(PureScript_CST_Range_TokenList.semigroupTokenList)(Data_Foldable.foldMap(Data_Foldable.foldableMaybe)(PureScript_CST_Range_TokenList.monoidTokenList)(PureScript_CST_Range_TokenList.singleton)(v.value0))(PureScript_CST_Range_TokenList.singleton(v.value1));
5541+ };
5542+ if (v instanceof PureScript_CST_Types.BinderArray) {
5543+ return tokensOf(tokensOfWrapped(tokensOfMaybe(tokensOfSeparated(tokensOfBinder(dictTokensOf)))))(v.value0);
5544+ };
5545+ if (v instanceof PureScript_CST_Types.BinderRecord) {
5546+ return tokensOf(tokensOfWrapped(tokensOfMaybe(tokensOfSeparated(tokensOfRecordLabeled(tokensOfBinder(dictTokensOf))))))(v.value0);
5547+ };
5548+ if (v instanceof PureScript_CST_Types.BinderParens) {
5549+ return tokensOf(tokensOfWrapped(tokensOfBinder(dictTokensOf)))(v.value0);
5550+ };
5551+ if (v instanceof PureScript_CST_Types.BinderTyped) {
5552+ return Data_Semigroup.append(PureScript_CST_Range_TokenList.semigroupTokenList)(tokensOf(tokensOfBinder(dictTokensOf))(v.value0))(Control_Lazy.defer(PureScript_CST_Range_TokenList.lazyTokenList)(function (v1) {
5553+ return PureScript_CST_Range_TokenList.cons(v.value1)(tokensOf(tokensOfType(dictTokensOf))(v.value2));
5554+ }));
5555+ };
5556+ if (v instanceof PureScript_CST_Types.BinderOp) {
5557+ return Data_Semigroup.append(PureScript_CST_Range_TokenList.semigroupTokenList)(tokensOf(tokensOfBinder(dictTokensOf))(v.value0))(Control_Lazy.defer(PureScript_CST_Range_TokenList.lazyTokenList)(function (v1) {
5558+ return tokensOf(tokensOfNonEmptyArray(tokensOfTuple(tokensOfQualifiedName)(tokensOfBinder(dictTokensOf))))(v.value1);
5559+ }));
5560+ };
5561+ if (v instanceof PureScript_CST_Types.BinderError) {
5562+ return tokensOf(dictTokensOf)(v.value0);
5563+ };
5564+ throw new Error("Failed pattern match at PureScript.CST.Range (line 955, column 14 - line 985, column 17): " + [ v.constructor.name ]);
5565+ });
5566+ };
5567+ var tokensOfWhere = function (dictTokensOf) {
5568+ return new TokensOf(function (v) {
5569+ return Data_Semigroup.append(PureScript_CST_Range_TokenList.semigroupTokenList)(tokensOf(tokensOfExpr(dictTokensOf))(v.expr))(Control_Lazy.defer(PureScript_CST_Range_TokenList.lazyTokenList)(function (v1) {
5570+ return Data_Foldable.foldMap(Data_Foldable.foldableMaybe)(PureScript_CST_Range_TokenList.monoidTokenList)(function (v2) {
5571+ return PureScript_CST_Range_TokenList.cons(v2.value0)(tokensOf(tokensOfNonEmptyArray(tokensOfLetBinding(dictTokensOf)))(v2.value1));
5572+ })(v.bindings);
5573+ }));
5574+ });
5575+ };
5576+ var tokensOfRecordUpdate = function (dictTokensOf) {
5577+ return new TokensOf(function (v) {
5578+ if (v instanceof PureScript_CST_Types.RecordUpdateLeaf) {
5579+ return Data_Semigroup.append(PureScript_CST_Range_TokenList.semigroupTokenList)(tokensOf(tokensOfName)(v.value0))(Data_Semigroup.append(PureScript_CST_Range_TokenList.semigroupTokenList)(PureScript_CST_Range_TokenList.singleton(v.value1))(tokensOf(tokensOfExpr(dictTokensOf))(v.value2)));
5580+ };
5581+ if (v instanceof PureScript_CST_Types.RecordUpdateBranch) {
5582+ return Data_Semigroup.append(PureScript_CST_Range_TokenList.semigroupTokenList)(tokensOf(tokensOfName)(v.value0))(tokensOf(tokensOfWrapped(tokensOfSeparated(tokensOfRecordUpdate(dictTokensOf))))(v.value1));
5583+ };
5584+ throw new Error("Failed pattern match at PureScript.CST.Range (line 839, column 14 - line 843, column 32): " + [ v.constructor.name ]);
5585+ });
5586+ };
5587+ var tokensOfPatternGuard = function (dictTokensOf) {
5588+ return new TokensOf(function (v) {
5589+ return Data_Semigroup.append(PureScript_CST_Range_TokenList.semigroupTokenList)(Data_Foldable.foldMap(Data_Foldable.foldableMaybe)(PureScript_CST_Range_TokenList.monoidTokenList)(function (v1) {
5590+ return Data_Semigroup.append(PureScript_CST_Range_TokenList.semigroupTokenList)(tokensOf(tokensOfBinder(dictTokensOf))(v1.value0))(PureScript_CST_Range_TokenList.singleton(v1.value1));
5591+ })(v.binder))(tokensOf(tokensOfExpr(dictTokensOf))(v.expr));
5592+ });
5593+ };
5594+ var tokensOfLetBinding = function (dictTokensOf) {
5595+ return new TokensOf(function (v) {
5596+ if (v instanceof PureScript_CST_Types.LetBindingSignature) {
5597+ return tokensOf(tokensOfLabeled(tokensOfName)(tokensOfType(dictTokensOf)))(v.value0);
5598+ };
5599+ if (v instanceof PureScript_CST_Types.LetBindingName) {
5600+ return Data_Semigroup.append(PureScript_CST_Range_TokenList.semigroupTokenList)(tokensOf(tokensOfName)(v.value0.name))(Control_Lazy.defer(PureScript_CST_Range_TokenList.lazyTokenList)(function (v1) {
5601+ return Data_Semigroup.append(PureScript_CST_Range_TokenList.semigroupTokenList)(tokensOf(tokensOfArray(tokensOfBinder(dictTokensOf)))(v.value0.binders))(tokensOf(tokensOfGuarded(dictTokensOf))(v.value0.guarded));
5602+ }));
5603+ };
5604+ if (v instanceof PureScript_CST_Types.LetBindingPattern) {
5605+ return Data_Semigroup.append(PureScript_CST_Range_TokenList.semigroupTokenList)(tokensOf(tokensOfBinder(dictTokensOf))(v.value0))(Control_Lazy.defer(PureScript_CST_Range_TokenList.lazyTokenList)(function (v1) {
5606+ return PureScript_CST_Range_TokenList.cons(v.value1)(tokensOf(tokensOfWhere(dictTokensOf))(v.value2));
5607+ }));
5608+ };
5609+ if (v instanceof PureScript_CST_Types.LetBindingError) {
5610+ return tokensOf(dictTokensOf)(v.value0);
5611+ };
5612+ throw new Error("Failed pattern match at PureScript.CST.Range (line 887, column 14 - line 895, column 17): " + [ v.constructor.name ]);
5613+ });
5614+ };
5615+ var tokensOfGuardedExpr = function (dictTokensOf) {
5616+ return new TokensOf(function (v) {
5617+ return PureScript_CST_Range_TokenList.cons(v.bar)(Control_Lazy.defer(PureScript_CST_Range_TokenList.lazyTokenList)(function (v1) {
5618+ return Data_Semigroup.append(PureScript_CST_Range_TokenList.semigroupTokenList)(tokensOf(tokensOfSeparated(tokensOfPatternGuard(dictTokensOf)))(v.patterns))(Data_Semigroup.append(PureScript_CST_Range_TokenList.semigroupTokenList)(PureScript_CST_Range_TokenList.singleton(v.separator))(tokensOf(tokensOfWhere(dictTokensOf))(v.where)));
5619+ }));
5620+ });
5621+ };
5622+ var tokensOfGuarded = function (dictTokensOf) {
5623+ return new TokensOf(function (v) {
5624+ if (v instanceof PureScript_CST_Types.Unconditional) {
5625+ return PureScript_CST_Range_TokenList.cons(v.value0)(tokensOf(tokensOfWhere(dictTokensOf))(v.value1));
5626+ };
5627+ if (v instanceof PureScript_CST_Types.Guarded) {
5628+ return tokensOf(tokensOfNonEmptyArray(tokensOfGuardedExpr(dictTokensOf)))(v.value0);
5629+ };
5630+ throw new Error("Failed pattern match at PureScript.CST.Range (line 599, column 14 - line 603, column 18): " + [ v.constructor.name ]);
5631+ });
5632+ };
5633+ var tokensOfExpr = function (dictTokensOf) {
5634+ return new TokensOf(function (v) {
5635+ if (v instanceof PureScript_CST_Types.ExprHole) {
5636+ return tokensOf(tokensOfName)(v.value0);
5637+ };
5638+ if (v instanceof PureScript_CST_Types.ExprSection) {
5639+ return PureScript_CST_Range_TokenList.singleton(v.value0);
5640+ };
5641+ if (v instanceof PureScript_CST_Types.ExprIdent) {
5642+ return tokensOf(tokensOfQualifiedName)(v.value0);
5643+ };
5644+ if (v instanceof PureScript_CST_Types.ExprConstructor) {
5645+ return tokensOf(tokensOfQualifiedName)(v.value0);
5646+ };
5647+ if (v instanceof PureScript_CST_Types.ExprBoolean) {
5648+ return PureScript_CST_Range_TokenList.singleton(v.value0);
5649+ };
5650+ if (v instanceof PureScript_CST_Types.ExprChar) {
5651+ return PureScript_CST_Range_TokenList.singleton(v.value0);
5652+ };
5653+ if (v instanceof PureScript_CST_Types.ExprString) {
5654+ return PureScript_CST_Range_TokenList.singleton(v.value0);
5655+ };
5656+ if (v instanceof PureScript_CST_Types.ExprInt) {
5657+ return PureScript_CST_Range_TokenList.singleton(v.value0);
5658+ };
5659+ if (v instanceof PureScript_CST_Types.ExprNumber) {
5660+ return PureScript_CST_Range_TokenList.singleton(v.value0);
5661+ };
5662+ if (v instanceof PureScript_CST_Types.ExprArray) {
5663+ return tokensOf(tokensOfWrapped(tokensOfMaybe(tokensOfSeparated(tokensOfExpr(dictTokensOf)))))(v.value0);
5664+ };
5665+ if (v instanceof PureScript_CST_Types.ExprRecord) {
5666+ return tokensOf(tokensOfWrapped(tokensOfMaybe(tokensOfSeparated(tokensOfRecordLabeled(tokensOfExpr(dictTokensOf))))))(v.value0);
5667+ };
5668+ if (v instanceof PureScript_CST_Types.ExprParens) {
5669+ return tokensOf(tokensOfWrapped(tokensOfExpr(dictTokensOf)))(v.value0);
5670+ };
5671+ if (v instanceof PureScript_CST_Types.ExprTyped) {
5672+ return Data_Semigroup.append(PureScript_CST_Range_TokenList.semigroupTokenList)(tokensOf(tokensOfExpr(dictTokensOf))(v.value0))(Control_Lazy.defer(PureScript_CST_Range_TokenList.lazyTokenList)(function (v1) {
5673+ return PureScript_CST_Range_TokenList.cons(v.value1)(tokensOf(tokensOfType(dictTokensOf))(v.value2));
5674+ }));
5675+ };
5676+ if (v instanceof PureScript_CST_Types.ExprInfix) {
5677+ return Data_Semigroup.append(PureScript_CST_Range_TokenList.semigroupTokenList)(tokensOf(tokensOfExpr(dictTokensOf))(v.value0))(Control_Lazy.defer(PureScript_CST_Range_TokenList.lazyTokenList)(function (v1) {
5678+ return tokensOf(tokensOfNonEmptyArray(tokensOfTuple(tokensOfWrapped(tokensOfExpr(dictTokensOf)))(tokensOfExpr(dictTokensOf))))(v.value1);
5679+ }));
5680+ };
5681+ if (v instanceof PureScript_CST_Types.ExprOp) {
5682+ return Data_Semigroup.append(PureScript_CST_Range_TokenList.semigroupTokenList)(tokensOf(tokensOfExpr(dictTokensOf))(v.value0))(Control_Lazy.defer(PureScript_CST_Range_TokenList.lazyTokenList)(function (v1) {
5683+ return tokensOf(tokensOfNonEmptyArray(tokensOfTuple(tokensOfQualifiedName)(tokensOfExpr(dictTokensOf))))(v.value1);
5684+ }));
5685+ };
5686+ if (v instanceof PureScript_CST_Types.ExprOpName) {
5687+ return tokensOf(tokensOfQualifiedName)(v.value0);
5688+ };
5689+ if (v instanceof PureScript_CST_Types.ExprNegate) {
5690+ return PureScript_CST_Range_TokenList.cons(v.value0)(tokensOf(tokensOfExpr(dictTokensOf))(v.value1));
5691+ };
5692+ if (v instanceof PureScript_CST_Types.ExprRecordAccessor) {
5693+ return Data_Semigroup.append(PureScript_CST_Range_TokenList.semigroupTokenList)(tokensOf(tokensOfExpr(dictTokensOf))(v.value0.expr))(Control_Lazy.defer(PureScript_CST_Range_TokenList.lazyTokenList)(function (v1) {
5694+ return PureScript_CST_Range_TokenList.cons(v.value0.dot)(tokensOf(tokensOfSeparated(tokensOfName))(v.value0.path));
5695+ }));
5696+ };
5697+ if (v instanceof PureScript_CST_Types.ExprRecordUpdate) {
5698+ return Data_Semigroup.append(PureScript_CST_Range_TokenList.semigroupTokenList)(tokensOf(tokensOfExpr(dictTokensOf))(v.value0))(Control_Lazy.defer(PureScript_CST_Range_TokenList.lazyTokenList)(function (v1) {
5699+ return tokensOf(tokensOfWrapped(tokensOfSeparated(tokensOfRecordUpdate(dictTokensOf))))(v.value1);
5700+ }));
5701+ };
5702+ if (v instanceof PureScript_CST_Types.ExprApp) {
5703+ return Data_Semigroup.append(PureScript_CST_Range_TokenList.semigroupTokenList)(tokensOf(tokensOfExpr(dictTokensOf))(v.value0))(Control_Lazy.defer(PureScript_CST_Range_TokenList.lazyTokenList)(function (v1) {
5704+ return tokensOf(tokensOfNonEmptyArray(tokensOfExpr(dictTokensOf)))(v.value1);
5705+ }));
5706+ };
5707+ if (v instanceof PureScript_CST_Types.ExprLambda) {
5708+ return PureScript_CST_Range_TokenList.cons(v.value0.symbol)(Control_Lazy.defer(PureScript_CST_Range_TokenList.lazyTokenList)(function (v1) {
5709+ return Data_Semigroup.append(PureScript_CST_Range_TokenList.semigroupTokenList)(tokensOf(tokensOfNonEmptyArray(tokensOfBinder(dictTokensOf)))(v.value0.binders))(Data_Semigroup.append(PureScript_CST_Range_TokenList.semigroupTokenList)(PureScript_CST_Range_TokenList.singleton(v.value0.arrow))(tokensOf(tokensOfExpr(dictTokensOf))(v.value0.body)));
5710+ }));
5711+ };
5712+ if (v instanceof PureScript_CST_Types.ExprIf) {
5713+ return PureScript_CST_Range_TokenList.cons(v.value0.keyword)(Control_Lazy.defer(PureScript_CST_Range_TokenList.lazyTokenList)(function (v1) {
5714+ return Data_Semigroup.append(PureScript_CST_Range_TokenList.semigroupTokenList)(tokensOf(tokensOfExpr(dictTokensOf))(v.value0.cond))(Data_Semigroup.append(PureScript_CST_Range_TokenList.semigroupTokenList)(PureScript_CST_Range_TokenList.singleton(v.value0.then))(Data_Semigroup.append(PureScript_CST_Range_TokenList.semigroupTokenList)(tokensOf(tokensOfExpr(dictTokensOf))(v["value0"]["true"]))(Data_Semigroup.append(PureScript_CST_Range_TokenList.semigroupTokenList)(PureScript_CST_Range_TokenList.singleton(v["value0"]["else"]))(tokensOf(tokensOfExpr(dictTokensOf))(v["value0"]["false"])))));
5715+ }));
5716+ };
5717+ if (v instanceof PureScript_CST_Types.ExprCase) {
5718+ return PureScript_CST_Range_TokenList.cons(v.value0.keyword)(Control_Lazy.defer(PureScript_CST_Range_TokenList.lazyTokenList)(function (v1) {
5719+ return Data_Semigroup.append(PureScript_CST_Range_TokenList.semigroupTokenList)(tokensOf(tokensOfSeparated(tokensOfExpr(dictTokensOf)))(v.value0.head))(Data_Semigroup.append(PureScript_CST_Range_TokenList.semigroupTokenList)(PureScript_CST_Range_TokenList.singleton(v.value0.of))(tokensOf(tokensOfNonEmptyArray(tokensOfTuple(tokensOfSeparated(tokensOfBinder(dictTokensOf)))(tokensOfGuarded(dictTokensOf))))(v.value0.branches)));
5720+ }));
5721+ };
5722+ if (v instanceof PureScript_CST_Types.ExprLet) {
5723+ return PureScript_CST_Range_TokenList.cons(v.value0.keyword)(Control_Lazy.defer(PureScript_CST_Range_TokenList.lazyTokenList)(function (v1) {
5724+ return Data_Semigroup.append(PureScript_CST_Range_TokenList.semigroupTokenList)(tokensOf(tokensOfNonEmptyArray(tokensOfLetBinding(dictTokensOf)))(v.value0.bindings))(Data_Semigroup.append(PureScript_CST_Range_TokenList.semigroupTokenList)(PureScript_CST_Range_TokenList.singleton(v["value0"]["in"]))(tokensOf(tokensOfExpr(dictTokensOf))(v.value0.body)));
5725+ }));
5726+ };
5727+ if (v instanceof PureScript_CST_Types.ExprDo) {
5728+ return PureScript_CST_Range_TokenList.cons(v.value0.keyword)(Control_Lazy.defer(PureScript_CST_Range_TokenList.lazyTokenList)(function (v1) {
5729+ return tokensOf(tokensOfNonEmptyArray(tokensOfDoStatement(dictTokensOf)))(v.value0.statements);
5730+ }));
5731+ };
5732+ if (v instanceof PureScript_CST_Types.ExprAdo) {
5733+ return PureScript_CST_Range_TokenList.cons(v.value0.keyword)(Control_Lazy.defer(PureScript_CST_Range_TokenList.lazyTokenList)(function (v1) {
5734+ return Data_Semigroup.append(PureScript_CST_Range_TokenList.semigroupTokenList)(tokensOf(tokensOfArray(tokensOfDoStatement(dictTokensOf)))(v.value0.statements))(Data_Semigroup.append(PureScript_CST_Range_TokenList.semigroupTokenList)(PureScript_CST_Range_TokenList.singleton(v["value0"]["in"]))(tokensOf(tokensOfExpr(dictTokensOf))(v.value0.result)));
5735+ }));
5736+ };
5737+ if (v instanceof PureScript_CST_Types.ExprError) {
5738+ return tokensOf(dictTokensOf)(v.value0);
5739+ };
5740+ throw new Error("Failed pattern match at PureScript.CST.Range (line 765, column 14 - line 836, column 17): " + [ v.constructor.name ]);
5741+ });
5742+ };
5743+ var tokensOfDoStatement = function (dictTokensOf) {
5744+ return new TokensOf(function (v) {
5745+ if (v instanceof PureScript_CST_Types.DoLet) {
5746+ return PureScript_CST_Range_TokenList.cons(v.value0)(Control_Lazy.defer(PureScript_CST_Range_TokenList.lazyTokenList)(function (v1) {
5747+ return tokensOf(tokensOfNonEmptyArray(tokensOfLetBinding(dictTokensOf)))(v.value1);
5748+ }));
5749+ };
5750+ if (v instanceof PureScript_CST_Types.DoDiscard) {
5751+ return tokensOf(tokensOfExpr(dictTokensOf))(v.value0);
5752+ };
5753+ if (v instanceof PureScript_CST_Types.DoBind) {
5754+ return Data_Semigroup.append(PureScript_CST_Range_TokenList.semigroupTokenList)(tokensOf(tokensOfBinder(dictTokensOf))(v.value0))(Control_Lazy.defer(PureScript_CST_Range_TokenList.lazyTokenList)(function (v1) {
5755+ return PureScript_CST_Range_TokenList.cons(v.value1)(tokensOf(tokensOfExpr(dictTokensOf))(v.value2));
5756+ }));
5757+ };
5758+ if (v instanceof PureScript_CST_Types.DoError) {
5759+ return tokensOf(dictTokensOf)(v.value0);
5760+ };
5761+ throw new Error("Failed pattern match at PureScript.CST.Range (line 861, column 14 - line 869, column 17): " + [ v.constructor.name ]);
5762+ });
5763+ };
50555764 var rangeOfWrapped = new RangeOf(function (v) {
50565765 return {
50575766 start: v.open.range.start,
@@ -5832,7 +6541,9 @@ var PS = {};
58326541 });
58336542 };
58346543 exports["rangeOf"] = rangeOf;
6544+ exports["tokensOf"] = tokensOf;
58356545 exports["rangeOfVoid"] = rangeOfVoid;
6546+ exports["tokensOfVoid"] = tokensOfVoid;
58366547 exports["rangeOfName"] = rangeOfName;
58376548 exports["rangeOfQualifiedName"] = rangeOfQualifiedName;
58386549 exports["rangeOfWrapped"] = rangeOfWrapped;
@@ -5848,6 +6559,7 @@ var PS = {};
58486559 exports["rangeOfInstance"] = rangeOfInstance;
58496560 exports["rangeOfExpr"] = rangeOfExpr;
58506561 exports["rangeOfDoStatement"] = rangeOfDoStatement;
6562+ exports["tokensOfLetBinding"] = tokensOfLetBinding;
58516563 exports["rangeOfBinder"] = rangeOfBinder;
58526564})(PS);
58536565(function($PS) {
@@ -5863,12 +6575,17 @@ var PS = {};
58636575 var Data_Functor = $PS["Data.Functor"];
58646576 var Data_Maybe = $PS["Data.Maybe"];
58656577 var Data_Monoid = $PS["Data.Monoid"];
6578+ var Data_Monoid_Additive = $PS["Data.Monoid.Additive"];
6579+ var Data_Newtype = $PS["Data.Newtype"];
58666580 var Data_Semigroup = $PS["Data.Semigroup"];
58676581 var Data_Semigroup_Foldable = $PS["Data.Semigroup.Foldable"];
6582+ var Data_Semiring = $PS["Data.Semiring"];
58686583 var Data_Tuple = $PS["Data.Tuple"];
58696584 var Data_Void = $PS["Data.Void"];
6585+ var Partial_Unsafe = $PS["Partial.Unsafe"];
58706586 var PureScript_CST_Print = $PS["PureScript.CST.Print"];
58716587 var PureScript_CST_Range = $PS["PureScript.CST.Range"];
6588+ var PureScript_CST_Range_TokenList = $PS["PureScript.CST.Range.TokenList"];
58726589 var PureScript_CST_Types = $PS["PureScript.CST.Types"];
58736590 var SingleLine = (function () {
58746591 function SingleLine() {
@@ -5886,8 +6603,8 @@ var PS = {};
58866603 })();
58876604 var space = " ";
58886605 var singleOrMultilineFromRange = function (v) {
5889− var $149 = v.start.line === v.end.line;
5890− if ($149) {
6606+ var $153 = v.start.line === v.end.line;
6607+ if ($153) {
58916608 return SingleLine.value;
58926609 };
58936610 return MultipleLines.value;
@@ -5923,9 +6640,9 @@ var PS = {};
59236640 };
59246641 var rangeOfPatternGuard = function (v) {
59256642 var v1 = Data_Maybe.maybe(PureScript_CST_Range.rangeOf(PureScript_CST_Range.rangeOfExpr(PureScript_CST_Range.rangeOfVoid))(v.expr))((function () {
5926− var $1087 = PureScript_CST_Range.rangeOf(PureScript_CST_Range.rangeOfBinder(PureScript_CST_Range.rangeOfVoid));
5927− return function ($1088) {
5928− return $1087(Data_Tuple.fst($1088));
6643+ var $1107 = PureScript_CST_Range.rangeOf(PureScript_CST_Range.rangeOfBinder(PureScript_CST_Range.rangeOfVoid));
6644+ return function ($1108) {
6645+ return $1107(Data_Tuple.fst($1108));
59296646 };
59306647 })())(v.binder);
59316648 var v2 = PureScript_CST_Range.rangeOf(PureScript_CST_Range.rangeOfExpr(PureScript_CST_Range.rangeOfVoid))(v.expr);
@@ -5943,7 +6660,7 @@ var PS = {};
59436660 if (v2 instanceof Data_Maybe.Just) {
59446661 return PureScript_CST_Range.rangeOf(PureScript_CST_Range.rangeOfType(PureScript_CST_Range.rangeOfVoid))(v2.value0);
59456662 };
5946− throw new Error("Failed pattern match at Format (line 37, column 15 - line 39, column 28): " + [ v2.constructor.name ]);
6663+ throw new Error("Failed pattern match at Format (line 62, column 15 - line 64, column 28): " + [ v2.constructor.name ]);
59476664 })();
59486665 return singleOrMultilineFromRange({
59496666 start: v.keyword.range.start,
@@ -5961,7 +6678,42 @@ var PS = {};
59616678 if (v instanceof PureScript_CST_Types.Line) {
59626679 return Data_Maybe.Nothing.value;
59636680 };
5964− throw new Error("Failed pattern match at Format (line 1746, column 17 - line 1749, column 26): " + [ v.constructor.name ]);
6681+ throw new Error("Failed pattern match at Format (line 1785, column 17 - line 1788, column 26): " + [ v.constructor.name ]);
6682+ };
6683+ var commentIsSpaceOrLineFeed = function (v) {
6684+ if (v instanceof PureScript_CST_Types.Space) {
6685+ return true;
6686+ };
6687+ if (v instanceof PureScript_CST_Types.Line) {
6688+ return true;
6689+ };
6690+ return false;
6691+ };
6692+ var precedingEmptyLines = (function () {
6693+ var toLines = function (v) {
6694+ if (v instanceof PureScript_CST_Types.Line) {
6695+ return v.value1;
6696+ };
6697+ return 0;
6698+ };
6699+ var $1109 = Data_Newtype.ala()()()(Data_Monoid_Additive.Additive)(Data_Foldable.foldMap(Data_Foldable.foldableArray)(Data_Monoid_Additive.monoidAdditive(Data_Semiring.semiringInt)));
6700+ var $1110 = Data_Functor.map(Data_Functor.functorArray)(toLines);
6701+ var $1111 = Data_Array.takeWhile(commentIsSpaceOrLineFeed);
6702+ return function ($1112) {
6703+ return $1109($1110($1111($1112)));
6704+ };
6705+ })();
6706+ var isPrecededByBlankLines = function (dictTokensOf) {
6707+ return function (x) {
6708+ var v = PureScript_CST_Range_TokenList.head(PureScript_CST_Range.tokensOf(dictTokensOf)(x));
6709+ if (v instanceof Data_Maybe.Just) {
6710+ return precedingEmptyLines(v.value0.leadingComments) > 1;
6711+ };
6712+ if (v instanceof Data_Maybe.Nothing) {
6713+ return Partial_Unsafe.unsafeCrashWith("Unexpectedly got no tokens");
6714+ };
6715+ throw new Error("Failed pattern match at Format (line 35, column 28 - line 37, column 58): " + [ v.constructor.name ]);
6716+ };
59656717 };
59666718 var blank = "";
59676719 var formatCommentLeading = function (indent) {
@@ -5976,7 +6728,7 @@ var PS = {};
59766728 if (v instanceof PureScript_CST_Types.Space) {
59776729 return blank;
59786730 };
5979− throw new Error("Failed pattern match at Format (line 1703, column 38 - line 1707, column 23): " + [ v.constructor.name ]);
6731+ throw new Error("Failed pattern match at Format (line 1742, column 38 - line 1746, column 23): " + [ v.constructor.name ]);
59806732 };
59816733 };
59826734 };
@@ -5991,7 +6743,7 @@ var PS = {};
59916743 if (comment$prime$prime instanceof PureScript_CST_Types.Space) {
59926744 return blank;
59936745 };
5994− throw new Error("Failed pattern match at Format (line 1713, column 42 - line 1716, column 23): " + [ comment$prime$prime.constructor.name ]);
6746+ throw new Error("Failed pattern match at Format (line 1752, column 42 - line 1755, column 23): " + [ comment$prime$prime.constructor.name ]);
59956747 };
59966748 };
59976749 var formatCommentsLeading = function (indent) {
@@ -6025,7 +6777,7 @@ var PS = {};
60256777 if (style instanceof PureScript_CST_Types.Unicode) {
60266778 return "\u2190";
60276779 };
6028− throw new Error("Failed pattern match at Format (line 1673, column 9 - line 1675, column 29): " + [ style.constructor.name ]);
6780+ throw new Error("Failed pattern match at Format (line 1712, column 9 - line 1714, column 29): " + [ style.constructor.name ]);
60296781 };
60306782 if (v1 instanceof PureScript_CST_Types.TokRightArrow) {
60316783 if (style instanceof PureScript_CST_Types.ASCII) {
@@ -6034,7 +6786,7 @@ var PS = {};
60346786 if (style instanceof PureScript_CST_Types.Unicode) {
60356787 return "\u2192";
60366788 };
6037− throw new Error("Failed pattern match at Format (line 1677, column 9 - line 1679, column 29): " + [ style.constructor.name ]);
6789+ throw new Error("Failed pattern match at Format (line 1716, column 9 - line 1718, column 29): " + [ style.constructor.name ]);
60386790 };
60396791 if (v1 instanceof PureScript_CST_Types.TokRightFatArrow) {
60406792 if (style instanceof PureScript_CST_Types.ASCII) {
@@ -6043,7 +6795,7 @@ var PS = {};
60436795 if (style instanceof PureScript_CST_Types.Unicode) {
60446796 return "\u21d2";
60456797 };
6046− throw new Error("Failed pattern match at Format (line 1681, column 9 - line 1683, column 29): " + [ style.constructor.name ]);
6798+ throw new Error("Failed pattern match at Format (line 1720, column 9 - line 1722, column 29): " + [ style.constructor.name ]);
60476799 };
60486800 if (v1 instanceof PureScript_CST_Types.TokDoubleColon) {
60496801 if (style instanceof PureScript_CST_Types.ASCII) {
@@ -6052,7 +6804,7 @@ var PS = {};
60526804 if (style instanceof PureScript_CST_Types.Unicode) {
60536805 return "\u2237";
60546806 };
6055− throw new Error("Failed pattern match at Format (line 1685, column 9 - line 1687, column 29): " + [ style.constructor.name ]);
6807+ throw new Error("Failed pattern match at Format (line 1724, column 9 - line 1726, column 29): " + [ style.constructor.name ]);
60566808 };
60576809 if (v1 instanceof PureScript_CST_Types.TokForall) {
60586810 if (style instanceof PureScript_CST_Types.ASCII) {
@@ -6061,7 +6813,7 @@ var PS = {};
60616813 if (style instanceof PureScript_CST_Types.Unicode) {
60626814 return "\u2200";
60636815 };
6064− throw new Error("Failed pattern match at Format (line 1689, column 9 - line 1691, column 29): " + [ style.constructor.name ]);
6816+ throw new Error("Failed pattern match at Format (line 1728, column 9 - line 1730, column 29): " + [ style.constructor.name ]);
60656817 };
60666818 if (v1 instanceof PureScript_CST_Types.TokSymbolArrow) {
60676819 if (style instanceof PureScript_CST_Types.ASCII) {
@@ -6070,7 +6822,7 @@ var PS = {};
60706822 if (style instanceof PureScript_CST_Types.Unicode) {
60716823 return "(\u2192)";
60726824 };
6073− throw new Error("Failed pattern match at Format (line 1693, column 9 - line 1695, column 31): " + [ style.constructor.name ]);
6825+ throw new Error("Failed pattern match at Format (line 1732, column 9 - line 1734, column 31): " + [ style.constructor.name ]);
60746826 };
60756827 return PureScript_CST_Print.printToken(v1);
60766828 };
@@ -6082,7 +6834,7 @@ var PS = {};
60826834 if (settings.sourceStyle instanceof Data_Maybe.Just) {
60836835 return printWithStyle(settings.sourceStyle.value0);
60846836 };
6085− throw new Error("Failed pattern match at Format (line 1668, column 13 - line 1670, column 41): " + [ settings.sourceStyle.constructor.name ]);
6837+ throw new Error("Failed pattern match at Format (line 1707, column 13 - line 1709, column 41): " + [ settings.sourceStyle.constructor.name ]);
60866838 })();
60876839 return formatCommentsLeading(indent)(prefix)(v.leadingComments) + (prefix + (print(v.value) + formatCommentsTrailing(prefix)(v.trailingComments)));
60886840 };
@@ -6110,7 +6862,7 @@ var PS = {};
61106862 prefix: space
61116863 };
61126864 };
6113− throw new Error("Failed pattern match at Format (line 1547, column 24 - line 1552, column 53): " + [ v3.constructor.name ]);
6865+ throw new Error("Failed pattern match at Format (line 1586, column 24 - line 1591, column 53): " + [ v3.constructor.name ]);
61146866 })();
61156867 return formatLabel(v1.label) + (formatSourceToken(v)(v2.indent)(space)(v1.separator) + (v2.prefix + formatValue(v2.indent)(v1.value)));
61166868 };
@@ -6140,7 +6892,7 @@ var PS = {};
61406892 return formatName(settings)(indent)(blank)(name) + space;
61416893 })(v.value0) + (formatSourceToken(settings)(indent)(blank)(v.value1) + Data_Foldable.foldMap(Data_Array_NonEmpty_Internal.foldableNonEmptyArray)(Data_Monoid.monoidString)(formatName(settings)(indent)(space))(v.value2));
61426894 };
6143− throw new Error("Failed pattern match at Format (line 1358, column 37 - line 1365, column 62): " + [ v.constructor.name ]);
6895+ throw new Error("Failed pattern match at Format (line 1394, column 37 - line 1401, column 62): " + [ v.constructor.name ]);
61446896 };
61456897 };
61466898 };
@@ -6169,7 +6921,7 @@ var PS = {};
61696921 if (v instanceof Data_Maybe.Just) {
61706922 return newline + (Data_Foldable.fold(Data_Array_NonEmpty_Internal.foldableNonEmptyArray)(Data_Monoid.monoidString)(Data_Array_NonEmpty.intersperse(newline)(v.value0)) + newline);
61716923 };
6172− throw new Error("Failed pattern match at Format (line 1741, column 3 - line 1743, column 82): " + [ v.constructor.name ]);
6924+ throw new Error("Failed pattern match at Format (line 1780, column 3 - line 1782, column 82): " + [ v.constructor.name ]);
61736925 };
61746926 var formatFixityOp = function (settings) {
61756927 return function (indent) {
@@ -6180,7 +6932,7 @@ var PS = {};
61806932 if (fixityOp$prime instanceof PureScript_CST_Types.FixityValue) {
61816933 return formatQualifiedName(settings)(indent)(blank)(fixityOp$prime.value0) + (formatSourceToken(settings)(indent)(space)(fixityOp$prime.value1) + formatName(settings)(indent)(space)(fixityOp$prime.value2));
61826934 };
6183− throw new Error("Failed pattern match at Format (line 454, column 44 - line 463, column 45): " + [ fixityOp$prime.constructor.name ]);
6935+ throw new Error("Failed pattern match at Format (line 478, column 44 - line 487, column 45): " + [ fixityOp$prime.constructor.name ]);
61846936 };
61856937 };
61866938 };
@@ -6208,11 +6960,11 @@ var PS = {};
62086960 if (v2 instanceof SingleLine) {
62096961 return new Data_Tuple.Tuple(indent$prime, space);
62106962 };
6211− throw new Error("Failed pattern match at Format (line 1042, column 26 - line 1044, column 39): " + [ v2.constructor.name ]);
6963+ throw new Error("Failed pattern match at Format (line 1078, column 26 - line 1080, column 39): " + [ v2.constructor.name ]);
62126964 })();
62136965 return formatName(v)(indent$prime)(blank)(recordLabeled$prime.value0) + (formatSourceToken(v)(indent$prime)(blank)(recordLabeled$prime.value1) + (v1.value1 + f(v1.value0)(recordLabeled$prime.value2)));
62146966 };
6215− throw new Error("Failed pattern match at Format (line 1037, column 73 - line 1048, column 20): " + [ recordLabeled$prime.constructor.name ]);
6967+ throw new Error("Failed pattern match at Format (line 1073, column 73 - line 1084, column 20): " + [ recordLabeled$prime.constructor.name ]);
62166968 };
62176969 };
62186970 };
@@ -6231,7 +6983,7 @@ var PS = {};
62316983 if (lines instanceof SingleLine) {
62326984 return blank;
62336985 };
6234− throw new Error("Failed pattern match at Format (line 1638, column 12 - line 1640, column 24): " + [ lines.constructor.name ]);
6986+ throw new Error("Failed pattern match at Format (line 1677, column 12 - line 1679, column 24): " + [ lines.constructor.name ]);
62356987 })();
62366988 var go = function (v1) {
62376989 return prefix + (formatSourceToken(settings)(indent)(blank)(v1.value0) + (prefix$prime + formatValue(v1.value1)));
@@ -6261,7 +7013,7 @@ var PS = {};
62617013 after: blank
62627014 };
62637015 };
6264− throw new Error("Failed pattern match at Format (line 1765, column 23 - line 1767, column 50): " + [ v2.constructor.name ]);
7016+ throw new Error("Failed pattern match at Format (line 1804, column 23 - line 1806, column 50): " + [ v2.constructor.name ]);
62657017 })();
62667018 return formatSourceToken(settings)(indent)(blank)(v.open) + (v1.before + (formatValue(v.value) + (v1.after + formatSourceToken(settings)(indent)(blank)(v.close))));
62677019 };
@@ -6280,7 +7032,7 @@ var PS = {};
62807032 if (lines instanceof SingleLine) {
62817033 return new Data_Tuple.Tuple(space, space);
62827034 };
6283− throw new Error("Failed pattern match at Format (line 1264, column 21 - line 1266, column 33): " + [ lines.constructor.name ]);
7035+ throw new Error("Failed pattern match at Format (line 1300, column 21 - line 1302, column 33): " + [ lines.constructor.name ]);
62847036 })();
62857037 var formatOne = function (v1) {
62867038 return v.value0 + (formatSeparated(settings)(singleOrMultiline(PureScript_CST_Range.rangeOfSeparated(dictRangeOf))(v1))(indent)(space)(formatValue)(v1) + v.value1);
@@ -6307,7 +7059,7 @@ var PS = {};
63077059 close: v.close
63087060 });
63097061 };
6310− throw new Error("Failed pattern match at Format (line 1240, column 49 - line 1251, column 50): " + [ v.constructor.name ]);
7062+ throw new Error("Failed pattern match at Format (line 1276, column 49 - line 1287, column 50): " + [ v.constructor.name ]);
63117063 };
63127064 };
63137065 };
@@ -6339,11 +7091,11 @@ var PS = {};
63397091 if (span instanceof SingleLine) {
63407092 return new Data_Tuple.Tuple(indent$prime, blank);
63417093 };
6342− throw new Error("Failed pattern match at Format (line 261, column 28 - line 263, column 41): " + [ span.constructor.name ]);
7094+ throw new Error("Failed pattern match at Format (line 285, column 28 - line 287, column 41): " + [ span.constructor.name ]);
63437095 })();
63447096 return v1.value1 + formatDelimited(v)(indent$prime)(formatName(v)(v1.value0)(blank))(dataMembers$prime.value0);
63457097 };
6346− throw new Error("Failed pattern match at Format (line 256, column 67 - line 269, column 21): " + [ dataMembers$prime.constructor.name ]);
7098+ throw new Error("Failed pattern match at Format (line 280, column 67 - line 293, column 21): " + [ dataMembers$prime.constructor.name ]);
63477099 };
63487100 };
63497101 };
@@ -6372,7 +7124,7 @@ var PS = {};
63727124 if (lines instanceof SingleLine) {
63737125 return new Data_Tuple.Tuple(indent$prime, blank);
63747126 };
6375− throw new Error("Failed pattern match at Format (line 128, column 26 - line 130, column 39): " + [ lines.constructor.name ]);
7127+ throw new Error("Failed pattern match at Format (line 152, column 26 - line 154, column 39): " + [ lines.constructor.name ]);
63767128 })();
63777129 return formatName(v)(indent$prime)(blank)(export$prime.value0) + (v1.value1 + Data_Foldable.foldMap(Data_Foldable.foldableMaybe)(Data_Monoid.monoidString)(formatDataMembers(v)(v1.value0))(export$prime.value1));
63787130 };
@@ -6385,7 +7137,7 @@ var PS = {};
63857137 if (export$prime instanceof PureScript_CST_Types.ExportError) {
63867138 return Data_Void.absurd(export$prime.value0);
63877139 };
6388− throw new Error("Failed pattern match at Format (line 112, column 57 - line 139, column 32): " + [ export$prime.constructor.name ]);
7140+ throw new Error("Failed pattern match at Format (line 136, column 57 - line 163, column 32): " + [ export$prime.constructor.name ]);
63897141 };
63907142 };
63917143 };
@@ -6410,7 +7162,7 @@ var PS = {};
64107162 if (lines instanceof SingleLine) {
64117163 return indent$prime;
64127164 };
6413− throw new Error("Failed pattern match at Format (line 237, column 16 - line 239, column 30): " + [ lines.constructor.name ]);
7165+ throw new Error("Failed pattern match at Format (line 261, column 16 - line 263, column 30): " + [ lines.constructor.name ]);
64147166 })();
64157167 return formatName(v)(indent$prime)(blank)(import$prime$prime.value0) + Data_Foldable.foldMap(Data_Foldable.foldableMaybe)(Data_Monoid.monoidString)(formatDataMembers(v)(indent))(import$prime$prime.value1);
64167168 };
@@ -6423,7 +7175,7 @@ var PS = {};
64237175 if (import$prime$prime instanceof PureScript_CST_Types.ImportError) {
64247176 return Data_Void.absurd(import$prime$prime.value0);
64257177 };
6426− throw new Error("Failed pattern match at Format (line 226, column 58 - line 247, column 32): " + [ import$prime$prime.constructor.name ]);
7178+ throw new Error("Failed pattern match at Format (line 250, column 58 - line 271, column 32): " + [ import$prime$prime.constructor.name ]);
64277179 };
64287180 };
64297181 };
@@ -6452,11 +7204,11 @@ var PS = {};
64527204 if (lines instanceof SingleLine) {
64537205 return space;
64547206 };
6455− throw new Error("Failed pattern match at Format (line 94, column 16 - line 96, column 28): " + [ lines.constructor.name ]);
7207+ throw new Error("Failed pattern match at Format (line 118, column 16 - line 120, column 28): " + [ lines.constructor.name ]);
64567208 })();
64577209 return prefix + formatDelimitedNonEmpty(PureScript_CST_Range.rangeOfExport(PureScript_CST_Range.rangeOfVoid))(v)(lines)(v.indentation)(formatExport(v)(v.indentation))(exports$prime$prime.value0);
64587210 };
6459− throw new Error("Failed pattern match at Format (line 88, column 52 - line 105, column 39): " + [ exports$prime$prime.constructor.name ]);
7211+ throw new Error("Failed pattern match at Format (line 112, column 52 - line 129, column 39): " + [ exports$prime$prime.constructor.name ]);
64607212 };
64617213 };
64627214 var formatImportDeclaration = function (v) {
@@ -6474,7 +7226,7 @@ var PS = {};
64747226 if (span instanceof SingleLine) {
64757227 return space;
64767228 };
6477− throw new Error("Failed pattern match at Format (line 181, column 34 - line 183, column 40): " + [ span.constructor.name ]);
7229+ throw new Error("Failed pattern match at Format (line 205, column 34 - line 207, column 40): " + [ span.constructor.name ]);
64787230 })();
64797231 var hidingPrefix = (function () {
64807232 if (span instanceof MultipleLines) {
@@ -6483,7 +7235,7 @@ var PS = {};
64837235 if (span instanceof SingleLine) {
64847236 return space;
64857237 };
6486− throw new Error("Failed pattern match at Format (line 177, column 34 - line 179, column 40): " + [ span.constructor.name ]);
7238+ throw new Error("Failed pattern match at Format (line 201, column 34 - line 203, column 40): " + [ span.constructor.name ]);
64877239 })();
64887240 return hidingPrefix + (formatSourceToken(v)(indent$prime)(blank)(v1.value0.value0) + (importPrefix + formatDelimitedNonEmpty(PureScript_CST_Range.rangeOfImport(PureScript_CST_Range.rangeOfVoid))(v)(span)(indent)(formatImport(v)(indent$prime))(v1.value1)));
64897241 };
@@ -6495,11 +7247,11 @@ var PS = {};
64957247 if (span instanceof SingleLine) {
64967248 return space;
64977249 };
6498− throw new Error("Failed pattern match at Format (line 197, column 34 - line 199, column 40): " + [ span.constructor.name ]);
7250+ throw new Error("Failed pattern match at Format (line 221, column 34 - line 223, column 40): " + [ span.constructor.name ]);
64997251 })();
65007252 return importPrefix + formatDelimitedNonEmpty(PureScript_CST_Range.rangeOfImport(PureScript_CST_Range.rangeOfVoid))(v)(span)(indent$prime)(formatImport(v)(indent$prime))(v1.value1);
65017253 };
6502− throw new Error("Failed pattern match at Format (line 174, column 39 - line 206, column 31): " + [ v1.value0.constructor.name ]);
7254+ throw new Error("Failed pattern match at Format (line 198, column 39 - line 230, column 31): " + [ v1.value0.constructor.name ]);
65037255 })(importDecl$prime.names) + Data_Foldable.foldMap(Data_Foldable.foldableMaybe)(Data_Monoid.monoidString)(function (v1) {
65047256 var prefix = (function () {
65057257 if (span instanceof MultipleLines) {
@@ -6508,7 +7260,7 @@ var PS = {};
65087260 if (span instanceof SingleLine) {
65097261 return space;
65107262 };
6511− throw new Error("Failed pattern match at Format (line 212, column 26 - line 214, column 38): " + [ span.constructor.name ]);
7263+ throw new Error("Failed pattern match at Format (line 236, column 26 - line 238, column 38): " + [ span.constructor.name ]);
65127264 })();
65137265 return prefix + (formatSourceToken(v)(indent$prime)(blank)(v1.value0) + formatName(v)(indent$prime)(space)(v1.value1));
65147266 })(importDecl$prime.qualified)));
@@ -6542,7 +7294,7 @@ var PS = {};
65427294 if (oneOrDelimited instanceof PureScript_CST_Types.Many) {
65437295 return formatDelimitedNonEmpty(dictRangeOf)(settings)(lines)(indent)(formatValue)(oneOrDelimited.value0);
65447296 };
6545− throw new Error("Failed pattern match at Format (line 1376, column 73 - line 1378, column 108): " + [ oneOrDelimited.constructor.name ]);
7297+ throw new Error("Failed pattern match at Format (line 1412, column 73 - line 1414, column 108): " + [ oneOrDelimited.constructor.name ]);
65467298 };
65477299 };
65487300 };
@@ -6561,7 +7313,7 @@ var PS = {};
65617313 if (lines instanceof SingleLine) {
65627314 return indent;
65637315 };
6564− throw new Error("Failed pattern match at Format (line 1580, column 14 - line 1582, column 25): " + [ lines.constructor.name ]);
7316+ throw new Error("Failed pattern match at Format (line 1619, column 14 - line 1621, column 25): " + [ lines.constructor.name ]);
65657317 })();
65667318 return formatWrapped(v)(indent)(formatValue(indented))(wrapped);
65677319 };
@@ -6581,7 +7333,7 @@ var PS = {};
65817333 if (lines instanceof SingleLine) {
65827334 return new Data_Tuple.Tuple(space, space);
65837335 };
6584− throw new Error("Failed pattern match at Format (line 952, column 25 - line 954, column 37): " + [ lines.constructor.name ]);
7336+ throw new Error("Failed pattern match at Format (line 988, column 25 - line 990, column 37): " + [ lines.constructor.name ]);
65857337 })();
65867338 return formatWrapped(settings)(indent)(function (separated$prime) {
65877339 return v.value0 + (formatSeparated(settings)(lines)(indent)(space)(formatValue)(separated$prime) + v.value1);
@@ -6604,7 +7356,7 @@ var PS = {};
66047356 close: v.close
66057357 });
66067358 };
6607− throw new Error("Failed pattern match at Format (line 932, column 44 - line 941, column 52): " + [ v.constructor.name ]);
7359+ throw new Error("Failed pattern match at Format (line 968, column 44 - line 977, column 52): " + [ v.constructor.name ]);
66087360 };
66097361 };
66107362 };
@@ -6623,7 +7375,7 @@ var PS = {};
66237375 if (lines instanceof SingleLine) {
66247376 return new Data_Tuple.Tuple(blank, blank);
66257377 };
6626− throw new Error("Failed pattern match at Format (line 1783, column 21 - line 1786, column 36): " + [ v1.value.constructor.name, lines.constructor.name ]);
7378+ throw new Error("Failed pattern match at Format (line 1822, column 21 - line 1825, column 36): " + [ v1.value.constructor.name, lines.constructor.name ]);
66277379 })();
66287380 return formatSourceToken(v)(indent)(blank)(v1.open) + (v2.value0 + (formatRow(lines)(v)(indent)(v1.value) + (v2.value1 + formatSourceToken(v)(indent)(blank)(v1.close))));
66297381 };
@@ -6643,7 +7395,7 @@ var PS = {};
66437395 if (v instanceof PureScript_CST_Types.TypeVarKinded) {
66447396 return formatWrapped(settings)(indent)(formatLabeledName(PureScript_CST_Range.rangeOfName)(settings)(indent))(v.value0);
66457397 };
6646− throw new Error("Failed pattern match at Format (line 1431, column 40 - line 1433, column 105): " + [ v.constructor.name ]);
7398+ throw new Error("Failed pattern match at Format (line 1470, column 40 - line 1472, column 105): " + [ v.constructor.name ]);
66477399 };
66487400 };
66497401 };
@@ -6668,7 +7420,7 @@ var PS = {};
66687420 prefix: space
66697421 };
66707422 };
6671− throw new Error("Failed pattern match at Format (line 1451, column 30 - line 1453, column 58): " + [ v3.constructor.name ]);
7423+ throw new Error("Failed pattern match at Format (line 1490, column 30 - line 1492, column 58): " + [ v3.constructor.name ]);
66727424 })();
66737425 return v2.prefix + formatType(v)(v2.indented)(singleOrMultiline(PureScript_CST_Range.rangeOfType(PureScript_CST_Range.rangeOfVoid))(v1.value0))(v1.value0);
66747426 };
@@ -6682,7 +7434,7 @@ var PS = {};
66827434 if (lines instanceof SingleLine) {
66837435 return space;
66847436 };
6685− throw new Error("Failed pattern match at Format (line 1461, column 14 - line 1463, column 26): " + [ lines.constructor.name ]);
7437+ throw new Error("Failed pattern match at Format (line 1500, column 14 - line 1502, column 26): " + [ lines.constructor.name ]);
66867438 })();
66877439 return formatType(v)(indent)(singleOrMultiline(PureScript_CST_Range.rangeOfType(PureScript_CST_Range.rangeOfVoid))(t.value0))(t.value0) + (space + (formatSourceToken(v)(indent)(blank)(t.value1) + (prefix + formatType(v)(indent)(singleOrMultiline(PureScript_CST_Range.rangeOfType(PureScript_CST_Range.rangeOfVoid))(t.value2))(t.value2))));
66887440 };
@@ -6718,7 +7470,7 @@ var PS = {};
67187470 if (lines instanceof SingleLine) {
67197471 return space;
67207472 };
6721− throw new Error("Failed pattern match at Format (line 1479, column 14 - line 1481, column 26): " + [ lines.constructor.name ]);
7473+ throw new Error("Failed pattern match at Format (line 1518, column 14 - line 1520, column 26): " + [ lines.constructor.name ]);
67227474 })();
67237475 return formatSourceToken(v)(indent)(blank)(t.value0) + (formatTypeVarBindings(v)(indent)(Data_Array_NonEmpty.toArray(t.value1)) + (formatSourceToken(v)(indent)(blank)(t.value2) + (prefix + formatType(v)(indent)(lines)(t.value3))));
67247476 };
@@ -6736,7 +7488,7 @@ var PS = {};
67367488 prefix: space
67377489 };
67387490 };
6739− throw new Error("Failed pattern match at Format (line 1489, column 28 - line 1491, column 56): " + [ lines.constructor.name ]);
7491+ throw new Error("Failed pattern match at Format (line 1528, column 28 - line 1530, column 56): " + [ lines.constructor.name ]);
67407492 })();
67417493 return formatType(v)(indent)(lines)(t.value0) + (space + (formatSourceToken(v)(indent)(blank)(t.value1) + (v1.prefix + formatType(v)(v1.indented)(lines)(t.value2))));
67427494 };
@@ -6755,7 +7507,7 @@ var PS = {};
67557507 prefix: space
67567508 };
67577509 };
6758− throw new Error("Failed pattern match at Format (line 1501, column 30 - line 1503, column 58): " + [ lines.constructor.name ]);
7510+ throw new Error("Failed pattern match at Format (line 1540, column 30 - line 1542, column 58): " + [ lines.constructor.name ]);
67597511 })();
67607512 return formatQualifiedName(v)(v2.indented)(v2.prefix)(v1.value0) + (v2.prefix + formatType(v)(v2.indented)(singleOrMultiline(PureScript_CST_Range.rangeOfType(PureScript_CST_Range.rangeOfVoid))(v1.value1))(v1.value1));
67617513 };
@@ -6772,7 +7524,7 @@ var PS = {};
67727524 if (lines instanceof SingleLine) {
67737525 return space;
67747526 };
6775− throw new Error("Failed pattern match at Format (line 1512, column 14 - line 1514, column 26): " + [ lines.constructor.name ]);
7527+ throw new Error("Failed pattern match at Format (line 1551, column 14 - line 1553, column 26): " + [ lines.constructor.name ]);
67767528 })();
67777529 return formatType(v)(indent)(lines)(t.value0) + (space + (formatSourceToken(v)(indent)(blank)(t.value1) + (prefix + formatType(v)(indent)(lines)(t.value2))));
67787530 };
@@ -6791,14 +7543,14 @@ var PS = {};
67917543 if (lines instanceof SingleLine) {
67927544 return space;
67937545 };
6794− throw new Error("Failed pattern match at Format (line 1526, column 14 - line 1528, column 26): " + [ lines.constructor.name ]);
7546+ throw new Error("Failed pattern match at Format (line 1565, column 14 - line 1567, column 26): " + [ lines.constructor.name ]);
67957547 })();
67967548 return formatSourceToken(v)(indent)(blank)(t.value0) + (prefix + formatType(v)(indent)(lines)(t.value1));
67977549 };
67987550 if (t instanceof PureScript_CST_Types["TypeError"]) {
67997551 return Data_Void.absurd(t.value0);
68007552 };
6801− throw new Error("Failed pattern match at Format (line 1441, column 54 - line 1529, column 30): " + [ t.constructor.name ]);
7553+ throw new Error("Failed pattern match at Format (line 1480, column 54 - line 1568, column 30): " + [ t.constructor.name ]);
68027554 };
68037555 };
68047556 };
@@ -6826,7 +7578,7 @@ var PS = {};
68267578 after: space
68277579 };
68287580 };
6829− throw new Error("Failed pattern match at Format (line 1597, column 35 - line 1599, column 70): " + [ lines.constructor.name ]);
7581+ throw new Error("Failed pattern match at Format (line 1636, column 35 - line 1638, column 70): " + [ lines.constructor.name ]);
68307582 })();
68317583 var f = formatLabeledName(PureScript_CST_Range.rangeOfName)(v)(v2.indented);
68327584 return v2.before + (formatSeparated(v)(lines)(indent)(space)(f)(v1.labels.value0) + v2.after);
@@ -6845,7 +7597,7 @@ var PS = {};
68457597 after: space
68467598 };
68477599 };
6848− throw new Error("Failed pattern match at Format (line 1609, column 25 - line 1611, column 52): " + [ lines.constructor.name ]);
7600+ throw new Error("Failed pattern match at Format (line 1648, column 25 - line 1650, column 52): " + [ lines.constructor.name ]);
68497601 })();
68507602 return v2.before + (formatSourceToken(v)(indent)(blank)(v1.tail.value0.value0) + (space + (formatType(v)(indent)(lines)(v1.tail.value0.value1) + v2.after)));
68517603 };
@@ -6867,12 +7619,12 @@ var PS = {};
68677619 prefix: space
68687620 };
68697621 };
6870− throw new Error("Failed pattern match at Format (line 1621, column 43 - line 1623, column 85): " + [ lines.constructor.name ]);
7622+ throw new Error("Failed pattern match at Format (line 1660, column 43 - line 1662, column 85): " + [ lines.constructor.name ]);
68717623 })();
68727624 var f = formatLabeledName(PureScript_CST_Range.rangeOfName)(v)(v2.indented);
68737625 return v2.before + (formatSeparated(v)(lines)(indent)(space)(f)(v1.labels.value0) + (v2.prefix + (formatSourceToken(v)(indent)(blank)(v1.tail.value0.value0) + (space + (formatType(v)(indent)(lines)(v1.tail.value0.value1) + v2.after)))));
68747626 };
6875− throw new Error("Failed pattern match at Format (line 1590, column 78 - line 1625, column 44): " + [ v1.labels.constructor.name, v1.tail.constructor.name ]);
7627+ throw new Error("Failed pattern match at Format (line 1629, column 78 - line 1664, column 44): " + [ v1.labels.constructor.name, v1.tail.constructor.name ]);
68767628 };
68777629 };
68787630 };
@@ -6910,7 +7662,7 @@ var PS = {};
69107662 if (v1 instanceof SingleLine) {
69117663 return space;
69127664 };
6913− throw new Error("Failed pattern match at Format (line 580, column 16 - line 582, column 28): " + [ v1.constructor.name ]);
7665+ throw new Error("Failed pattern match at Format (line 604, column 16 - line 606, column 28): " + [ v1.constructor.name ]);
69147666 })();
69157667 return formatQualifiedName(v)(indent$prime)(blank)(binder.value0) + Data_Foldable.foldMap(Data_Foldable.foldableArray)(Data_Monoid.monoidString)(function (binder$prime) {
69167668 return prefix + formatBinder(v)(indent$prime)(binder$prime);
@@ -6931,7 +7683,7 @@ var PS = {};
69317683 if (lines instanceof SingleLine) {
69327684 return new Data_Tuple.Tuple(indent$prime, space);
69337685 };
6934− throw new Error("Failed pattern match at Format (line 600, column 24 - line 602, column 37): " + [ lines.constructor.name ]);
7686+ throw new Error("Failed pattern match at Format (line 624, column 24 - line 626, column 37): " + [ lines.constructor.name ]);
69357687 })();
69367688 var formatNamedBinder = function (v2) {
69377689 return formatQualifiedName(v)(indent$prime)(v1.value1)(v2.value0) + (v1.value1 + formatBinder(v)(v1.value0)(v2.value1));
@@ -6959,7 +7711,7 @@ var PS = {};
69597711 if (lines instanceof SingleLine) {
69607712 return new Data_Tuple.Tuple(indent$prime, space);
69617713 };
6962− throw new Error("Failed pattern match at Format (line 625, column 26 - line 627, column 39): " + [ lines.constructor.name ]);
7714+ throw new Error("Failed pattern match at Format (line 649, column 26 - line 651, column 39): " + [ lines.constructor.name ]);
69637715 })();
69647716 return formatBinder(v)(indent$prime)(binder.value0) + (formatSourceToken(v)(indent$prime)(space)(binder.value1) + (v1.value1 + formatType(v)(v1.value0)(lines)(binder.value2)));
69657717 };
@@ -6975,7 +7727,7 @@ var PS = {};
69757727 if (binder instanceof PureScript_CST_Types.BinderError) {
69767728 return Data_Void.absurd(binder.value0);
69777729 };
6978− throw new Error("Failed pattern match at Format (line 566, column 56 - line 637, column 32): " + [ binder.constructor.name ]);
7730+ throw new Error("Failed pattern match at Format (line 590, column 56 - line 661, column 32): " + [ binder.constructor.name ]);
69797731 };
69807732 };
69817733 };
@@ -6997,7 +7749,7 @@ var PS = {};
69977749 prefix: space
69987750 };
69997751 };
7000− throw new Error("Failed pattern match at Format (line 1403, column 26 - line 1408, column 54): " + [ lines.constructor.name ]);
7752+ throw new Error("Failed pattern match at Format (line 1439, column 26 - line 1447, column 8): " + [ lines.constructor.name ]);
70017753 })();
70027754 var formatField = function (typo) {
70037755 return v2.prefix + formatType(v)(v2.indented)(lines)(typo);
@@ -7017,7 +7769,7 @@ var PS = {};
70177769 if (lines instanceof SingleLine) {
70187770 return new Data_Tuple.Tuple(indent$prime$prime, new Data_Tuple.Tuple(indent$prime$prime, space));
70197771 };
7020− throw new Error("Failed pattern match at Format (line 496, column 37 - line 501, column 52): " + [ lines.constructor.name ]);
7772+ throw new Error("Failed pattern match at Format (line 520, column 37 - line 525, column 52): " + [ lines.constructor.name ]);
70217773 })();
70227774 var typePrefix = (function () {
70237775 var v3 = Data_Array.last(v1.types);
@@ -7029,12 +7781,12 @@ var PS = {};
70297781 if (v4 instanceof SingleLine) {
70307782 return space;
70317783 };
7032− throw new Error("Failed pattern match at Format (line 504, column 24 - line 506, column 28): " + [ v4.constructor.name ]);
7784+ throw new Error("Failed pattern match at Format (line 528, column 24 - line 530, column 28): " + [ v4.constructor.name ]);
70337785 };
70347786 if (v3 instanceof Data_Maybe.Nothing) {
70357787 return space;
70367788 };
7037− throw new Error("Failed pattern match at Format (line 503, column 18 - line 507, column 23): " + [ v3.constructor.name ]);
7789+ throw new Error("Failed pattern match at Format (line 527, column 18 - line 531, column 23): " + [ v3.constructor.name ]);
70387790 })();
70397791 return formatSourceToken(v)(indent$prime$prime)(blank)(v1.keyword) + (Data_Foldable.foldMap(Data_Foldable.foldableMaybe)(Data_Monoid.monoidString)(function (v3) {
70407792 return formatName(v)(indent$prime$prime)(space)(v3.name) + formatSourceToken(v)(indent$prime$prime)(space)(v3.separator);
@@ -7066,7 +7818,7 @@ var PS = {};
70667818 prefix: space
70677819 };
70687820 };
7069− throw new Error("Failed pattern match at Format (line 1323, column 26 - line 1328, column 54): " + [ lines.constructor.name ]);
7821+ throw new Error("Failed pattern match at Format (line 1359, column 26 - line 1364, column 54): " + [ lines.constructor.name ]);
70707822 })();
70717823 var formatTypeVariableBinding = function (binding) {
70727824 return space + formatTypeVarBinding(v)(indent)(binding);
@@ -7119,7 +7871,7 @@ var PS = {};
71197871 if (foreign$prime$prime instanceof PureScript_CST_Types.ForeignValue) {
71207872 return formatLabeledNameType(settings)(indent$prime)(foreign$prime$prime.value0);
71217873 };
7122− throw new Error("Failed pattern match at Format (line 411, column 44 - line 420, column 52): " + [ foreign$prime$prime.constructor.name ]);
7874+ throw new Error("Failed pattern match at Format (line 435, column 44 - line 444, column 52): " + [ foreign$prime$prime.constructor.name ]);
71237875 };
71247876 };
71257877 };
@@ -7127,9 +7879,43 @@ var PS = {};
71277879 return function (indent$prime) {
71287880 return function (v1) {
71297881 var indent = indent$prime + v.indentation;
7130− return formatExprPrefix(singleOrMultiline(PureScript_CST_Range.rangeOfExpr(PureScript_CST_Range.rangeOfVoid))(v1.expr))(v)(indent$prime)(v1.expr) + Data_Foldable.foldMap(Data_Foldable.foldableMaybe)(Data_Monoid.monoidString)(function (v2) {
7131− return newline + indent + (formatSourceToken(v)(indent)(blank)(v2.value0) + (Data_Foldable.foldMap(Data_Foldable.foldableArray)(Data_Monoid.monoidString)(formatLetBinding(v)(indent)(newline + indent)(newline))(Data_Array_NonEmpty.init(v2.value1)) + formatLetBinding(v)(indent)(newline + indent)(blank)(Data_Array_NonEmpty.last(v2.value1))));
7132− })(v1.bindings);
7882+ var formatLetBindingWithFollowing = function (v2) {
7883+ var suffix = (function () {
7884+ if (v2.value1 instanceof Data_Maybe.Nothing) {
7885+ return blank;
7886+ };
7887+ if (v2.value1 instanceof Data_Maybe.Just) {
7888+ var $663 = isPrecededByBlankLines(PureScript_CST_Range.tokensOfLetBinding(PureScript_CST_Range.tokensOfVoid))(v2.value1.value0);
7889+ if ($663) {
7890+ return newline;
7891+ };
7892+ return blank;
7893+ };
7894+ throw new Error("Failed pattern match at Format (line 715, column 18 - line 719, column 33): " + [ v2.value1.constructor.name ]);
7895+ })();
7896+ return formatLetBinding(v)(indent)(newline + indent)(suffix)(v2.value0);
7897+ };
7898+ var formatLetBindings = function (letBindings$prime) {
7899+ return Data_Foldable.foldMap(Data_Array_NonEmpty_Internal.foldableNonEmptyArray)(Data_Monoid.monoidString)(formatLetBindingWithFollowing)(Data_Array_NonEmpty.zip(letBindings$prime)(Data_Array_NonEmpty["snoc'"](Data_Functor.map(Data_Functor.functorArray)(Data_Maybe.Just.create)(Data_Array_NonEmpty.tail(letBindings$prime)))(Data_Maybe.Nothing.value)));
7900+ };
7901+ var formatWhereAndBindings = function (v2) {
7902+ var whereSuffix = (function () {
7903+ var $668 = isPrecededByBlankLines(PureScript_CST_Range.tokensOfLetBinding(PureScript_CST_Range.tokensOfVoid))(Data_Array_NonEmpty.head(v2.value1));
7904+ if ($668) {
7905+ return newline;
7906+ };
7907+ return blank;
7908+ })();
7909+ var wherePrefix = (function () {
7910+ var $669 = precedingEmptyLines(v2.value0.leadingComments) > 1;
7911+ if ($669) {
7912+ return newline;
7913+ };
7914+ return blank;
7915+ })();
7916+ return wherePrefix + (newline + indent) + (formatSourceToken(v)(indent)(blank)(v2.value0) + (whereSuffix + formatLetBindings(v2.value1)));
7917+ };
7918+ return formatExprPrefix(singleOrMultiline(PureScript_CST_Range.rangeOfExpr(PureScript_CST_Range.rangeOfVoid))(v1.expr))(v)(indent$prime)(v1.expr) + Data_Foldable.foldMap(Data_Foldable.foldableMaybe)(Data_Monoid.monoidString)(formatWhereAndBindings)(v1.bindings);
71337919 };
71347920 };
71357921 };
@@ -7156,7 +7942,7 @@ var PS = {};
71567942 if (lines instanceof SingleLine) {
71577943 return new Data_Tuple.Tuple(indent$prime, space);
71587944 };
7159− throw new Error("Failed pattern match at Format (line 1005, column 26 - line 1007, column 39): " + [ lines.constructor.name ]);
7945+ throw new Error("Failed pattern match at Format (line 1041, column 26 - line 1043, column 39): " + [ lines.constructor.name ]);
71607946 })();
71617947 return formatName(v)(indent$prime)(blank)(recordUpdate$prime.value0) + (v1.value1 + formatRecordNonEmpty(v)(v1.value0)(formatRecordUpdate(v)(v1.value0))(recordUpdate$prime.value1));
71627948 };
@@ -7170,11 +7956,11 @@ var PS = {};
71707956 if (lines instanceof SingleLine) {
71717957 return new Data_Tuple.Tuple(indent$prime, space);
71727958 };
7173− throw new Error("Failed pattern match at Format (line 1021, column 26 - line 1023, column 39): " + [ lines.constructor.name ]);
7959+ throw new Error("Failed pattern match at Format (line 1057, column 26 - line 1059, column 39): " + [ lines.constructor.name ]);
71747960 })();
71757961 return formatName(v)(indent$prime)(blank)(recordUpdate$prime.value0) + (formatSourceToken(v)(indent$prime)(space)(recordUpdate$prime.value1) + (v1.value1 + formatExpr(v)(v1.value0)(recordUpdate$prime.value2)));
71767962 };
7177− throw new Error("Failed pattern match at Format (line 998, column 69 - line 1027, column 42): " + [ recordUpdate$prime.constructor.name ]);
7963+ throw new Error("Failed pattern match at Format (line 1034, column 69 - line 1063, column 42): " + [ recordUpdate$prime.constructor.name ]);
71787964 };
71797965 };
71807966 };
@@ -7190,7 +7976,7 @@ var PS = {};
71907976 if (lines instanceof SingleLine) {
71917977 return new Data_Tuple.Tuple(indent$prime, blank);
71927978 };
7193− throw new Error("Failed pattern match at Format (line 978, column 26 - line 980, column 39): " + [ lines.constructor.name ]);
7979+ throw new Error("Failed pattern match at Format (line 1014, column 26 - line 1016, column 39): " + [ lines.constructor.name ]);
71947980 })();
71957981 return formatExpr(v)(v1.value0)(recordAccessor$prime.expr) + (v1.value1 + (formatSourceToken(v)(v1.value0)(blank)(recordAccessor$prime.dot) + formatSeparated(v)(lines)(v1.value0)(blank)(formatName(v)(indent$prime)(blank))(recordAccessor$prime.path)));
71967982 };
@@ -7207,7 +7993,7 @@ var PS = {};
72077993 if (v1.binder instanceof Data_Maybe.Nothing) {
72087994 return formatExpr(v)(indent)(v1.expr);
72097995 };
7210− throw new Error("Failed pattern match at Format (line 735, column 110 - line 740, column 46): " + [ v1.binder.constructor.name ]);
7996+ throw new Error("Failed pattern match at Format (line 771, column 110 - line 776, column 46): " + [ v1.binder.constructor.name ]);
72117997 };
72127998 };
72137999 };
@@ -7222,7 +8008,7 @@ var PS = {};
72228008 if (lines instanceof SingleLine) {
72238009 return new Data_Tuple.Tuple(space, new Data_Tuple.Tuple(indent$prime, space));
72248010 };
7225− throw new Error("Failed pattern match at Format (line 1063, column 38 - line 1065, column 48): " + [ lines.constructor.name ]);
8011+ throw new Error("Failed pattern match at Format (line 1099, column 38 - line 1101, column 48): " + [ lines.constructor.name ]);
72268012 })();
72278013 return formatSourceToken(v)(indent$prime)(blank)(letIn$prime.keyword) + (Data_Foldable.foldMap(Data_Foldable.foldableArray)(Data_Monoid.monoidString)(formatLetBinding(v)(v1.value1.value0)(v1.value1.value1)(newline))(Data_Array_NonEmpty.init(letIn$prime.bindings)) + (formatLetBinding(v)(v1.value1.value0)(v1.value1.value1)(blank)(Data_Array_NonEmpty.last(letIn$prime.bindings)) + (v1.value0 + (formatSourceToken(v)(indent$prime)(blank)(letIn$prime["in"]) + (v1.value1.value1 + formatExpr(v)(v1.value1.value0)(letIn$prime.body))))));
72288014 };
@@ -7246,7 +8032,7 @@ var PS = {};
72468032 if (v1 instanceof PureScript_CST_Types.LetBindingError) {
72478033 return Data_Void.absurd(v1.value0);
72488034 };
7249− throw new Error("Failed pattern match at Format (line 692, column 67 - line 706, column 36): " + [ v1.constructor.name ]);
8035+ throw new Error("Failed pattern match at Format (line 728, column 67 - line 742, column 36): " + [ v1.constructor.name ]);
72508036 };
72518037 };
72528038 };
@@ -7274,7 +8060,7 @@ var PS = {};
72748060 if (lines instanceof SingleLine) {
72758061 return space;
72768062 };
7277− throw new Error("Failed pattern match at Format (line 1141, column 12 - line 1143, column 24): " + [ lines.constructor.name ]);
8063+ throw new Error("Failed pattern match at Format (line 1177, column 12 - line 1179, column 24): " + [ lines.constructor.name ]);
72788064 })();
72798065 return formatSourceToken(v)(indent)(blank)(v1.keyword) + (space + (formatExpr(v)(indent)(v1.cond) + (space + (formatSourceToken(v)(indent)(blank)(v1.then) + (formatExprPrefix(lines)(v)(indent)(v1["true"]) + (prefix + (formatSourceToken(v)(indent)(blank)(v1["else"]) + formatExprPrefixElseIf(lines)(v)(indent)(v1["false"]))))))));
72808066 };
@@ -7301,7 +8087,7 @@ var PS = {};
73018087 if (v1 instanceof PureScript_CST_Types.Unconditional) {
73028088 return formatSourceToken(v)(indent$prime)(space)(v1.value0) + formatWhere(v)(indent$prime)(v1.value1);
73038089 };
7304− throw new Error("Failed pattern match at Format (line 646, column 50 - line 658, column 49): " + [ v1.constructor.name ]);
8090+ throw new Error("Failed pattern match at Format (line 670, column 50 - line 682, column 49): " + [ v1.constructor.name ]);
73058091 };
73068092 };
73078093 };
@@ -7390,7 +8176,7 @@ var PS = {};
73908176 if (expr$prime instanceof PureScript_CST_Types.ExprError) {
73918177 return Data_Void.absurd(expr$prime.value0);
73928178 };
7393− throw new Error("Failed pattern match at Format (line 1095, column 70 - line 1122, column 30): " + [ expr$prime.constructor.name ]);
8179+ throw new Error("Failed pattern match at Format (line 1131, column 70 - line 1158, column 30): " + [ expr$prime.constructor.name ]);
73948180 };
73958181 };
73968182 };
@@ -7481,7 +8267,7 @@ var PS = {};
74818267 if (expr instanceof PureScript_CST_Types.ExprError) {
74828268 return Data_Void.absurd(expr.value0);
74838269 };
7484− throw new Error("Failed pattern match at Format (line 747, column 12 - line 774, column 32): " + [ expr.constructor.name ]);
8270+ throw new Error("Failed pattern match at Format (line 783, column 12 - line 810, column 32): " + [ expr.constructor.name ]);
74858271 })();
74868272 var multiLine = (function () {
74878273 if (expr instanceof PureScript_CST_Types.ExprAdo) {
@@ -7565,7 +8351,7 @@ var PS = {};
75658351 if (expr instanceof PureScript_CST_Types.ExprError) {
75668352 return Data_Void.absurd(expr.value0);
75678353 };
7568− throw new Error("Failed pattern match at Format (line 776, column 15 - line 803, column 32): " + [ expr.constructor.name ]);
8354+ throw new Error("Failed pattern match at Format (line 812, column 15 - line 839, column 32): " + [ expr.constructor.name ]);
75698355 })();
75708356 var prefix = (function () {
75718357 if (lines instanceof MultipleLines) {
@@ -7574,7 +8360,7 @@ var PS = {};
75748360 if (lines instanceof SingleLine) {
75758361 return space;
75768362 };
7577− throw new Error("Failed pattern match at Format (line 806, column 12 - line 808, column 24): " + [ lines.constructor.name ]);
8363+ throw new Error("Failed pattern match at Format (line 842, column 12 - line 844, column 24): " + [ lines.constructor.name ]);
75788364 })();
75798365 return prefix + formatExpr(v)(indent)(expr);
75808366 };
@@ -7602,7 +8388,7 @@ var PS = {};
76028388 if (lines instanceof SingleLine) {
76038389 return indent$prime$prime;
76048390 };
7605− throw new Error("Failed pattern match at Format (line 824, column 17 - line 826, column 31): " + [ lines.constructor.name ]);
8391+ throw new Error("Failed pattern match at Format (line 860, column 17 - line 862, column 31): " + [ lines.constructor.name ]);
76068392 })();
76078393 return formatArray(PureScript_CST_Range.rangeOfExpr(PureScript_CST_Range.rangeOfVoid))(v)(lines)(indent$prime$prime)(formatExpr(v)(indent$prime))(expr$prime$prime.value0);
76088394 };
@@ -7638,7 +8424,7 @@ var PS = {};
76388424 if (lines instanceof SingleLine) {
76398425 return new Data_Tuple.Tuple(indent$prime$prime, new Data_Tuple.Tuple(indent$prime$prime, new Data_Tuple.Tuple(space, space)));
76408426 };
7641− throw new Error("Failed pattern match at Format (line 846, column 48 - line 853, column 61): " + [ lines.constructor.name ]);
8427+ throw new Error("Failed pattern match at Format (line 882, column 48 - line 889, column 61): " + [ lines.constructor.name ]);
76428428 })();
76438429 var formatOne = function (v2) {
76448430 return formatWrapped(v)(v1.value0)(formatExpr(v)(v1.value1.value0))(v2.value0) + (v1.value1.value1.value1 + formatExpr(v)(v1.value0)(v2.value1));
@@ -7665,7 +8451,7 @@ var PS = {};
76658451 if (lines instanceof SingleLine) {
76668452 return new Data_Tuple.Tuple(indent$prime$prime + v.indentation, new Data_Tuple.Tuple(indent$prime$prime, space));
76678453 };
7668− throw new Error("Failed pattern match at Format (line 870, column 37 - line 872, column 69): " + [ lines.constructor.name ]);
8454+ throw new Error("Failed pattern match at Format (line 906, column 37 - line 908, column 69): " + [ lines.constructor.name ]);
76698455 })();
76708456 return formatExpr(v)(indent$prime$prime)(expr$prime$prime.value0) + Data_Foldable.foldMap(Data_Array_NonEmpty_Internal.foldableNonEmptyArray)(Data_Monoid.monoidString)(function (v2) {
76718457 return formatQualifiedName(v)(v1.value1.value0)(v1.value1.value1)(v2.value0) + (space + formatExpr(v)(v1.value0)(v2.value1));
@@ -7691,7 +8477,7 @@ var PS = {};
76918477 if (lines instanceof SingleLine) {
76928478 return new Data_Tuple.Tuple(indent$prime$prime, space);
76938479 };
7694− throw new Error("Failed pattern match at Format (line 899, column 27 - line 901, column 40): " + [ lines.constructor.name ]);
8480+ throw new Error("Failed pattern match at Format (line 935, column 27 - line 937, column 40): " + [ lines.constructor.name ]);
76958481 })();
76968482 return formatExpr(v)(indent$prime$prime)(expr$prime$prime.value0) + (v1.value1 + formatRecordNonEmpty(v)(v1.value0)(formatRecordUpdate(v)(v1.value0))(expr$prime$prime.value1));
76978483 };
@@ -7709,7 +8495,7 @@ var PS = {};
77098495 if (lines instanceof SingleLine) {
77108496 return new Data_Tuple.Tuple(indent$prime$prime, space);
77118497 };
7712− throw new Error("Failed pattern match at Format (line 913, column 27 - line 915, column 40): " + [ lines.constructor.name ]);
8498+ throw new Error("Failed pattern match at Format (line 949, column 27 - line 951, column 40): " + [ lines.constructor.name ]);
77138499 })();
77148500 return formatExpr(v)(indent$prime$prime)(expr$prime$prime.value0) + (formatSourceToken(v)(indent$prime$prime)(space)(expr$prime$prime.value1) + (v1.value1 + formatType(v)(v1.value0)(lines)(expr$prime$prime.value2)));
77158501 };
@@ -7719,7 +8505,7 @@ var PS = {};
77198505 if (expr$prime$prime instanceof PureScript_CST_Types.ExprError) {
77208506 return Data_Void.absurd(expr$prime$prime.value0);
77218507 };
7722− throw new Error("Failed pattern match at Format (line 815, column 55 - line 921, column 30): " + [ expr$prime$prime.constructor.name ]);
8508+ throw new Error("Failed pattern match at Format (line 851, column 55 - line 957, column 30): " + [ expr$prime$prime.constructor.name ]);
77238509 };
77248510 };
77258511 };
@@ -7739,7 +8525,7 @@ var PS = {};
77398525 if (doStatement$prime instanceof PureScript_CST_Types.DoError) {
77408526 return Data_Void.absurd(doStatement$prime.value0);
77418527 };
7742− throw new Error("Failed pattern match at Format (line 1172, column 67 - line 1192, column 28): " + [ doStatement$prime.constructor.name ]);
8528+ throw new Error("Failed pattern match at Format (line 1208, column 67 - line 1228, column 28): " + [ doStatement$prime.constructor.name ]);
77438529 };
77448530 };
77458531 };
@@ -7755,7 +8541,7 @@ var PS = {};
77558541 if (lines instanceof SingleLine) {
77568542 return new Data_Tuple.Tuple(indent$prime, space);
77578543 };
7758− throw new Error("Failed pattern match at Format (line 1156, column 26 - line 1158, column 39): " + [ lines.constructor.name ]);
8544+ throw new Error("Failed pattern match at Format (line 1192, column 26 - line 1194, column 39): " + [ lines.constructor.name ]);
77598545 })();
77608546 return formatSourceToken(v)(indent$prime)(blank)(doBlock$prime.keyword) + Data_Foldable.foldMap(Data_Array_NonEmpty_Internal.foldableNonEmptyArray)(Data_Monoid.monoidString)(function (doStatement$prime) {
77618547 return v1.value1 + formatDoStatement(v)(v1.value0)(doStatement$prime);
@@ -7775,7 +8561,7 @@ var PS = {};
77758561 if (lines instanceof SingleLine) {
77768562 return new Data_Tuple.Tuple(indent$prime, space);
77778563 };
7778− throw new Error("Failed pattern match at Format (line 1203, column 26 - line 1205, column 39): " + [ lines.constructor.name ]);
8564+ throw new Error("Failed pattern match at Format (line 1239, column 26 - line 1241, column 39): " + [ lines.constructor.name ]);
77798565 })();
77808566 return formatSourceToken(v)(indent$prime)(blank)(caseOf$prime.keyword) + (space + (formatSeparated(v)(singleOrMultiline(PureScript_CST_Range.rangeOfSeparated(PureScript_CST_Range.rangeOfExpr(PureScript_CST_Range.rangeOfVoid)))(caseOf$prime.head))(v1.value0)(space)(formatExpr(v)(v1.value0))(caseOf$prime.head) + (space + (formatSourceToken(v)(indent$prime)(blank)(caseOf$prime.of) + Data_Foldable.foldMap(Data_Array_NonEmpty_Internal.foldableNonEmptyArray)(Data_Monoid.monoidString)(function (v2) {
77818567 return v1.value1 + (formatSeparated(v)(singleOrMultiline(PureScript_CST_Range.rangeOfSeparated(PureScript_CST_Range.rangeOfBinder(PureScript_CST_Range.rangeOfVoid)))(v2.value0))(v1.value0)(space)(formatBinder(v)(v1.value0))(v2.value0) + formatGuarded(v)(v1.value0)(v2.value1));
@@ -7802,7 +8588,7 @@ var PS = {};
78028588 prefix: space
78038589 };
78048590 };
7805− throw new Error("Failed pattern match at Format (line 1281, column 26 - line 1286, column 55): " + [ lines.constructor.name ]);
8591+ throw new Error("Failed pattern match at Format (line 1317, column 26 - line 1322, column 55): " + [ lines.constructor.name ]);
78068592 })();
78078593 return formatSourceToken(v)(indent$prime)(blank)(v1.keyword) + (Data_Foldable.foldMap(Data_Foldable.foldableArray)(Data_Monoid.monoidString)(function (doStatement$prime) {
78088594 return v2.prefix + formatDoStatement(v)(v2.indent)(doStatement$prime);
@@ -7820,7 +8606,7 @@ var PS = {};
78208606 if (v instanceof PureScript_CST_Types.InstanceBindingName) {
78218607 return formatValueBindingFields(settings)(indent)(v.value0);
78228608 };
7823− throw new Error("Failed pattern match at Format (line 537, column 41 - line 541, column 64): " + [ v.constructor.name ]);
8609+ throw new Error("Failed pattern match at Format (line 561, column 41 - line 565, column 64): " + [ v.constructor.name ]);
78248610 };
78258611 };
78268612 };
@@ -7845,7 +8631,7 @@ var PS = {};
78458631 var indented = indent + v.indentation;
78468632 if (declaration instanceof PureScript_CST_Types.DeclData) {
78478633 var formatDataConstructors = function (v1) {
7848− return newline + indented + (formatSourceToken(v)(indented)(blank)(v1.value0) + formatSeparated(v)(singleOrMultiline(PureScript_CST_Range.rangeOfDecl(PureScript_CST_Range.rangeOfVoid))(declaration))(indented)(blank)(formatDataConstructor(v)(indented))(v1.value1));
8634+ return newline + indented + (formatSourceToken(v)(indented)(blank)(v1.value0) + formatSeparated(v)(MultipleLines.value)(indented)(blank)(formatDataConstructor(v)(indented))(v1.value1));
78498635 };
78508636 return formatDataHead(v)(indent)(declaration.value0) + (Data_Foldable.foldMap(Data_Foldable.foldableMaybe)(Data_Monoid.monoidString)(formatDataConstructors)(declaration.value1) + newline);
78518637 };
@@ -7861,7 +8647,7 @@ var PS = {};
78618647 if (v1 instanceof SingleLine) {
78628648 return space;
78638649 };
7864− throw new Error("Failed pattern match at Format (line 337, column 14 - line 339, column 26): " + [ v1.constructor.name ]);
8650+ throw new Error("Failed pattern match at Format (line 361, column 14 - line 363, column 26): " + [ v1.constructor.name ]);
78658651 })();
78668652 return formatDataHead(v)(indent)(declaration.value0) + (newline + indented + (formatSourceToken(v)(indented)(blank)(declaration.value1) + (space + (formatName(v)(indented)(blank)(declaration.value2) + (prefix + (formatType(v)(indented)(lines)(declaration.value3) + newline))))));
78678653 };
@@ -7903,13 +8689,13 @@ var PS = {};
79038689 if (declaration instanceof PureScript_CST_Types.DeclError) {
79048690 return Data_Void.absurd(declaration.value0);
79058691 };
7906− throw new Error("Failed pattern match at Format (line 303, column 65 - line 392, column 30): " + [ declaration.constructor.name ]);
8692+ throw new Error("Failed pattern match at Format (line 327, column 65 - line 416, column 30): " + [ declaration.constructor.name ]);
79078693 };
79088694 };
79098695 };
7910− var formatDeclarations = function (v) {
8696+ var formatDeclarations = function (settings) {
79118697 var formatOne = function (declaration) {
7912− return newline + formatDeclaration(v)(blank)(declaration);
8698+ return newline + formatDeclaration(settings)(blank)(declaration);
79138699 };
79148700 return Data_Foldable.foldMap(Data_Foldable.foldableArray)(Data_Monoid.monoidString)(formatOne);
79158701 };
packages/prettier-plugin-purescript/package-lock.jsonnew file+36
@@ -0,0 +1,36 @@
1+{
2+ "name": "@shape/prettier-plugin-purescript",
3+ "version": "1.0.0",
4+ "lockfileVersion": 2,
5+ "requires": true,
6+ "packages": {
7+ "": {
8+ "name": "@shape/prettier-plugin-purescript",
9+ "version": "1.0.0",
10+ "license": "BSD-3-Clause",
11+ "devDependencies": {
12+ "prettier": "^2.3.2"
13+ }
14+ },
15+ "node_modules/prettier": {
16+ "version": "2.3.2",
17+ "resolved": "https://registry.npmjs.org/prettier/-/prettier-2.3.2.tgz",
18+ "integrity": "sha512-lnJzDfJ66zkMy58OL5/NY5zp70S7Nz6KqcKkXYzn2tMVrNxvbqaBpg7H3qHaLxCJ5lNMsGuM8+ohS7cZrthdLQ==",
19+ "dev": true,
20+ "bin": {
21+ "prettier": "bin-prettier.js"
22+ },
23+ "engines": {
24+ "node": ">=10.13.0"
25+ }
26+ }
27+ },
28+ "dependencies": {
29+ "prettier": {
30+ "version": "2.3.2",
31+ "resolved": "https://registry.npmjs.org/prettier/-/prettier-2.3.2.tgz",
32+ "integrity": "sha512-lnJzDfJ66zkMy58OL5/NY5zp70S7Nz6KqcKkXYzn2tMVrNxvbqaBpg7H3qHaLxCJ5lNMsGuM8+ohS7cZrthdLQ==",
33+ "dev": true
34+ }
35+ }
36+}
packages/prettier-plugin-purescript/package.json+7−2
@@ -3,7 +3,9 @@
33 "version": "1.0.0",
44 "description": "A prettier plugin that formats PureScript code using shape",
55 "main": "index.js",
6− "files": ["index.js"],
6+ "files": [
7+ "index.js"
8+ ],
79 "directory": "packages/prettier-plugin-purescript",
810 "directories": {
911 "test": "test"
@@ -21,5 +23,8 @@
2123 "bugs": {
2224 "url": "https://github.com/i-am-the-slime/shape/issues"
2325 },
24− "homepage": "https://github.com/i-am-the-slime/shape#readme"
26+ "homepage": "https://github.com/i-am-the-slime/shape#readme",
27+ "devDependencies": {
28+ "prettier": "^2.3.2"
29+ }
2530}