on master help sign in
Fix some inconsistency in indentation
e344f61mrkkrp
data/examples/declaration/class/poly-kinded-classes-out.hs+1−1
@@ -5,5 +5,5 @@ class Foo (a :: k)
5class
5class
6 Bar
6 Bar
7 ( a -- Variable
7 ( a -- Variable
8− :: * -- Star
8+ :: * -- Star
9 )
9 )
data/examples/declaration/class/type-operators-out.hs+2−2
@@ -16,7 +16,7 @@ class
16
16
17class
17class
18 ( f :.
18 ( f :.
19− g
19+ g
20 )
20 )
21 a
21 a
22
22
@@ -30,6 +30,6 @@ class (f `Product` g) a
30
30
31class
31class
32 ( f `Sum`
32 ( f `Sum`
33− g
33+ g
34 )
34 )
35 a
35 a
data/examples/declaration/data/multiline-names-out.hs+2−2
@@ -10,7 +10,7 @@ data (f :* g) a = f a :* g a
10
10
11data
11data
12 ( f :+
12 ( f :+
13− g
13+ g
14 )
14 )
15 a
15 a
16 = L (f a)
16 = L (f a)
@@ -22,7 +22,7 @@ data (f `Product` g) a = f a `Product` g a
22
22
23data
23data
24 ( f `Sum`
24 ( f `Sum`
25− g
25+ g
26 )
26 )
27 a
27 a
28 = L' (f a)
28 = L' (f a)
data/examples/declaration/rewrite-rule/type-signature-out.hs+3−3
@@ -7,9 +7,9 @@
7 k
7 k
8 z
8 z
9 ( g
9 ( g
10− :: forall b. (a -> b -> b)
10+ :: forall b. (a -> b -> b)
11− -> b
11+ -> b
12− -> b
12+ -> b
13 ).
13 ).
14 foldr k z (build g) =
14 foldr k z (build g) =
15 g k z
15 g k z
data/examples/declaration/signature/type/arguments-out.hs+5−5
@@ -5,11 +5,11 @@ functionName
5 => a
5 => a
6 -> b
6 -> b
7 -> ( forall a. (C6, C7)
7 -> ( forall a. (C6, C7)
8− => LongDataTypeName
8+ => LongDataTypeName
9− -> a
9+ -> a
10− -> AnotherLongDataTypeName
10+ -> AnotherLongDataTypeName
11− -> b
11+ -> b
12− -> c
12+ -> c
13 )
13 )
14 -> (c -> d)
14 -> (c -> d)
15 -> (a, b, c, d)
15 -> (a, b, c, d)
data/examples/declaration/signature/type/long-multiline-applications-out.hs+4−4
@@ -6,10 +6,10 @@ functionName
6 AnotherLongDataTypeName
6 AnotherLongDataTypeName
7 AnotherLongDataTypeName2
7 AnotherLongDataTypeName2
8 AnotherLongDataTypeName3
8 AnotherLongDataTypeName3
9− -> a
9+ -> a
10− -> AnotherLongDataTypeName4
10+ -> AnotherLongDataTypeName4
11− -> b
11+ -> b
12− -> c
12+ -> c
13 )
13 )
14 -> (c -> d)
14 -> (c -> d)
15 -> (a, b, c, d)
15 -> (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)|)
5bar f g x y =
5bar f g x y =
6 (| test
6 (| test
7 ( f -<
7 ( f -<
8− x
8+ x
9 )
9 )
10 ( g -<
10 ( g -<
11− y
11+ y
12 )
12 )
13 |)
13 |)
data/examples/declaration/value/function/arrow/proc-do-complex-out.hs+5−5
@@ -34,8 +34,8 @@ foo
34 u ^ -- Actually never used
34 u ^ -- Actually never used
35 2
35 2
36 in ( returnA -<
36 in ( returnA -<
37− -- Just do the calculation
37+ -- Just do the calculation
38− (x + y * z)
38+ (x + y * z)
39 )
39 )
40 else
40 else
41 do
41 do
@@ -46,7 +46,7 @@ foo
46 0 -> (g . h -< u)
46 0 -> (g . h -< u)
47 n ->
47 n ->
48 ( ( h . g -<
48 ( ( h . g -<
49− y -- First actual use of y
49+ y -- First actual use of y
50 )
50 )
51 )
51 )
52 returnA -< ()
52 returnA -< ()
@@ -56,6 +56,6 @@ foo
56 else returnA -< ()
56 else returnA -< ()
57 returnA -<
57 returnA -<
58 ( i +
58 ( i +
59− x *
59+ x *
60− y -- Just do the calculation
60+ y -- Just do the calculation
61 )
61 )
data/examples/declaration/value/function/arrow/proc-forms-out.hs+6−6
@@ -10,14 +10,14 @@ foo2 f g h x =
10 proc (y, z) ->
10 proc (y, z) ->
11 (| test
11 (| test
12 ( h f .
12 ( h f .
13− h g -<
13+ h g -<
14− y x .
14+ y x .
15− y z
15+ y z
16 )
16 )
17 ( h g .
17 ( h g .
18− h f -<
18+ h f -<
19− y z .
19+ y z .
20− y x
20+ y x
21 )
21 )
22 |)
22 |)
23
23
data/examples/declaration/value/function/arrow/proc-parentheses-out.hs+3−3
@@ -7,12 +7,12 @@ bar f g = proc a ->
7 ( g
7 ( g
8 )
8 )
9 ) -<
9 ) -<
10− ( ( ( ( ( ( g
10+ ( ( ( ( ( ( g
11− a
11+ a
12+ )
12 )
13 )
13 )
14 )
14 )
15 )
15 )
16 )
16 )
17 )
17− )
18 )
18 )
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]
4
4
5barbaz x y z w =
5barbaz x y z w =
6 [ (a, b, c, d) -- Foo
6 [ (a, b, c, d) -- Foo
7− | a <-
7+ | a <-
8− x, -- Bar
8+ x, -- Bar
9− b <- y, -- Baz
9+ b <- y, -- Baz
10− any even [a, b],
10+ any even [a, b],
11− c <-
11+ c <-
12− z *
12+ z *
13− z ^
13+ z ^
14− 2, -- Bar baz
14+ 2, -- Bar baz
15− d <-
15+ d <-
16− w +
16+ w +
17− w, -- Baz bar
17+ w, -- Baz bar
18− all
18+ all
19− even
19+ even
20− [ a,
20+ [ a,
21− b,
21+ b,
22− c,
22+ c,
23− d
23+ d
24− ]
24+ ]
25 ]
25 ]
data/examples/declaration/value/function/operator-sections-out.hs+2−2
@@ -4,10 +4,10 @@ bar = (<> "hello")
4
4
5baz =
5baz =
6 ( 1 * 2
6 ( 1 * 2
7− +
7+ +
8 )
8 )
9 ( *
9 ( *
10− 3 ^ 5
10+ 3 ^ 5
11 )
11 )
12
12
13quux = (,) <$> foo <$> bar
13quux = (,) <$> foo <$> bar
data/examples/declaration/value/function/parallel-comprehensions-out.hs+20−20
@@ -14,24 +14,24 @@ baz x y z w =
14 i,
14 i,
15 j
15 j
16 )
16 )
17− | a <- -- Foo 1
17+ | a <- -- Foo 1
18− x, -- Foo 2
18+ x, -- Foo 2
19− b <- -- Bar 1
19+ b <- -- Bar 1
20− y, -- Bar 2
20+ y, -- Bar 2
21− a `mod`
21+ a `mod`
22− b == -- Value
22+ b == -- Value
23− 0
23+ 0
24− | c <- -- Baz 1
24+ | c <- -- Baz 1
25− z * -- Baz 2
25+ z * -- Baz 2
26− z -- Baz 3
26+ z -- Baz 3
27− | d <- w -- Other
27+ | d <- w -- Other
28− | e <- x * x -- Foo bar
28+ | e <- x * x -- Foo bar
29− | f <- -- Foo baz 1
29+ | f <- -- Foo baz 1
30− y + y -- Foo baz 2
30+ y + y -- Foo baz 2
31− | h <- z + z * w ^ 2 -- Bar foo
31+ | h <- z + z * w ^ 2 -- Bar foo
32− | i <- -- Bar bar 1
32+ | i <- -- Bar bar 1
33− a + -- Bar bar 2
33+ a + -- Bar bar 2
34− b, -- Bar bar 3
34+ b, -- Bar bar 3
35− j <- -- Bar baz 1
35+ j <- -- Bar baz 1
36− a + b -- Bar baz 2
36+ a + b -- Bar baz 2
37 ]
37 ]
data/examples/declaration/value/function/pattern/famous-cardano-pattern-out.hs+4−4
@@ -1,8 +1,8 @@
1( getNodeSettingsR :<|>
1( getNodeSettingsR :<|>
2− getNodeInfoR :<|>
2+ getNodeInfoR :<|>
3− getNextUpdateR :<|>
3+ getNextUpdateR :<|>
4− restartNodeR
4+ restartNodeR
5 ) :<|>
5 ) :<|>
6 ( getUtxoR :<|>
6 ( getUtxoR :<|>
7− getConfirmedProposalsR
7+ getConfirmedProposalsR
8 ) = client nodeV1Api
8 ) = client nodeV1Api
data/examples/declaration/value/function/pattern/multiline-case-pattern-out.hs+1−1
@@ -11,5 +11,5 @@ f xs = case xs of
11
11
12g xs = case xs of
12g xs = case xs of
13 ( a :
13 ( a :
14− bs
14+ bs
15 ) -> a + b
15 ) -> a + b
data/examples/declaration/value/function/transform-comprehensions-out.hs+25−25
@@ -6,10 +6,10 @@ foo' xs ys =
6 [ ( x,
6 [ ( x,
7 y
7 y
8 )
8 )
9− | x <- xs,
9+ | x <- xs,
10− y <- ys,
10+ y <- ys,
11− -- First comment
11+ -- First comment
12− then reverse -- Second comment
12+ then reverse -- Second comment
13 ]
13 ]
14
14
15bar xs ys = [(x, y) | x <- xs, y <- ys, then sortWith by (x + y)]
15bar xs ys = [(x, y) | x <- xs, y <- ys, then sortWith by (x + y)]
@@ -18,14 +18,14 @@ bar' xs ys =
18 [ ( x,
18 [ ( x,
19 y
19 y
20 )
20 )
21− | x <- xs,
21+ | x <- xs,
22− y <- ys,
22+ y <- ys,
23− -- First comment
23+ -- First comment
24− then sortWith
24+ then sortWith
25− by
25+ by
26− ( x +
26+ ( x +
27− y -- Second comment
27+ y -- Second comment
28− )
28+ )
29 ]
29 ]
30
30
31baz xs ys = [(x, y) | x <- xs, y <- ys, then group using permutations]
31baz xs ys = [(x, y) | x <- xs, y <- ys, then group using permutations]
@@ -34,10 +34,10 @@ baz' xs ys =
34 [ ( x,
34 [ ( x,
35 y
35 y
36 )
36 )
37− | x <- xs,
37+ | x <- xs,
38− y <- ys,
38+ y <- ys,
39− -- First comment
39+ -- First comment
40− then group using permutations -- Second comment
40+ then group using permutations -- Second comment
41 ]
41 ]
42
42
43quux xs ys = [(x, y) | x <- xs, y <- ys, then group by (x + y) using groupWith]
43quux xs ys = [(x, y) | x <- xs, y <- ys, then group by (x + y) using groupWith]
@@ -46,13 +46,13 @@ quux' xs ys =
46 [ ( x,
46 [ ( x,
47 y
47 y
48 )
48 )
49− | x <- xs,
49+ | x <- xs,
50− y <- ys,
50+ y <- ys,
51− -- First comment
51+ -- First comment
52− then group by
52+ then group by
53− ( x +
53+ ( x +
54− y
54+ y
55− )
55+ )
56− -- Second comment
56+ -- Second comment
57− using groupWith -- Third comment
57+ using groupWith -- Third comment
58 ]
58 ]
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 =
5 2,
5 2,
6 3
6 3
7 )
7 )
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 = (
4 2,
4 2,
5 3
5 3
6 )
6 )
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
254ospaces :: R () -> R ()
254ospaces :: R () -> R ()
255ospaces m = vlayout m $ do
255ospaces m = vlayout m $ do
256 space
256 space
257− m
257+ sitcc m
258 newline
258 newline
259 txt " "
259 txt " "
260
260