From b4794deb769f3ff907faa03899dfeeef1d170c0c Mon Sep 17 00:00:00 2001 From: Hiroki Tokunaga Date: Wed, 7 Dec 2022 08:42:19 +0900 Subject: [PATCH 01/10] Create the "Operators" section --- TESTS.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/TESTS.md b/TESTS.md index 8edb0ee74..baae65b1b 100644 --- a/TESTS.md +++ b/TESTS.md @@ -777,6 +777,9 @@ fun xs ys = ] ``` +### Operators + + ### Records Short From 6a5f88409ff705eb246fc959dded42a4743478bb Mon Sep 17 00:00:00 2001 From: Hiroki Tokunaga Date: Wed, 7 Dec 2022 08:43:06 +0900 Subject: [PATCH 02/10] Move a test --- TESTS.md | 19 +++++++++---------- 1 file changed, 9 insertions(+), 10 deletions(-) diff --git a/TESTS.md b/TESTS.md index baae65b1b..7a5153277 100644 --- a/TESTS.md +++ b/TESTS.md @@ -545,16 +545,6 @@ strToMonth month = _ -> error $ "Unknown month " ++ month ``` -Operators, bad - -``` haskell -x = - Value <$> thing <*> secondThing <*> thirdThing <*> fourthThing <*> - Just thisissolong <*> - Just stilllonger <*> - evenlonger -``` - Operators, good ```haskell pending @@ -779,6 +769,15 @@ fun xs ys = ### Operators +Bad + +```haskell +x = + Value <$> thing <*> secondThing <*> thirdThing <*> fourthThing <*> + Just thisissolong <*> + Just stilllonger <*> + evenlonger +``` ### Records From fdd9e483d4d490768074c18e4a318295717e4479 Mon Sep 17 00:00:00 2001 From: Hiroki Tokunaga Date: Wed, 7 Dec 2022 08:43:20 +0900 Subject: [PATCH 03/10] Move a test --- TESTS.md | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/TESTS.md b/TESTS.md index 7a5153277..7be02e92a 100644 --- a/TESTS.md +++ b/TESTS.md @@ -545,14 +545,6 @@ strToMonth month = _ -> error $ "Unknown month " ++ month ``` -Operators, good - -```haskell pending -x = - Value <$> thing <*> secondThing <*> thirdThing <*> fourthThing <*> - Just thisissolong <*> Just stilllonger <*> evenlonger -``` - Operator with `do` ```haskell @@ -779,6 +771,14 @@ x = evenlonger ``` +Good + +```haskell pending +x = + Value <$> thing <*> secondThing <*> thirdThing <*> fourthThing <*> + Just thisissolong <*> Just stilllonger <*> evenlonger +``` + ### Records Short From 01174488d82cecaf2e621960920f6c7880323755 Mon Sep 17 00:00:00 2001 From: Hiroki Tokunaga Date: Wed, 7 Dec 2022 08:43:43 +0900 Subject: [PATCH 04/10] Move a test --- TESTS.md | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/TESTS.md b/TESTS.md index 7be02e92a..1ecfceef6 100644 --- a/TESTS.md +++ b/TESTS.md @@ -545,14 +545,6 @@ strToMonth month = _ -> error $ "Unknown month " ++ month ``` -Operator with `do` - -```haskell -for xs $ do - left x - right x -``` - Operator with lambda-case ```haskell @@ -779,6 +771,14 @@ x = Just thisissolong <*> Just stilllonger <*> evenlonger ``` +With `do` + +```haskell +for xs $ do + left x + right x +``` + ### Records Short From 9ee347f4387b89b6d1061c188ac674f7143f2162 Mon Sep 17 00:00:00 2001 From: Hiroki Tokunaga Date: Wed, 7 Dec 2022 08:43:56 +0900 Subject: [PATCH 05/10] Move a test --- TESTS.md | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/TESTS.md b/TESTS.md index 1ecfceef6..8f3648393 100644 --- a/TESTS.md +++ b/TESTS.md @@ -545,13 +545,6 @@ strToMonth month = _ -> error $ "Unknown month " ++ month ``` -Operator with lambda-case - -```haskell -for xs $ \case - Left x -> x -``` - Operator in parentheses ```haskell @@ -779,6 +772,13 @@ for xs $ do right x ``` +With lambda-case + +```haskell +for xs $ \case + Left x -> x +``` + ### Records Short From c7ab499fc81f9baa242b89aff903908e90314769 Mon Sep 17 00:00:00 2001 From: Hiroki Tokunaga Date: Wed, 7 Dec 2022 08:44:10 +0900 Subject: [PATCH 06/10] Move a test --- TESTS.md | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/TESTS.md b/TESTS.md index 8f3648393..b6d8ed49a 100644 --- a/TESTS.md +++ b/TESTS.md @@ -545,12 +545,6 @@ strToMonth month = _ -> error $ "Unknown month " ++ month ``` -Operator in parentheses - -```haskell -cat = (++) -``` - Symbol data constructor in parentheses ```haskell @@ -779,6 +773,12 @@ for xs $ \case Left x -> x ``` +In parentheses + +```haskell +cat = (++) +``` + ### Records Short From 28f0703f0e6d5a602294b0fffe98d624df07a2cf Mon Sep 17 00:00:00 2001 From: Hiroki Tokunaga Date: Wed, 7 Dec 2022 09:33:16 +0900 Subject: [PATCH 07/10] Move a test --- TESTS.md | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/TESTS.md b/TESTS.md index b6d8ed49a..fe06bbad2 100644 --- a/TESTS.md +++ b/TESTS.md @@ -779,6 +779,16 @@ In parentheses cat = (++) ``` +A data constructor enclosed by parentheses + +```haskell +-- https://github.com/mihaimaruseac/hindent/issues/422 +data T a = + a :@ a + +test = (:@) +``` + ### Records Short @@ -1765,16 +1775,6 @@ a @: b = a + b main = print (2 @: 2) ``` -andersk Corrupts parenthesized type operators #422 - -```haskell --- https://github.com/commercialhaskell/hindent/issues/422 -data T a = - a :@ a - -test = (:@) -``` - NorfairKing Infix constructor pattern is broken #424 ```haskell From 818069a7d22ac46bc5a9e9a3931407e2e38243bf Mon Sep 17 00:00:00 2001 From: Hiroki Tokunaga Date: Wed, 7 Dec 2022 09:36:17 +0900 Subject: [PATCH 08/10] Move a test --- TESTS.md | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/TESTS.md b/TESTS.md index fe06bbad2..b5a61d0af 100644 --- a/TESTS.md +++ b/TESTS.md @@ -779,6 +779,15 @@ In parentheses cat = (++) ``` +`@` can be used to construct an operator unless `TypeApplications` is enabled. + +```haskell +-- https://github.com/mihaimaruseac/hindent/issues/421 +a @: b = a + b + +main = print (2 @: 2) +``` + A data constructor enclosed by parentheses ```haskell @@ -1766,15 +1775,6 @@ TimoFreiberg INLINE (and other) pragmas for operators are reformatted without pa {-# NOINLINE (<>) #-} ``` -andersk Cannot parse @: operator #421 - -```haskell --- https://github.com/commercialhaskell/hindent/issues/421 -a @: b = a + b - -main = print (2 @: 2) -``` - NorfairKing Infix constructor pattern is broken #424 ```haskell From 957019e99b6256a7416d39422a2a1def13ca71e7 Mon Sep 17 00:00:00 2001 From: Hiroki Tokunaga Date: Wed, 7 Dec 2022 09:43:39 +0900 Subject: [PATCH 09/10] Improve a test's name --- TESTS.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/TESTS.md b/TESTS.md index b5a61d0af..fec7e056c 100644 --- a/TESTS.md +++ b/TESTS.md @@ -779,7 +779,7 @@ In parentheses cat = (++) ``` -`@` can be used to construct an operator unless `TypeApplications` is enabled. +The first character of an operator can be `@` unless `TypeApplications` is enabled. ```haskell -- https://github.com/mihaimaruseac/hindent/issues/421 From 92db9224d8f13d19c15c5e8b203e3f20501eaeb8 Mon Sep 17 00:00:00 2001 From: Hiroki Tokunaga Date: Wed, 7 Dec 2022 09:43:58 +0900 Subject: [PATCH 10/10] Fix a name --- TESTS.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/TESTS.md b/TESTS.md index fec7e056c..cda7b5cde 100644 --- a/TESTS.md +++ b/TESTS.md @@ -779,7 +779,7 @@ In parentheses cat = (++) ``` -The first character of an operator can be `@` unless `TypeApplications` is enabled. +The first character of an infix operator can be `@` unless `TypeApplications` is enabled. ```haskell -- https://github.com/mihaimaruseac/hindent/issues/421