on master help sign in
Fix some inconsistency in indentation
commite344f61d33360444bf6b354e268de52411dc056e authormrkkrp <mark.karpov@tweag.io> dateSun 4 Aug 2019, 16:43 (7 years ago) parent85de7ce
23 files changed+156−104
data/examples/declaration/class/poly-kinded-classes-out.hs+1−1 data/examples/declaration/class/type-operators-out.hs+2−2 data/examples/declaration/data/multiline-names-out.hs+2−2 data/examples/declaration/rewrite-rule/type-signature-out.hs+3−3 data/examples/declaration/signature/type/arguments-out.hs+5−5 data/examples/declaration/signature/type/long-multiline-applications-out.hs+4−4 data/examples/declaration/value/function/arrow/expression-forms-out.hs+2−2 data/examples/declaration/value/function/arrow/proc-do-complex-out.hs+5−5 data/examples/declaration/value/function/arrow/proc-forms-out.hs+6−6 data/examples/declaration/value/function/arrow/proc-parentheses-out.hs+3−3 data/examples/declaration/value/function/complex-list-out.hs+15 data/examples/declaration/value/function/complex-list.hs+15 data/examples/declaration/value/function/list-comprehensions-out.hs+18−18 data/examples/declaration/value/function/operator-sections-out.hs+2−2 data/examples/declaration/value/function/parallel-comprehensions-out.hs+20−20 data/examples/declaration/value/function/pattern/famous-cardano-pattern-out.hs+4−4 data/examples/declaration/value/function/pattern/multiline-case-pattern-out.hs+1−1 data/examples/declaration/value/function/transform-comprehensions-out.hs+25−25 data/examples/declaration/value/function/tricky-parens-out.hs+4 data/examples/declaration/value/function/tricky-parens.hs+4 data/examples/declaration/value/function/tuples-out.hs+7 data/examples/declaration/value/function/tuples.hs+7 src/Ormolu/Printer/Combinators.hs+1−1
data/examples/declaration/class/poly-kinded-classes-out.hs+1−1
@@ -5,5 +5,5 @@ class Foo (a :: k)
55class
66 Bar
77 ( a -- Variable
8− :: * -- Star
8+ :: * -- Star
99 )
data/examples/declaration/class/type-operators-out.hs+2−2
@@ -16,7 +16,7 @@ class
1616
1717class
1818 ( f :.
19− g
19+ g
2020 )
2121 a
2222
@@ -30,6 +30,6 @@ class (f `Product` g) a
3030
3131class
3232 ( f `Sum`
33− g
33+ g
3434 )
3535 a
data/examples/declaration/data/multiline-names-out.hs+2−2
@@ -10,7 +10,7 @@ data (f :* g) a = f a :* g a
1010
1111data
1212 ( f :+
13− g
13+ g
1414 )
1515 a
1616 = L (f a)
@@ -22,7 +22,7 @@ data (f `Product` g) a = f a `Product` g a
2222
2323data
2424 ( f `Sum`
25− g
25+ g
2626 )
2727 a
2828 = L' (f a)
data/examples/declaration/rewrite-rule/type-signature-out.hs+3−3
@@ -7,9 +7,9 @@
77 k
88 z
99 ( g
10− :: forall b. (a -> b -> b)
11− -> b
12− -> b
10+ :: forall b. (a -> b -> b)
11+ -> b
12+ -> b
1313 ).
1414 foldr k z (build g) =
1515 g k z
data/examples/declaration/signature/type/arguments-out.hs+5−5
@@ -5,11 +5,11 @@ functionName
55 => a
66 -> b
77 -> ( forall a. (C6, C7)
8− => LongDataTypeName
9− -> a
10− -> AnotherLongDataTypeName
11− -> b
12− -> c
8+ => LongDataTypeName
9+ -> a
10+ -> AnotherLongDataTypeName
11+ -> b
12+ -> c
1313 )
1414 -> (c -> d)
1515 -> (a, b, c, d)
data/examples/declaration/signature/type/long-multiline-applications-out.hs+4−4
@@ -6,10 +6,10 @@ functionName
66 AnotherLongDataTypeName
77 AnotherLongDataTypeName2
88 AnotherLongDataTypeName3
9− -> a
10− -> AnotherLongDataTypeName4
11− -> b
12− -> c
9+ -> a
10+ -> AnotherLongDataTypeName4
11+ -> b
12+ -> c
1313 )
1414 -> (c -> d)
1515 -> (a, b, c, d)
data/examples/declaration/value/function/arrow/expression-forms-out.hs+2−2
@@ -5,9 +5,9 @@ foo f g x y = (|test (f -< x) (g -< y)|)
55bar f g x y =
66 (| test
77 ( f -<
8− x
8+ x
99 )
1010 ( g -<
11− y
11+ y
1212 )
1313 |)
data/examples/declaration/value/function/arrow/proc-do-complex-out.hs+5−5
@@ -34,8 +34,8 @@ foo
3434 u ^ -- Actually never used
3535 2
3636 in ( returnA -<
37− -- Just do the calculation
38− (x + y * z)
37+ -- Just do the calculation
38+ (x + y * z)
3939 )
4040 else
4141 do
@@ -46,7 +46,7 @@ foo
4646 0 -> (g . h -< u)
4747 n ->
4848 ( ( h . g -<
49− y -- First actual use of y
49+ y -- First actual use of y
5050 )
5151 )
5252 returnA -< ()
@@ -56,6 +56,6 @@ foo
5656 else returnA -< ()
5757 returnA -<
5858 ( i +
59− x *
60− y -- Just do the calculation
59+ x *
60+ y -- Just do the calculation
6161 )
data/examples/declaration/value/function/arrow/proc-forms-out.hs+6−6
@@ -10,14 +10,14 @@ foo2 f g h x =
1010 proc (y, z) ->
1111 (| test
1212 ( h f .
13− h g -<
14− y x .
15− y z
13+ h g -<
14+ y x .
15+ y z
1616 )
1717 ( h g .
18− h f -<
19− y z .
20− y x
18+ h f -<
19+ y z .
20+ y x
2121 )
2222 |)
2323
data/examples/declaration/value/function/arrow/proc-parentheses-out.hs+3−3
@@ -7,12 +7,12 @@ bar f g = proc a ->
77 ( g
88 )
99 ) -<
10− ( ( ( ( ( ( g
11− a
10+ ( ( ( ( ( ( g
11+ a
12+ )
1213 )
1314 )
1415 )
1516 )
1617 )
17− )
1818 )
data/examples/declaration/value/function/complex-list-out.hsnew file+15
@@ -0,0 +1,15 @@
1+handleStuff =
2+ handle
3+ [ \ExceptionA ->
4+ something,
5+ \ExceptionB ->
6+ somethingElse
7+ ]
8+
9+handleStuff =
10+ handle
11+ [ foo
12+ bar,
13+ baz
14+ qux
15+ ]
data/examples/declaration/value/function/complex-list.hsnew file+15
@@ -0,0 +1,15 @@
1+handleStuff =
2+ handle
3+ [ \ExceptionA ->
4+ something
5+ , \ExceptionB ->
6+ somethingElse
7+ ]
8+
9+handleStuff =
10+ handle
11+ [ foo
12+ bar
13+ , baz
14+ qux
15+ ]
data/examples/declaration/value/function/list-comprehensions-out.hs+18−18
@@ -4,22 +4,22 @@ bar x y = [(a, b) | a <- x, even a, b <- y, a != b]
44
55barbaz x y z w =
66 [ (a, b, c, d) -- Foo
7− | a <-
8− x, -- Bar
9− b <- y, -- Baz
10− any even [a, b],
11− c <-
12− z *
13− z ^
14− 2, -- Bar baz
15− d <-
16− w +
17− w, -- Baz bar
18− all
19− even
20− [ a,
21− b,
22− c,
23− d
24− ]
7+ | a <-
8+ x, -- Bar
9+ b <- y, -- Baz
10+ any even [a, b],
11+ c <-
12+ z *
13+ z ^
14+ 2, -- Bar baz
15+ d <-
16+ w +
17+ w, -- Baz bar
18+ all
19+ even
20+ [ a,
21+ b,
22+ c,
23+ d
24+ ]
2525 ]
data/examples/declaration/value/function/operator-sections-out.hs+2−2
@@ -4,10 +4,10 @@ bar = (<> "hello")
44
55baz =
66 ( 1 * 2
7− +
7+ +
88 )
99 ( *
10− 3 ^ 5
10+ 3 ^ 5
1111 )
1212
1313quux = (,) <$> foo <$> bar
data/examples/declaration/value/function/parallel-comprehensions-out.hs+20−20
@@ -14,24 +14,24 @@ baz x y z w =
1414 i,
1515 j
1616 )
17− | a <- -- Foo 1
18− x, -- Foo 2
19− b <- -- Bar 1
20− y, -- Bar 2
21− a `mod`
22− b == -- Value
23− 0
24− | c <- -- Baz 1
25− z * -- Baz 2
26− z -- Baz 3
27− | d <- w -- Other
28− | e <- x * x -- Foo bar
29− | f <- -- Foo baz 1
30− y + y -- Foo baz 2
31− | h <- z + z * w ^ 2 -- Bar foo
32− | i <- -- Bar bar 1
33− a + -- Bar bar 2
34− b, -- Bar bar 3
35− j <- -- Bar baz 1
36− a + b -- Bar baz 2
17+ | a <- -- Foo 1
18+ x, -- Foo 2
19+ b <- -- Bar 1
20+ y, -- Bar 2
21+ a `mod`
22+ b == -- Value
23+ 0
24+ | c <- -- Baz 1
25+ z * -- Baz 2
26+ z -- Baz 3
27+ | d <- w -- Other
28+ | e <- x * x -- Foo bar
29+ | f <- -- Foo baz 1
30+ y + y -- Foo baz 2
31+ | h <- z + z * w ^ 2 -- Bar foo
32+ | i <- -- Bar bar 1
33+ a + -- Bar bar 2
34+ b, -- Bar bar 3
35+ j <- -- Bar baz 1
36+ a + b -- Bar baz 2
3737 ]
data/examples/declaration/value/function/pattern/famous-cardano-pattern-out.hs+4−4
@@ -1,8 +1,8 @@
11( getNodeSettingsR :<|>
2− getNodeInfoR :<|>
3− getNextUpdateR :<|>
4− restartNodeR
2+ getNodeInfoR :<|>
3+ getNextUpdateR :<|>
4+ restartNodeR
55 ) :<|>
66 ( getUtxoR :<|>
7− getConfirmedProposalsR
7+ getConfirmedProposalsR
88 ) = client nodeV1Api
data/examples/declaration/value/function/pattern/multiline-case-pattern-out.hs+1−1
@@ -11,5 +11,5 @@ f xs = case xs of
1111
1212g xs = case xs of
1313 ( a :
14− bs
14+ bs
1515 ) -> a + b
data/examples/declaration/value/function/transform-comprehensions-out.hs+25−25
@@ -6,10 +6,10 @@ foo' xs ys =
66 [ ( x,
77 y
88 )
9− | x <- xs,
10− y <- ys,
11− -- First comment
12− then reverse -- Second comment
9+ | x <- xs,
10+ y <- ys,
11+ -- First comment
12+ then reverse -- Second comment
1313 ]
1414
1515bar xs ys = [(x, y) | x <- xs, y <- ys, then sortWith by (x + y)]
@@ -18,14 +18,14 @@ bar' xs ys =
1818 [ ( x,
1919 y
2020 )
21− | x <- xs,
22− y <- ys,
23− -- First comment
24− then sortWith
25− by
26− ( x +
27− y -- Second comment
28− )
21+ | x <- xs,
22+ y <- ys,
23+ -- First comment
24+ then sortWith
25+ by
26+ ( x +
27+ y -- Second comment
28+ )
2929 ]
3030
3131baz xs ys = [(x, y) | x <- xs, y <- ys, then group using permutations]
@@ -34,10 +34,10 @@ baz' xs ys =
3434 [ ( x,
3535 y
3636 )
37− | x <- xs,
38− y <- ys,
39− -- First comment
40− then group using permutations -- Second comment
37+ | x <- xs,
38+ y <- ys,
39+ -- First comment
40+ then group using permutations -- Second comment
4141 ]
4242
4343quux xs ys = [(x, y) | x <- xs, y <- ys, then group by (x + y) using groupWith]
@@ -46,13 +46,13 @@ quux' xs ys =
4646 [ ( x,
4747 y
4848 )
49− | x <- xs,
50− y <- ys,
51− -- First comment
52− then group by
53− ( x +
54− y
55− )
56− -- Second comment
57− using groupWith -- Third comment
49+ | x <- xs,
50+ y <- ys,
51+ -- First comment
52+ then group by
53+ ( x +
54+ y
55+ )
56+ -- Second comment
57+ using groupWith -- Third comment
5858 ]
data/examples/declaration/value/function/tricky-parens-out.hsnew file+4
@@ -0,0 +1,4 @@
1+handleStuff =
2+ ( let foo = foo
3+ in foo
4+ )
data/examples/declaration/value/function/tricky-parens.hsnew file+4
@@ -0,0 +1,4 @@
1+handleStuff =
2+ ( let foo = foo
3+ in foo
4+ )
data/examples/declaration/value/function/tuples-out.hs+7
@@ -5,3 +5,10 @@ bar =
55 2,
66 3
77 )
8+
9+handleStuff =
10+ ( let foo = foo
11+ in foo,
12+ let bar = bar
13+ in bar
14+ )
data/examples/declaration/value/function/tuples.hs+7
@@ -4,3 +4,10 @@ bar = (
44 2,
55 3
66 )
7+
8+handleStuff =
9+ ( let foo = foo
10+ in foo
11+ , let bar = bar
12+ in bar
13+ )
src/Ormolu/Printer/Combinators.hs+1−1
@@ -254,7 +254,7 @@ pragma pragmaText body = pragmaBraces $ do
254254ospaces :: R () -> R ()
255255ospaces m = vlayout m $ do
256256 space
257− m
257+ sitcc m
258258 newline
259259 txt " "
260260