Compare commits
99 Commits
Author | SHA1 | Date |
---|---|---|
|
8ad1f0fa2e | |
|
2fd6308d09 | |
|
812957dca4 | |
|
7d84705e7a | |
|
15fc8ec332 | |
|
28e3ec18a3 | |
|
dbc4266f18 | |
|
d5f1deaa3d | |
|
b6da307ecc | |
|
d3d3b90558 | |
|
9737cb3adc | |
|
9d14407191 | |
|
628ab81bc9 | |
|
a6e187e962 | |
|
278e0275f2 | |
|
7bbbea728d | |
|
49a2529a5b | |
|
4ed3a2f53d | |
|
03e578f72c | |
|
b3f8317e99 | |
|
54043ca9ba | |
|
10dc48b74d | |
|
48522b596c | |
|
5e5433f33a | |
|
5481e5015f | |
|
8706b55139 | |
|
a5f2178d87 | |
|
d4f49f9ced | |
|
8f69d5e816 | |
|
6721a44359 | |
|
adc74d8bb1 | |
|
b874175986 | |
|
3b431cdad2 | |
|
5ee0733f96 | |
|
a90550f62d | |
|
91a8c23989 | |
|
a9091daeb9 | |
|
9c5a490938 | |
|
e38836fdab | |
|
860c8771ae | |
|
47bcdb045b | |
|
6008cb26ac | |
|
7e56701bc2 | |
|
94fcf56b28 | |
|
b057c49727 | |
|
7bf2879ac0 | |
|
e7cdff440d | |
|
91300f5316 | |
|
687b59c62f | |
|
2b77142617 | |
|
84e703d7f3 | |
|
fe876ea0b0 | |
|
884c7da97c | |
|
ab67a794db | |
|
b6001e9ecc | |
|
52bde7910f | |
|
e11188eb16 | |
|
556bc896a6 | |
|
d2a48ba559 | |
|
7ab6a207ae | |
|
99e5aacb5e | |
|
52e4658314 | |
|
56e7d6b5b9 | |
|
156b5cf407 | |
|
d29303d4cd | |
|
5563cd4d93 | |
|
09ec59eaf9 | |
|
b24379d104 | |
|
2fef44559e | |
|
ebe85a5949 | |
|
736c2a8d46 | |
|
0a76fe952c | |
|
dc4e59f2a1 | |
|
412c5460aa | |
|
dd4367c6e8 | |
|
676695a609 | |
|
75d17b961c | |
|
f13a82964a | |
|
05270ecb45 | |
|
7c329d391b | |
|
5bee3fa93d | |
|
83b13d61a0 | |
|
3121ccacfe | |
|
d9373ec80e | |
|
72c9e4c3ab | |
|
b116529005 | |
|
ee2814e3a8 | |
|
7d3490b80a | |
|
847e01cc30 | |
|
d11141d34d | |
|
dedeab61e2 | |
|
84669034b5 | |
|
7f4730858e | |
|
bff9bfb312 | |
|
4e397441b9 | |
|
d4896d2234 | |
|
eabf4e9d45 | |
|
5806dfc208 | |
|
dc008800e7 |
|
@ -13,3 +13,6 @@ cabal.project.local*
|
||||||
cabal.project.freeze
|
cabal.project.freeze
|
||||||
.ghc.environment.*
|
.ghc.environment.*
|
||||||
result
|
result
|
||||||
|
/nix/seaaye-cache
|
||||||
|
/nix/gcroots
|
||||||
|
/nix/ci-out
|
||||||
|
|
105
brittany.cabal
105
brittany.cabal
|
@ -1,7 +1,7 @@
|
||||||
cabal-version: 2.2
|
cabal-version: 2.2
|
||||||
|
|
||||||
name: brittany
|
name: brittany
|
||||||
version: 0.14.0.2
|
version: 92.1.0.0
|
||||||
synopsis: Haskell source code formatter
|
synopsis: Haskell source code formatter
|
||||||
description:
|
description:
|
||||||
See <https://github.com/lspitzner/brittany/blob/master/README.md the README>.
|
See <https://github.com/lspitzner/brittany/blob/master/README.md the README>.
|
||||||
|
@ -24,8 +24,7 @@ extra-doc-files:
|
||||||
README.md
|
README.md
|
||||||
doc/implementation/*.md
|
doc/implementation/*.md
|
||||||
extra-source-files:
|
extra-source-files:
|
||||||
data/brittany.yaml
|
data/*.blt
|
||||||
data/*.hs
|
|
||||||
|
|
||||||
source-repository head
|
source-repository head
|
||||||
type: git
|
type: git
|
||||||
|
@ -39,9 +38,9 @@ flag pedantic
|
||||||
common library
|
common library
|
||||||
build-depends:
|
build-depends:
|
||||||
, aeson ^>= 2.0.1
|
, aeson ^>= 2.0.1
|
||||||
, base ^>= 4.15.0
|
, base >= 4.15.0 && < 4.17
|
||||||
, butcher ^>= 1.3.3
|
, butcher ^>= 2.0.0
|
||||||
, bytestring ^>= 0.10.12
|
, bytestring >= 0.10.12 && < 0.12
|
||||||
, cmdargs ^>= 0.10.21
|
, cmdargs ^>= 0.10.21
|
||||||
, containers ^>= 0.6.4
|
, containers ^>= 0.6.4
|
||||||
, czipwith ^>= 1.0.1
|
, czipwith ^>= 1.0.1
|
||||||
|
@ -50,17 +49,17 @@ common library
|
||||||
, directory ^>= 1.3.6
|
, directory ^>= 1.3.6
|
||||||
, extra ^>= 1.7.10
|
, extra ^>= 1.7.10
|
||||||
, filepath ^>= 1.4.2
|
, filepath ^>= 1.4.2
|
||||||
, ghc ^>= 9.0.1
|
, ghc >= 9.0.1 && < 9.3
|
||||||
, ghc-boot ^>= 9.0.1
|
, ghc-boot >= 9.0.1 && < 9.3
|
||||||
, ghc-boot-th ^>= 9.0.1
|
, ghc-boot-th >= 9.0.1 && < 9.3
|
||||||
, ghc-exactprint ^>= 0.6.4
|
, ghc-exactprint >= 0.6.4 && < 1.6
|
||||||
, monad-memo ^>= 0.5.3
|
, monad-memo ^>= 0.5.3
|
||||||
, mtl ^>= 2.2.2
|
, mtl ^>= 2.2.2
|
||||||
, multistate ^>= 0.8.0
|
, multistate ^>= 0.8.0
|
||||||
, pretty ^>= 1.1.3
|
, pretty ^>= 1.1.3
|
||||||
, random ^>= 1.2.1
|
, random ^>= 1.2.1
|
||||||
, safe ^>= 0.3.19
|
, safe ^>= 0.3.19
|
||||||
, semigroups ^>= 0.19.2
|
, semigroups >= 0.19.2 && < 0.21
|
||||||
, strict ^>= 0.4.0
|
, strict ^>= 0.4.0
|
||||||
, syb ^>= 0.7.2
|
, syb ^>= 0.7.2
|
||||||
, text ^>= 1.2.5
|
, text ^>= 1.2.5
|
||||||
|
@ -71,7 +70,6 @@ common library
|
||||||
ghc-options:
|
ghc-options:
|
||||||
-Weverything
|
-Weverything
|
||||||
-Wno-all-missed-specialisations
|
-Wno-all-missed-specialisations
|
||||||
-Wno-incomplete-uni-patterns
|
|
||||||
-Wno-missing-deriving-strategies
|
-Wno-missing-deriving-strategies
|
||||||
-Wno-missing-export-lists
|
-Wno-missing-export-lists
|
||||||
-Wno-missing-import-lists
|
-Wno-missing-import-lists
|
||||||
|
@ -81,10 +79,28 @@ common library
|
||||||
-Wno-prepositive-qualified-module
|
-Wno-prepositive-qualified-module
|
||||||
-Wno-safe
|
-Wno-safe
|
||||||
-Wno-unsafe
|
-Wno-unsafe
|
||||||
|
-Wno-missing-kind-signatures
|
||||||
|
-Wunused-imports
|
||||||
|
-fhide-source-paths
|
||||||
|
|
||||||
if flag(pedantic)
|
if flag(pedantic)
|
||||||
ghc-options: -Werror
|
ghc-options: -Werror
|
||||||
|
|
||||||
|
default-extensions: {
|
||||||
|
FlexibleContexts
|
||||||
|
FlexibleInstances
|
||||||
|
ScopedTypeVariables
|
||||||
|
MonadComprehensions
|
||||||
|
LambdaCase
|
||||||
|
MultiWayIf
|
||||||
|
KindSignatures
|
||||||
|
MultiParamTypeClasses
|
||||||
|
TypeApplications
|
||||||
|
RankNTypes
|
||||||
|
GADTs
|
||||||
|
BangPatterns
|
||||||
|
}
|
||||||
|
|
||||||
common executable
|
common executable
|
||||||
import: library
|
import: library
|
||||||
|
|
||||||
|
@ -94,6 +110,7 @@ common executable
|
||||||
-threaded
|
-threaded
|
||||||
-Wno-implicit-prelude
|
-Wno-implicit-prelude
|
||||||
-Wno-unused-packages
|
-Wno-unused-packages
|
||||||
|
-fhide-source-paths
|
||||||
|
|
||||||
library
|
library
|
||||||
import: library
|
import: library
|
||||||
|
@ -101,36 +118,46 @@ library
|
||||||
autogen-modules: Paths_brittany
|
autogen-modules: Paths_brittany
|
||||||
hs-source-dirs: source/library
|
hs-source-dirs: source/library
|
||||||
exposed-modules:
|
exposed-modules:
|
||||||
|
Language.Haskell.Brittany.Main
|
||||||
Language.Haskell.Brittany
|
Language.Haskell.Brittany
|
||||||
Language.Haskell.Brittany.Internal
|
Language.Haskell.Brittany.Internal
|
||||||
Language.Haskell.Brittany.Internal.Backend
|
Language.Haskell.Brittany.Internal.Config.Config
|
||||||
Language.Haskell.Brittany.Internal.BackendUtils
|
Language.Haskell.Brittany.Internal.Config.InlineParsing
|
||||||
Language.Haskell.Brittany.Internal.Config
|
|
||||||
Language.Haskell.Brittany.Internal.Config.Types
|
Language.Haskell.Brittany.Internal.Config.Types
|
||||||
Language.Haskell.Brittany.Internal.Config.Types.Instances
|
Language.Haskell.Brittany.Internal.Config.Types.Instances1
|
||||||
Language.Haskell.Brittany.Internal.ExactPrintUtils
|
Language.Haskell.Brittany.Internal.Config.Types.Instances2
|
||||||
Language.Haskell.Brittany.Internal.LayouterBasics
|
Language.Haskell.Brittany.Internal.ParseExact
|
||||||
Language.Haskell.Brittany.Internal.Layouters.DataDecl
|
Language.Haskell.Brittany.Internal.SplitExactModule
|
||||||
Language.Haskell.Brittany.Internal.Layouters.Decl
|
Language.Haskell.Brittany.Internal.ToBriDoc.Comment
|
||||||
Language.Haskell.Brittany.Internal.Layouters.Expr
|
Language.Haskell.Brittany.Internal.ToBriDoc.DataDecl
|
||||||
Language.Haskell.Brittany.Internal.Layouters.IE
|
Language.Haskell.Brittany.Internal.ToBriDoc.Decl
|
||||||
Language.Haskell.Brittany.Internal.Layouters.Import
|
Language.Haskell.Brittany.Internal.ToBriDoc.Expr
|
||||||
Language.Haskell.Brittany.Internal.Layouters.Module
|
Language.Haskell.Brittany.Internal.ToBriDoc.OpTree
|
||||||
Language.Haskell.Brittany.Internal.Layouters.Pattern
|
Language.Haskell.Brittany.Internal.ToBriDoc.IE
|
||||||
Language.Haskell.Brittany.Internal.Layouters.Stmt
|
Language.Haskell.Brittany.Internal.ToBriDoc.Import
|
||||||
Language.Haskell.Brittany.Internal.Layouters.Type
|
Language.Haskell.Brittany.Internal.ToBriDoc.Module
|
||||||
Language.Haskell.Brittany.Internal.Obfuscation
|
Language.Haskell.Brittany.Internal.ToBriDoc.Pattern
|
||||||
Language.Haskell.Brittany.Internal.ParseModule
|
Language.Haskell.Brittany.Internal.ToBriDoc.Stmt
|
||||||
|
Language.Haskell.Brittany.Internal.ToBriDoc.Type
|
||||||
|
Language.Haskell.Brittany.Internal.ToBriDoc
|
||||||
|
Language.Haskell.Brittany.Internal.Components.BriDoc
|
||||||
|
Language.Haskell.Brittany.Internal.Components.Obfuscation
|
||||||
|
Language.Haskell.Brittany.Internal.Components.OpTree
|
||||||
|
Language.Haskell.Brittany.Internal.ToBriDocTools
|
||||||
|
Language.Haskell.Brittany.Internal.WriteBriDoc
|
||||||
|
Language.Haskell.Brittany.Internal.PerModule
|
||||||
|
Language.Haskell.Brittany.Internal.PerDecl
|
||||||
Language.Haskell.Brittany.Internal.Prelude
|
Language.Haskell.Brittany.Internal.Prelude
|
||||||
Language.Haskell.Brittany.Internal.PreludeUtils
|
Language.Haskell.Brittany.Internal.Transformations.T1_Alt
|
||||||
Language.Haskell.Brittany.Internal.Transformations.Alt
|
Language.Haskell.Brittany.Internal.Transformations.T2_Floating
|
||||||
Language.Haskell.Brittany.Internal.Transformations.Columns
|
Language.Haskell.Brittany.Internal.Transformations.T3_Par
|
||||||
Language.Haskell.Brittany.Internal.Transformations.Floating
|
Language.Haskell.Brittany.Internal.Transformations.T4_Columns
|
||||||
Language.Haskell.Brittany.Internal.Transformations.Indent
|
Language.Haskell.Brittany.Internal.Transformations.T5_Indent
|
||||||
Language.Haskell.Brittany.Internal.Transformations.Par
|
Language.Haskell.Brittany.Internal.WriteBriDoc.AlignmentAlgo
|
||||||
|
Language.Haskell.Brittany.Internal.WriteBriDoc.Operators
|
||||||
|
Language.Haskell.Brittany.Internal.WriteBriDoc.Types
|
||||||
Language.Haskell.Brittany.Internal.Types
|
Language.Haskell.Brittany.Internal.Types
|
||||||
Language.Haskell.Brittany.Internal.Utils
|
Language.Haskell.Brittany.Internal.Utils
|
||||||
Language.Haskell.Brittany.Main
|
|
||||||
Paths_brittany
|
Paths_brittany
|
||||||
|
|
||||||
executable brittany
|
executable brittany
|
||||||
|
@ -143,7 +170,11 @@ test-suite brittany-test-suite
|
||||||
import: executable
|
import: executable
|
||||||
|
|
||||||
build-depends:
|
build-depends:
|
||||||
, hspec ^>= 2.8.3
|
, hspec >= 2.8.3 && < 2.10
|
||||||
|
, HUnit >= 1.6.2 && < 1.7
|
||||||
|
, ansi-terminal >= 0.11.4 && < 0.12
|
||||||
|
, parsec ^>= 3.1.14
|
||||||
|
, these ^>= 1.1
|
||||||
hs-source-dirs: source/test-suite
|
hs-source-dirs: source/test-suite
|
||||||
main-is: Main.hs
|
main-is: Main.hs
|
||||||
type: exitcode-stdio-1.0
|
type: exitcode-stdio-1.0
|
||||||
|
|
|
@ -0,0 +1,296 @@
|
||||||
|
#group data type declarations
|
||||||
|
|
||||||
|
|
||||||
|
#test nullary data type
|
||||||
|
data Foo = Bar {}
|
||||||
|
|
||||||
|
data Biz = Baz
|
||||||
|
|
||||||
|
#test single record
|
||||||
|
data Foo = Bar
|
||||||
|
{ foo :: Baz
|
||||||
|
}
|
||||||
|
|
||||||
|
#test record multiple names
|
||||||
|
data Foo = Bar
|
||||||
|
{ foo, bar :: Baz
|
||||||
|
}
|
||||||
|
|
||||||
|
#test record multiple types
|
||||||
|
data Foo = Bar
|
||||||
|
{ foo :: Baz
|
||||||
|
, bars :: Bizzz
|
||||||
|
}
|
||||||
|
|
||||||
|
#test record multiple types and names
|
||||||
|
data Foo = Bar
|
||||||
|
{ foo, biz :: Baz
|
||||||
|
, bar :: Bizzz
|
||||||
|
}
|
||||||
|
|
||||||
|
#test record multiple types deriving
|
||||||
|
data Foo = Bar
|
||||||
|
{ fooz :: Baz
|
||||||
|
, bar :: Bizzz
|
||||||
|
}
|
||||||
|
deriving Show
|
||||||
|
|
||||||
|
#test record long field names
|
||||||
|
data MyRecord = MyConstructor
|
||||||
|
{ bar1, bar2
|
||||||
|
:: Loooooooooooooooooooooooooooooooong
|
||||||
|
-> Loooooooooooooooooooooooooooooooong
|
||||||
|
, foo1, foo2
|
||||||
|
:: Loooooooooooooooooooooooooooooooonger
|
||||||
|
-> Loooooooooooooooooooooooooooooooonger
|
||||||
|
}
|
||||||
|
|
||||||
|
#test record with DataTypeContexts
|
||||||
|
{-# LANGUAGE DatatypeContexts #-}
|
||||||
|
data
|
||||||
|
( LooooooooooooooooooooongConstraint a
|
||||||
|
, LooooooooooooooooooooongConstraint b
|
||||||
|
) =>
|
||||||
|
MyRecord a b
|
||||||
|
= MyConstructor
|
||||||
|
{ foo1, foo2
|
||||||
|
:: loooooooooooooooooooooooooooooooong
|
||||||
|
-> loooooooooooooooooooooooooooooooong
|
||||||
|
, bar :: a
|
||||||
|
, bazz :: b
|
||||||
|
}
|
||||||
|
|
||||||
|
#test record single line layout
|
||||||
|
{-# LANGUAGE ScopedTypeVariables #-}
|
||||||
|
-- brittany { lconfig_allowSinglelineRecord: true }
|
||||||
|
data MyRecord = forall a . Show a => MyCons { foo :: a -> a, i :: Int }
|
||||||
|
|
||||||
|
#test record no matching single line layout
|
||||||
|
{-# LANGUAGE ScopedTypeVariables #-}
|
||||||
|
-- brittany { lconfig_allowSinglelineRecord: true }
|
||||||
|
data MyRecord = forall a . Show a => Bar
|
||||||
|
{ foo :: abittoolongbutnotvery -> abittoolongbutnotvery
|
||||||
|
}
|
||||||
|
|
||||||
|
#test avoid single-line record if there are comments
|
||||||
|
-- brittany { lconfig_allowSinglelineRecord: true }
|
||||||
|
data MyRecord = MyRecord
|
||||||
|
{ a :: Int
|
||||||
|
-- ^ comment 1
|
||||||
|
, b :: Int
|
||||||
|
-- ^ comment 2
|
||||||
|
}
|
||||||
|
|
||||||
|
#test record forall constraint multiline
|
||||||
|
{-# LANGUAGE ScopedTypeVariables #-}
|
||||||
|
data MyRecord
|
||||||
|
= forall a
|
||||||
|
. LooooooooooooooooooooongConstraint a =>
|
||||||
|
LoooooooooooongConstructor
|
||||||
|
{ foo :: abittoolongbutnotvery -> abittoolongbutnotvery
|
||||||
|
}
|
||||||
|
|
||||||
|
#test record forall constraint multiline more
|
||||||
|
{-# LANGUAGE ScopedTypeVariables #-}
|
||||||
|
data MyRecord
|
||||||
|
= forall a b
|
||||||
|
. ( Loooooooooooooooooooooooooooooooong a
|
||||||
|
, Loooooooooooooooooooooooooooooooong b
|
||||||
|
) =>
|
||||||
|
MyConstructor
|
||||||
|
{ a :: a
|
||||||
|
, b :: b
|
||||||
|
}
|
||||||
|
|
||||||
|
#test plain with forall and constraint
|
||||||
|
{-# LANGUAGE ScopedTypeVariables #-}
|
||||||
|
data MyStruct
|
||||||
|
= forall a b
|
||||||
|
. ( Loooooooooooooooooooooooooooooooong a
|
||||||
|
, Loooooooooooooooooooooooooooooooong b
|
||||||
|
) =>
|
||||||
|
MyConstructor (ToBriDocM BriDocNumbered)
|
||||||
|
(ToBriDocM BriDocNumbered)
|
||||||
|
(ToBriDocM BriDocNumbered)
|
||||||
|
|
||||||
|
#test record with many features
|
||||||
|
{-# LANGUAGE ScopedTypeVariables #-}
|
||||||
|
data MyRecord
|
||||||
|
= forall a b
|
||||||
|
. ( Loooooooooooooooooooooooooooooooong a
|
||||||
|
, Loooooooooooooooooooooooooooooooong b
|
||||||
|
) =>
|
||||||
|
MyConstructor
|
||||||
|
{ foo, foo2
|
||||||
|
:: loooooooooooooooooooooooooooooooong
|
||||||
|
-> loooooooooooooooooooooooooooooooong
|
||||||
|
, bar :: a
|
||||||
|
, bazz :: b
|
||||||
|
}
|
||||||
|
deriving Show
|
||||||
|
|
||||||
|
#test record multiple types deriving
|
||||||
|
data Foo = Bar
|
||||||
|
{ foo :: Baz
|
||||||
|
, bars :: Bizzz
|
||||||
|
}
|
||||||
|
deriving (Show, Eq, Monad, Functor, Traversable, Foldable)
|
||||||
|
|
||||||
|
#test record multiple deriving strategies
|
||||||
|
data Foo = Bar
|
||||||
|
{ foo :: Baz
|
||||||
|
, bars :: Bizzz
|
||||||
|
}
|
||||||
|
deriving Show
|
||||||
|
deriving (Eq, Ord)
|
||||||
|
deriving stock Show
|
||||||
|
deriving stock (Eq, Ord)
|
||||||
|
deriving anyclass Show
|
||||||
|
deriving anyclass (Show, Eq, Monad, Functor)
|
||||||
|
deriving newtype Show
|
||||||
|
deriving newtype (Traversable, Foldable)
|
||||||
|
|
||||||
|
#test record deriving via
|
||||||
|
data Foo = Bar
|
||||||
|
{ foo :: Baz
|
||||||
|
, bars :: Bizzz
|
||||||
|
}
|
||||||
|
deriving ToJSON via (SomeType)
|
||||||
|
deriving (ToJSON, FromJSON) via (SomeType)
|
||||||
|
|
||||||
|
#test single record existential
|
||||||
|
{-# LANGUAGE ExistentialQuantification #-}
|
||||||
|
|
||||||
|
data Foo = forall a . Show a => Bar
|
||||||
|
{ foo :: a
|
||||||
|
}
|
||||||
|
|
||||||
|
#test record multiple types existential
|
||||||
|
{-# LANGUAGE ExistentialQuantification #-}
|
||||||
|
|
||||||
|
data Foo = forall a b . (Show a, Eq b) => Bar
|
||||||
|
{ foo :: a
|
||||||
|
, bars :: b
|
||||||
|
}
|
||||||
|
|
||||||
|
#test plain comment simple
|
||||||
|
-- before
|
||||||
|
data MyData = MyData Int
|
||||||
|
-- after
|
||||||
|
|
||||||
|
#test record newline comment
|
||||||
|
data MyRecord = MyRecord
|
||||||
|
{ a :: Int
|
||||||
|
-- comment
|
||||||
|
, b :: Int
|
||||||
|
}
|
||||||
|
|
||||||
|
#test record comments simple
|
||||||
|
data Foo = Bar -- a
|
||||||
|
{ foo :: Baz -- b
|
||||||
|
, bars :: Bizzz -- c
|
||||||
|
} -- d
|
||||||
|
deriving (Show, Eq, Monad, Functor, Traversable, Foldable) -- e
|
||||||
|
|
||||||
|
#test record comments strange inline
|
||||||
|
data Foo = Bar
|
||||||
|
{ -- a
|
||||||
|
foo -- b
|
||||||
|
:: -- c
|
||||||
|
Baz -- d
|
||||||
|
, -- e
|
||||||
|
bars :: Bizzz
|
||||||
|
}
|
||||||
|
deriving (Show, Eq, Monad, Functor, Traversable, Foldable)
|
||||||
|
|
||||||
|
#test record comments in deriving
|
||||||
|
## maybe we want to switch to a differnt layout when there are such comments.
|
||||||
|
## Don't hesitate to modify this testcase, it clearly is not the ideal layout
|
||||||
|
## for this.
|
||||||
|
|
||||||
|
data Foo = Bar
|
||||||
|
{ foo :: Baz
|
||||||
|
, bars :: Bizzz
|
||||||
|
}
|
||||||
|
-- a
|
||||||
|
deriving --b
|
||||||
|
( -- c
|
||||||
|
ToJSON -- d
|
||||||
|
, -- e
|
||||||
|
FromJSON --f
|
||||||
|
) -- g
|
||||||
|
|
||||||
|
#test record comments in deriving via
|
||||||
|
## maybe we want to switch to a differnt layout when there are such comments.
|
||||||
|
## Don't hesitate to modify this testcase, it clearly is not the ideal layout
|
||||||
|
## for this.
|
||||||
|
|
||||||
|
data Foo = Bar
|
||||||
|
{ foo :: Baz
|
||||||
|
, bars :: Bizzz
|
||||||
|
}
|
||||||
|
-- a
|
||||||
|
deriving --a
|
||||||
|
ToJSON --b
|
||||||
|
via -- c
|
||||||
|
( -- d
|
||||||
|
SomeType --e
|
||||||
|
, -- f
|
||||||
|
ABC --g
|
||||||
|
)
|
||||||
|
|
||||||
|
#test comment before equal sign
|
||||||
|
{-# LANGUAGE ExistentialQuantification #-}
|
||||||
|
data MyRecord
|
||||||
|
-- test comment
|
||||||
|
= forall a b
|
||||||
|
. ( Loooooooooooooooooooooooooooooooong a
|
||||||
|
, Loooooooooooooooooooooooooooooooong b
|
||||||
|
) =>
|
||||||
|
MyConstructor a b
|
||||||
|
|
||||||
|
#test normal records on multi line indent policy left
|
||||||
|
-- brittany {lconfig_indentPolicy: IndentPolicyLeft }
|
||||||
|
data EnterpriseGrantsForCompanyResponse = EnterpriseGrantsForCompanyResponse
|
||||||
|
Types.Company
|
||||||
|
[EnterpriseGrantResponse]
|
||||||
|
|
||||||
|
#test normal records on multi line indent policy free
|
||||||
|
-- brittany {lconfig_indentPolicy: IndentPolicyFree }
|
||||||
|
data GrantsForCompanyResp = GrantsForCompanyResp Types.Company
|
||||||
|
[EnterpriseGrantResponse]
|
||||||
|
|
||||||
|
#test normal records on multi line indent policy free 2
|
||||||
|
-- brittany {lconfig_indentPolicy: IndentPolicyFree }
|
||||||
|
data EnterpriseGrantsForCompanyResponse = EnterpriseGrantsForCompanyResponse
|
||||||
|
Types.Company
|
||||||
|
[EnterpriseGrantResponse]
|
||||||
|
|
||||||
|
#test normal records on multi line indent policy multiple
|
||||||
|
-- brittany {lconfig_indentPolicy: IndentPolicyMultiple }
|
||||||
|
data GrantsForCompanyResp = GrantsForCompanyResp Types.Company
|
||||||
|
[EnterpriseGrantResponse]
|
||||||
|
|
||||||
|
#test large record with a comment
|
||||||
|
data XIILqcacwiuNiu = XIILqcacwiuNiu
|
||||||
|
{ oyyFtvbepgbOge_pebzVmuftEijwuj :: Jgtoyuh HessJvNlo
|
||||||
|
, wloQsiskdoxJop_xatiKrwedOxtu :: Jgtoyuh [Inotg]
|
||||||
|
, mmmJjcqtemyIyo_ovosDoreKeeoyamvove :: Jgtoyuh Eujo
|
||||||
|
, mbiIatelofxOzr_uluxNngiiMjah :: Jgtoyuh HessJvNlo
|
||||||
|
, obxIskfcxpkIkb_uuviTuevcSkrgo :: Jgtoyuh Int
|
||||||
|
, wqrAtuvuecoHwr_ilotNxbuPleo :: Jgtoyuh Ufaxdeq
|
||||||
|
, lofAfuebdhpLuv_cnekPoyFxmg :: Jgtoyuh Ufaxdeq
|
||||||
|
, ouoFugtawzvUpk_oupiLzptugy :: Jgtoyuh Eujo
|
||||||
|
, iqiXjtziwogNsa_uiyvSunaTtgUsf3 :: Jgtoyuh Oaivn
|
||||||
|
, odbIriaqnojUlz_onotoWuunehIpuy :: Jgtoyuh Eujo
|
||||||
|
, opjUxtkxzkiKse_luqjuZazt
|
||||||
|
:: Jgtoyuh [(Eujo, Int, Int, Int, Int, Int, NELUxro)]
|
||||||
|
-- , jcqRaqznxfhIpa_ywevMezmoYkutuwa :: Jgtoyuh ()
|
||||||
|
, vayOmuasyphOfd_bcsVljmvt :: Jgtoyuh Eujo
|
||||||
|
, rifArahilooRax_ufikecqdImsv :: Jgtoyuh Oaivn
|
||||||
|
, raqKtopcpszDwb_oqocubasZuqjcryoDojGkw :: Jgtoyuh Oaivn
|
||||||
|
, mluJiilpcijUtt_gaisklifVekfeyagRmfbyzz :: Jgtoyuh Oaivn
|
||||||
|
, oqhPaahjupaSmi_gamwwoovKyxznecvEayluc :: Jgtoyuh Oaivn
|
||||||
|
, mazFubimwebZpa_itidehDodiDlboz :: Jgtoyuh Vrep
|
||||||
|
, jeyOcuesexaYoy_vpqn :: Jgtoyuh ()
|
||||||
|
}
|
|
@ -0,0 +1,127 @@
|
||||||
|
#group decl/instance
|
||||||
|
|
||||||
|
|
||||||
|
#test simple-instance
|
||||||
|
|
||||||
|
instance MyClass Int where
|
||||||
|
myMethod x = x + 1
|
||||||
|
|
||||||
|
#test simple-method-comment
|
||||||
|
|
||||||
|
instance MyClass Int where
|
||||||
|
myMethod x =
|
||||||
|
-- insightful comment
|
||||||
|
x + 1
|
||||||
|
|
||||||
|
#test simple-method-signature
|
||||||
|
|
||||||
|
instance MyClass Int where
|
||||||
|
myMethod :: Int -> Int
|
||||||
|
myMethod x = x + 1
|
||||||
|
|
||||||
|
#test simple-long-method-signature
|
||||||
|
|
||||||
|
instance MyClass Int where
|
||||||
|
myMethod
|
||||||
|
:: Int
|
||||||
|
-> Int
|
||||||
|
-> AReallyLongType
|
||||||
|
-> AReallyLongType
|
||||||
|
-> AReallyLongType
|
||||||
|
-> Int
|
||||||
|
myMethod x = x + 1
|
||||||
|
|
||||||
|
#test simple-two-methods
|
||||||
|
|
||||||
|
instance MyClass Int where
|
||||||
|
myMethod x = x + 1
|
||||||
|
myMethod2 x = x + 1
|
||||||
|
|
||||||
|
#test simple-two-signatures
|
||||||
|
|
||||||
|
instance MyClass Int where
|
||||||
|
myMethod
|
||||||
|
:: Int
|
||||||
|
-> Int
|
||||||
|
-> AReallyLongType
|
||||||
|
-> AReallyLongType
|
||||||
|
-> AReallyLongType
|
||||||
|
-> Int
|
||||||
|
myMethod x = x + 1
|
||||||
|
|
||||||
|
myMethod2 :: Int -> Int
|
||||||
|
myMethod2 x = x + 1
|
||||||
|
|
||||||
|
#test simple-instance-comment
|
||||||
|
|
||||||
|
-- | This instance should be commented on
|
||||||
|
instance MyClass Int where
|
||||||
|
|
||||||
|
-- | This method is also comment-worthy
|
||||||
|
myMethod x = x + 1
|
||||||
|
|
||||||
|
#test instance-with-type-family
|
||||||
|
|
||||||
|
instance MyClass Int where
|
||||||
|
type MyType = Int
|
||||||
|
|
||||||
|
myMethod :: MyType -> Int
|
||||||
|
myMethod x = x + 1
|
||||||
|
|
||||||
|
#test instance-with-type-family-below-method
|
||||||
|
|
||||||
|
instance MyClass Int where
|
||||||
|
|
||||||
|
type MyType = String
|
||||||
|
|
||||||
|
myMethod :: MyType -> Int
|
||||||
|
myMethod x = x + 1
|
||||||
|
|
||||||
|
type MyType = Int
|
||||||
|
|
||||||
|
#test instance-with-data-family
|
||||||
|
|
||||||
|
instance MyClass Int where
|
||||||
|
|
||||||
|
-- | This data is very important
|
||||||
|
data MyData = IntData
|
||||||
|
{ intData :: String
|
||||||
|
, intData2 :: Int
|
||||||
|
}
|
||||||
|
|
||||||
|
myMethod :: MyData -> Int
|
||||||
|
myMethod = intData2
|
||||||
|
|
||||||
|
#test instance-with-data-family-below-method
|
||||||
|
|
||||||
|
instance MyClass Int where
|
||||||
|
-- | This data is important
|
||||||
|
data MyData = Test Int Int
|
||||||
|
|
||||||
|
myMethod :: MyData -> Int
|
||||||
|
myMethod = intData2
|
||||||
|
|
||||||
|
-- | This data is also important
|
||||||
|
data MyData2 = IntData
|
||||||
|
{ intData :: String
|
||||||
|
-- ^ Interesting field
|
||||||
|
, intData2 :: Int
|
||||||
|
}
|
||||||
|
|
||||||
|
#test instance-with-newtype-family-and-deriving
|
||||||
|
|
||||||
|
{-# LANGUAGE TypeFamilies #-}
|
||||||
|
|
||||||
|
module Lib where
|
||||||
|
|
||||||
|
instance Foo () where
|
||||||
|
newtype Bar () = Baz ()
|
||||||
|
deriving (Eq, Ord, Show)
|
||||||
|
bar = Baz
|
||||||
|
|
||||||
|
#test instance-with-newtype-family-and-record
|
||||||
|
|
||||||
|
instance Foo Int where
|
||||||
|
newtype Bar Int = BarInt
|
||||||
|
{ unBarInt :: Int
|
||||||
|
}
|
|
@ -0,0 +1,134 @@
|
||||||
|
#group decl/typefam/ghc9-support
|
||||||
|
|
||||||
|
|
||||||
|
#test type-instance-without-comment
|
||||||
|
|
||||||
|
{-# language TypeFamilies #-}
|
||||||
|
type family F a
|
||||||
|
type instance F Int = IO Int
|
||||||
|
|
||||||
|
#test type-instance-with-comment
|
||||||
|
|
||||||
|
{-# language TypeFamilies #-}
|
||||||
|
type family F a
|
||||||
|
type instance F Int = IO Int -- x
|
||||||
|
|
||||||
|
#test type-instance-with-module-header
|
||||||
|
|
||||||
|
{-# language TypeFamilies #-}
|
||||||
|
module M where
|
||||||
|
type family F a
|
||||||
|
type instance F Int = IO Int
|
||||||
|
|
||||||
|
#test newtype-instance-without-comment
|
||||||
|
|
||||||
|
{-# language TypeFamilies #-}
|
||||||
|
data family F a
|
||||||
|
newtype instance F Int = N Int
|
||||||
|
|
||||||
|
#test newtype-instance-with-comment
|
||||||
|
|
||||||
|
{-# language TypeFamilies #-}
|
||||||
|
data family F a
|
||||||
|
newtype instance F Int = N Int -- x
|
||||||
|
|
||||||
|
#test newtype-instance-with-module-header
|
||||||
|
|
||||||
|
{-# language TypeFamilies #-}
|
||||||
|
module M where
|
||||||
|
data family F a
|
||||||
|
newtype instance F Int = N Int
|
||||||
|
|
||||||
|
#test data-instance-without-comment
|
||||||
|
|
||||||
|
{-# language TypeFamilies #-}
|
||||||
|
data family F a
|
||||||
|
data instance F Int = D Int
|
||||||
|
|
||||||
|
#test data-instance-with-comment
|
||||||
|
|
||||||
|
{-# language TypeFamilies #-}
|
||||||
|
data family F a
|
||||||
|
data instance F Int = D Int -- x
|
||||||
|
|
||||||
|
#test data-instance-with-module-header
|
||||||
|
|
||||||
|
{-# language TypeFamilies #-}
|
||||||
|
module M where
|
||||||
|
data family F a
|
||||||
|
data instance F Int = D Int
|
||||||
|
|
||||||
|
#test instance-type-without-comment
|
||||||
|
|
||||||
|
{-# language TypeFamilies #-}
|
||||||
|
class C a where
|
||||||
|
type family F a
|
||||||
|
instance C Int where
|
||||||
|
type F Int = IO Int
|
||||||
|
|
||||||
|
#test instance-type-with-comment
|
||||||
|
|
||||||
|
{-# language TypeFamilies #-}
|
||||||
|
class C a where
|
||||||
|
type family F a
|
||||||
|
instance C Int where
|
||||||
|
type F Int = IO Int -- x
|
||||||
|
|
||||||
|
#test instance-type-with-module-header
|
||||||
|
|
||||||
|
{-# language TypeFamilies #-}
|
||||||
|
module M where
|
||||||
|
class C a where
|
||||||
|
type family F a
|
||||||
|
instance C Int where
|
||||||
|
type F Int = IO Int
|
||||||
|
|
||||||
|
#test instance-newtype-without-comment
|
||||||
|
|
||||||
|
{-# language TypeFamilies #-}
|
||||||
|
class C a where
|
||||||
|
data family F a
|
||||||
|
instance C Int where
|
||||||
|
newtype F Int = N Int
|
||||||
|
|
||||||
|
#test instance-newtype-with-comment
|
||||||
|
|
||||||
|
{-# language TypeFamilies #-}
|
||||||
|
class C a where
|
||||||
|
data family F a
|
||||||
|
instance C Int where
|
||||||
|
newtype F Int = N Int -- x
|
||||||
|
|
||||||
|
#test instance-newtype-with-module-header
|
||||||
|
|
||||||
|
{-# language TypeFamilies #-}
|
||||||
|
module M where
|
||||||
|
class C a where
|
||||||
|
data family F a
|
||||||
|
instance C Int where
|
||||||
|
newtype F Int = N Int
|
||||||
|
|
||||||
|
#test instance-data-without-comment
|
||||||
|
|
||||||
|
{-# language TypeFamilies #-}
|
||||||
|
class C a where
|
||||||
|
data family F a
|
||||||
|
instance C Int where
|
||||||
|
data F Int = D Int
|
||||||
|
|
||||||
|
#test instance-data-with-comment
|
||||||
|
|
||||||
|
{-# language TypeFamilies #-}
|
||||||
|
class C a where
|
||||||
|
data family F a
|
||||||
|
instance C Int where
|
||||||
|
data F Int = D Int -- x
|
||||||
|
|
||||||
|
#test instance-data-with-module-header
|
||||||
|
|
||||||
|
{-# language TypeFamilies #-}
|
||||||
|
module M where
|
||||||
|
class C a where
|
||||||
|
data family F a
|
||||||
|
instance C Int where
|
||||||
|
data F Int = D Int
|
|
@ -0,0 +1,36 @@
|
||||||
|
#group decl/typefam/instance
|
||||||
|
|
||||||
|
|
||||||
|
#test simple-typefam-instance
|
||||||
|
|
||||||
|
type instance MyFam Bool = String
|
||||||
|
|
||||||
|
#test simple-typefam-instance-param-type
|
||||||
|
|
||||||
|
type instance MyFam (Maybe a) = a -> Bool
|
||||||
|
|
||||||
|
#test simple-typefam-instance-parens
|
||||||
|
#pending the parens cause problems since ghc-8.8
|
||||||
|
|
||||||
|
type instance (MyFam (String -> Int)) = String
|
||||||
|
|
||||||
|
#test simple-typefam-instance-overflow
|
||||||
|
|
||||||
|
type instance MyFam ALongishType
|
||||||
|
= AMuchLongerTypeThanThat
|
||||||
|
-> AnEvenLongerTypeThanTheLastOne
|
||||||
|
-> ShouldDefinitelyOverflow
|
||||||
|
|
||||||
|
#test simple-typefam-instance-comments
|
||||||
|
|
||||||
|
-- | A happy family
|
||||||
|
type instance MyFam Bool -- This is an odd one
|
||||||
|
= AnotherType -- Here's another
|
||||||
|
|
||||||
|
#test simple-typefam-instance-parens-comment
|
||||||
|
#pending the parens cause problems since ghc-8.8
|
||||||
|
|
||||||
|
-- | A happy family
|
||||||
|
type instance (MyFam Bool) -- This is an odd one
|
||||||
|
= -- Here's another
|
||||||
|
AnotherType
|
|
@ -0,0 +1,150 @@
|
||||||
|
#group expression/basic
|
||||||
|
|
||||||
|
|
||||||
|
#test var
|
||||||
|
func = x
|
||||||
|
|
||||||
|
describe "infix op" $ do
|
||||||
|
#test 1
|
||||||
|
func = x + x
|
||||||
|
|
||||||
|
#test long
|
||||||
|
func =
|
||||||
|
mweroiuxlskdfjlksjdflkjsdfljksldkjflkjsdflkj
|
||||||
|
+ mweroiuxlskdfjlksjdflkjsdfljksldkjflkjsdflkj
|
||||||
|
|
||||||
|
#test long keep linemode 1
|
||||||
|
func =
|
||||||
|
mweroiuxlskdfjlksjdflkjsdfljksldkjflkjsdflkj
|
||||||
|
+ mweroiuxlskdfjlksj
|
||||||
|
+ mweroiuxlskdfjlksj
|
||||||
|
|
||||||
|
#test long keep linemode 2
|
||||||
|
func =
|
||||||
|
mweroiuxlskdfjlksj
|
||||||
|
+ mweroiuxlskdfjlksj
|
||||||
|
+ mweroiuxlskdfjlksjdflkjsdfljksldkjflkjsdflkj
|
||||||
|
|
||||||
|
#test literals
|
||||||
|
func = 1
|
||||||
|
func = "abc"
|
||||||
|
func = 1.1e5
|
||||||
|
func = 'x'
|
||||||
|
func = 981409823458910394810928414192837123987123987123
|
||||||
|
|
||||||
|
#test lambda
|
||||||
|
func = \x -> abc
|
||||||
|
|
||||||
|
describe "app" $ do
|
||||||
|
#test 1
|
||||||
|
func = klajsdas klajsdas klajsdas
|
||||||
|
|
||||||
|
#test 2
|
||||||
|
func =
|
||||||
|
lakjsdlajsdljasdlkjasldjasldjasldjalsdjlaskjd
|
||||||
|
lakjsdlajsdljasdlkjasldjasldjasldjalsdjlaskjd
|
||||||
|
lakjsdlajsdljasdlkjasldjasldjasldjalsdjlaskjd
|
||||||
|
|
||||||
|
#test 3
|
||||||
|
func =
|
||||||
|
lakjsdlajsdljasdlkjasldjasldjasldjalsdjlaskjd lakjsdlajsdljas
|
||||||
|
lakjsdlajsdljas
|
||||||
|
lakjsdlajsdljas
|
||||||
|
|
||||||
|
###
|
||||||
|
#group expression.basic.sections
|
||||||
|
###
|
||||||
|
|
||||||
|
#test left
|
||||||
|
func = (1 +)
|
||||||
|
|
||||||
|
#test right
|
||||||
|
func = (+ 1)
|
||||||
|
|
||||||
|
#test left inf
|
||||||
|
func = (1 `abc`)
|
||||||
|
|
||||||
|
#test right inf
|
||||||
|
func = (`abc` 1)
|
||||||
|
|
||||||
|
###
|
||||||
|
#group tuples
|
||||||
|
###
|
||||||
|
|
||||||
|
#test pair
|
||||||
|
func = (abc, def)
|
||||||
|
|
||||||
|
#test pair section left
|
||||||
|
func = (abc, )
|
||||||
|
|
||||||
|
#test pair section right
|
||||||
|
func = (, abc)
|
||||||
|
|
||||||
|
#test quintuple section long
|
||||||
|
myTupleSection =
|
||||||
|
( verylaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaargefirstelement
|
||||||
|
,
|
||||||
|
, verylaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaargethirdelement
|
||||||
|
,
|
||||||
|
)
|
||||||
|
|
||||||
|
#test 2
|
||||||
|
func =
|
||||||
|
( lakjsdlajsdljasdlkjasldjasldjasldjalsdjlaskjd
|
||||||
|
, lakjsdlajsdljasdlkjasldjasldjasldjalsdjlaskjd
|
||||||
|
)
|
||||||
|
|
||||||
|
#test comment-after-then
|
||||||
|
foo = if True
|
||||||
|
then
|
||||||
|
-- iiiiii
|
||||||
|
"a "
|
||||||
|
else
|
||||||
|
"b "
|
||||||
|
|
||||||
|
#test comment-after-if-else-do
|
||||||
|
func = if cond
|
||||||
|
then pure 42
|
||||||
|
else do
|
||||||
|
-- test
|
||||||
|
abc
|
||||||
|
|
||||||
|
#test nonempty-case-short
|
||||||
|
func = case x of
|
||||||
|
False -> False
|
||||||
|
True -> True
|
||||||
|
|
||||||
|
#test nonempty-case-long
|
||||||
|
func =
|
||||||
|
case
|
||||||
|
lakjsdlajsdljasdlkjasldjasldjasldjalsdjlaskjd
|
||||||
|
lakjsdlajsdljasdlkjasldjasldjasldjalsdjlaskjd
|
||||||
|
of
|
||||||
|
False -> False
|
||||||
|
True -> True
|
||||||
|
|
||||||
|
#test nonempty-case-long-do
|
||||||
|
func = do
|
||||||
|
case
|
||||||
|
lakjsdlajsdljasdlkjasldjasldjasldjalsdjlaskjd
|
||||||
|
lakjsdlajsdljasdlkjasldjasldjasldjalsdjlaskjd
|
||||||
|
of
|
||||||
|
False -> False
|
||||||
|
True -> True
|
||||||
|
|
||||||
|
#test empty-case-short
|
||||||
|
func = case x of {}
|
||||||
|
|
||||||
|
#test empty-case-long
|
||||||
|
func =
|
||||||
|
case
|
||||||
|
lakjsdlajsdljasdlkjasldjasldjasldjalsdjlaskjd
|
||||||
|
lakjsdlajsdljasdlkjasldjasldjasldjalsdjlaskjd
|
||||||
|
of {}
|
||||||
|
|
||||||
|
#test empty-case-long-do
|
||||||
|
func = do
|
||||||
|
case
|
||||||
|
lakjsdlajsdljasdlkjasldjasldjasldjalsdjlaskjd
|
||||||
|
lakjsdlajsdljasdlkjasldjasldjasldjalsdjlaskjd
|
||||||
|
of {}
|
|
@ -0,0 +1,26 @@
|
||||||
|
#group expression/do
|
||||||
|
|
||||||
|
|
||||||
|
#test simple
|
||||||
|
func = do
|
||||||
|
stmt
|
||||||
|
stmt
|
||||||
|
|
||||||
|
#test bind
|
||||||
|
func = do
|
||||||
|
x <- stmt
|
||||||
|
stmt x
|
||||||
|
|
||||||
|
#test let
|
||||||
|
func = do
|
||||||
|
let x = 13
|
||||||
|
stmt x
|
||||||
|
|
||||||
|
#test do empty lines
|
||||||
|
func = do
|
||||||
|
<BLANKLINE>
|
||||||
|
let x = 13
|
||||||
|
<BLANKLINE>
|
||||||
|
y <- monadic
|
||||||
|
<BLANKLINE>
|
||||||
|
stmt (x + y)
|
|
@ -0,0 +1,27 @@
|
||||||
|
#group expression/let
|
||||||
|
|
||||||
|
|
||||||
|
#test single-bind-comment-long
|
||||||
|
testMethod foo bar baz qux =
|
||||||
|
let x = undefined foo bar baz qux qux baz bar :: String
|
||||||
|
-- some comment explaining the in expression
|
||||||
|
in undefined foo x :: String
|
||||||
|
|
||||||
|
#test single-bind-comment-short
|
||||||
|
testMethod foo bar baz qux =
|
||||||
|
let x = undefined :: String
|
||||||
|
-- some comment explaining the in expression
|
||||||
|
in undefined :: String
|
||||||
|
|
||||||
|
#test single-bind-comment-before
|
||||||
|
testMethod foo bar baz qux =
|
||||||
|
-- some comment explaining the in expression
|
||||||
|
let x = undefined :: String in undefined :: String
|
||||||
|
|
||||||
|
#test multiple-binds-comment
|
||||||
|
foo foo bar baz qux =
|
||||||
|
let a = 1
|
||||||
|
b = 2
|
||||||
|
c = 3
|
||||||
|
-- some comment explaining the in expression
|
||||||
|
in undefined :: String
|
|
@ -0,0 +1,30 @@
|
||||||
|
#group expression/list
|
||||||
|
|
||||||
|
#golden list format into singleline should not keep spacing
|
||||||
|
foo =
|
||||||
|
[ 1
|
||||||
|
, 2
|
||||||
|
, 3
|
||||||
|
, 4
|
||||||
|
, 5
|
||||||
|
]
|
||||||
|
#expected
|
||||||
|
foo = [1, 2, 3, 4, 5]
|
||||||
|
|
||||||
|
#golden singleline list with comment
|
||||||
|
foo = [1 {- a -}, {- b -} 2, {- c -} 3, 4, 5]
|
||||||
|
#expected
|
||||||
|
foo =
|
||||||
|
[ 1 {- a -}
|
||||||
|
, {- b -} 2
|
||||||
|
, {- c -} 3
|
||||||
|
, 4
|
||||||
|
, 5
|
||||||
|
]
|
||||||
|
|
||||||
|
#test set-base-y for multiple line elements
|
||||||
|
foo =
|
||||||
|
[ aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
|
||||||
|
, bbbbbbbbbbbbbbbbbb
|
||||||
|
$ cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc
|
||||||
|
]
|
|
@ -0,0 +1,16 @@
|
||||||
|
#group expression.special
|
||||||
|
|
||||||
|
|
||||||
|
#test monad-comprehension-case-of
|
||||||
|
func = foooooo
|
||||||
|
$ [ case foooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooo of
|
||||||
|
_ -> True
|
||||||
|
]
|
||||||
|
|
||||||
|
#test operatorprefixalignment-even-with-multiline-alignbreak
|
||||||
|
func =
|
||||||
|
foo
|
||||||
|
$ [ aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
|
||||||
|
, bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb
|
||||||
|
]
|
||||||
|
++ [ccccccccccccccccccccccccccccccccccccccccccccccccccccccccc]
|
|
@ -0,0 +1,92 @@
|
||||||
|
###############################################################################
|
||||||
|
#group decl/binding/basic
|
||||||
|
###############################################################################
|
||||||
|
|
||||||
|
#test basic 1
|
||||||
|
func x = x
|
||||||
|
|
||||||
|
#test infix 1
|
||||||
|
x *** y = x
|
||||||
|
|
||||||
|
#test symbol prefix
|
||||||
|
(***) x y = x
|
||||||
|
|
||||||
|
#test infix more args simple
|
||||||
|
(f >=> g) k = f k >>= g
|
||||||
|
|
||||||
|
#test infix more args alignment
|
||||||
|
(Left a <$$> Left dd) e f = True
|
||||||
|
(Left a <$$> Right d ) e f = True
|
||||||
|
(Right a <$$> Left d ) e f = False
|
||||||
|
(Right a <$$> Right dd) e f = True
|
||||||
|
|
||||||
|
|
||||||
|
###############################################################################
|
||||||
|
#group decl/binding/patterns
|
||||||
|
###############################################################################
|
||||||
|
|
||||||
|
#test wildcard
|
||||||
|
func _ = x
|
||||||
|
|
||||||
|
#test simple long pattern
|
||||||
|
func reallyreallyreallyreallyreallyreallyreallyreallyreallyreallylongvariable =
|
||||||
|
x
|
||||||
|
|
||||||
|
#test simple multiline pattern
|
||||||
|
func reallyreallyreallyreallyreallyreallyreallyreallyreallyreallylongvariable reallyreallyreallyreallyreallyreallyreallyreallyreallyreallylongvariable
|
||||||
|
= x
|
||||||
|
|
||||||
|
#test another multiline pattern
|
||||||
|
func reallyreallyreallyreallyreallyreallyreallyreallyreallyreallylongvariable a b
|
||||||
|
= x
|
||||||
|
|
||||||
|
#test simple constructor
|
||||||
|
func (A a) = a
|
||||||
|
|
||||||
|
#test list constructor
|
||||||
|
func (x : xr) = x
|
||||||
|
|
||||||
|
#test some other constructor symbol
|
||||||
|
func (x :+: xr) = x
|
||||||
|
|
||||||
|
#test normal infix constructor
|
||||||
|
func (x `Foo` xr) = x
|
||||||
|
|
||||||
|
|
||||||
|
###############################################################################
|
||||||
|
#group decl/binding/guards
|
||||||
|
###############################################################################
|
||||||
|
|
||||||
|
#test simple guard
|
||||||
|
func | True = x
|
||||||
|
|
||||||
|
#test multiple-clauses-1
|
||||||
|
func x | x = simple expression
|
||||||
|
| otherwise = 0
|
||||||
|
|
||||||
|
#test multiple-clauses-2
|
||||||
|
func x
|
||||||
|
| a somewhat longer guard x = "and a somewhat longer expession that does not"
|
||||||
|
| otherwise = "fit without putting the guards in new lines"
|
||||||
|
|
||||||
|
#test multiple-clauses-3
|
||||||
|
func x
|
||||||
|
| very long guard, another rather long guard that refers to x
|
||||||
|
= nontrivial expression foo bar alsdkjlasdjlasj
|
||||||
|
| otherwise
|
||||||
|
= 0
|
||||||
|
|
||||||
|
#test multiple-clauses-4
|
||||||
|
func x
|
||||||
|
| very long guard, another rather long guard that refers to x
|
||||||
|
= nontrivialexpression foo bar alsdkjlasdjlasj
|
||||||
|
| otherwise
|
||||||
|
= 0
|
||||||
|
|
||||||
|
#test multiple-clauses-5
|
||||||
|
func x
|
||||||
|
| very loooooooooooooooooooooooooooooong guard
|
||||||
|
, another rather long guard that refers to x
|
||||||
|
= nontrivial expression foo bar alsdkjlasdjlasj
|
||||||
|
| otherwise
|
||||||
|
= 0
|
|
@ -0,0 +1,271 @@
|
||||||
|
#group module/imports
|
||||||
|
|
||||||
|
|
||||||
|
#test simple-import
|
||||||
|
import Data.List
|
||||||
|
|
||||||
|
#test simple-import-alias
|
||||||
|
import Data.List as L
|
||||||
|
|
||||||
|
#test simple-qualified-import
|
||||||
|
import qualified Data.List
|
||||||
|
|
||||||
|
#test simple-qualified-import-alias
|
||||||
|
import qualified Data.List as L
|
||||||
|
|
||||||
|
#test simple-safe
|
||||||
|
import safe Data.List as L
|
||||||
|
|
||||||
|
#test simple-source
|
||||||
|
import {-# SOURCE #-} Data.List ( )
|
||||||
|
|
||||||
|
#test simple-safe-qualified
|
||||||
|
import safe qualified Data.List
|
||||||
|
|
||||||
|
#test simple-safe-qualified-source
|
||||||
|
import {-# SOURCE #-} safe qualified Data.List
|
||||||
|
|
||||||
|
#test simple-qualified-package
|
||||||
|
import qualified "base" Data.List
|
||||||
|
|
||||||
|
#test qualifier-effect
|
||||||
|
import {-# SOURCE #-} safe qualified "base" Data.List as L
|
||||||
|
import {-# SOURCE #-} safe qualified "base" Data.List ( )
|
||||||
|
import {-# SOURCE #-} safe qualified Data.List hiding ( )
|
||||||
|
|
||||||
|
#test instances-only
|
||||||
|
import qualified Data.List ( )
|
||||||
|
|
||||||
|
#test one-element
|
||||||
|
import Data.List ( nub )
|
||||||
|
|
||||||
|
#test several-elements
|
||||||
|
import Data.List ( foldl'
|
||||||
|
, indexElem
|
||||||
|
, nub
|
||||||
|
)
|
||||||
|
|
||||||
|
#test a-ridiculous-amount-of-elements
|
||||||
|
import Test ( Long
|
||||||
|
, anymore
|
||||||
|
, fit
|
||||||
|
, items
|
||||||
|
, line
|
||||||
|
, list
|
||||||
|
, not
|
||||||
|
, onA
|
||||||
|
, quite
|
||||||
|
, single
|
||||||
|
, that
|
||||||
|
, will
|
||||||
|
, with
|
||||||
|
)
|
||||||
|
|
||||||
|
#test with-things
|
||||||
|
import Test ( (+)
|
||||||
|
, (:!)(..)
|
||||||
|
, (:*)((:.), T7, t7)
|
||||||
|
, (:.)
|
||||||
|
, T
|
||||||
|
, T2()
|
||||||
|
, T3(..)
|
||||||
|
, T4(T4)
|
||||||
|
, T5(T5, t5)
|
||||||
|
, T6((<|>))
|
||||||
|
)
|
||||||
|
|
||||||
|
#test hiding
|
||||||
|
import Test hiding ( )
|
||||||
|
import Test as T
|
||||||
|
hiding ( )
|
||||||
|
|
||||||
|
#test import-hiding-many
|
||||||
|
import Prelude as X
|
||||||
|
hiding ( head
|
||||||
|
, init
|
||||||
|
, last
|
||||||
|
, maximum
|
||||||
|
, minimum
|
||||||
|
, pred
|
||||||
|
, read
|
||||||
|
, readFile
|
||||||
|
, succ
|
||||||
|
, tail
|
||||||
|
, undefined
|
||||||
|
)
|
||||||
|
|
||||||
|
#test long-module-name-simple
|
||||||
|
import TestJustAbitToLongModuleNameLikeThisOneIs
|
||||||
|
( )
|
||||||
|
import TestJustShortEnoughModuleNameLikeThisOne ( )
|
||||||
|
|
||||||
|
#test long-module-name-as
|
||||||
|
import TestJustAbitToLongModuleNameLikeThisOneI
|
||||||
|
as T
|
||||||
|
import TestJustShortEnoughModuleNameLikeThisOn as T
|
||||||
|
|
||||||
|
#test long-module-name-hiding
|
||||||
|
import TestJustAbitToLongModuleNameLikeTh
|
||||||
|
hiding ( )
|
||||||
|
import TestJustShortEnoughModuleNameLike hiding ( )
|
||||||
|
|
||||||
|
#test long-module-name-simple-items
|
||||||
|
import MoreThanSufficientlyLongModuleNameWithSome
|
||||||
|
( compact
|
||||||
|
, fit
|
||||||
|
, inA
|
||||||
|
, items
|
||||||
|
, layout
|
||||||
|
, not
|
||||||
|
, that
|
||||||
|
, will
|
||||||
|
)
|
||||||
|
|
||||||
|
#test long-module-name-hiding-items
|
||||||
|
import TestJustAbitToLongModuleNameLikeTh
|
||||||
|
hiding ( abc
|
||||||
|
, def
|
||||||
|
, ghci
|
||||||
|
, jklm
|
||||||
|
)
|
||||||
|
import TestJustShortEnoughModuleNameLike hiding ( abc
|
||||||
|
, def
|
||||||
|
, ghci
|
||||||
|
, jklm
|
||||||
|
)
|
||||||
|
|
||||||
|
#test long-module-name-other
|
||||||
|
import {-# SOURCE #-} safe qualified "qualifier" A hiding ( )
|
||||||
|
import {-# SOURCE #-} safe qualified "qualifiers" A
|
||||||
|
hiding ( )
|
||||||
|
import {-# SOURCE #-} safe qualified "qualifiers" AlsoAf as T
|
||||||
|
import {-# SOURCE #-} safe qualified "qualifiers" AlsoAff ( )
|
||||||
|
import {-# SOURCE #-} safe qualified "qualifiers" AlsoAff
|
||||||
|
as T
|
||||||
|
import {-# SOURCE #-} safe qualified "qualifiers" AlsoAffe
|
||||||
|
( )
|
||||||
|
|
||||||
|
#test import-with-comments
|
||||||
|
-- Test
|
||||||
|
import Data.List ( nub ) -- Test
|
||||||
|
{- Test -}
|
||||||
|
import qualified Data.List as L
|
||||||
|
( foldl' ) {- Test -}
|
||||||
|
|
||||||
|
-- Test
|
||||||
|
import Test ( test )
|
||||||
|
|
||||||
|
#test import-with-comments-2
|
||||||
|
|
||||||
|
import Test ( abc
|
||||||
|
, def
|
||||||
|
-- comment
|
||||||
|
)
|
||||||
|
|
||||||
|
#test import-with-comments-3
|
||||||
|
|
||||||
|
import Test ( abc
|
||||||
|
-- comment
|
||||||
|
)
|
||||||
|
|
||||||
|
#test import-with-comments-4
|
||||||
|
import Test ( abc
|
||||||
|
-- comment
|
||||||
|
, def
|
||||||
|
, ghi
|
||||||
|
{- comment -}
|
||||||
|
, jkl
|
||||||
|
-- comment
|
||||||
|
)
|
||||||
|
|
||||||
|
#test import-with-comments-5
|
||||||
|
import Test ( -- comment
|
||||||
|
)
|
||||||
|
|
||||||
|
#test long-bindings
|
||||||
|
import TestA ( longbindingNameThatoverflowsColum
|
||||||
|
)
|
||||||
|
import TestB ( Long
|
||||||
|
( List
|
||||||
|
, Of
|
||||||
|
, Things
|
||||||
|
)
|
||||||
|
)
|
||||||
|
|
||||||
|
#test things-with-with-comments
|
||||||
|
import Test ( Thing
|
||||||
|
( -- Comments
|
||||||
|
)
|
||||||
|
)
|
||||||
|
import Test ( Thing
|
||||||
|
( Item
|
||||||
|
-- and Comment
|
||||||
|
)
|
||||||
|
)
|
||||||
|
import Test ( Thing
|
||||||
|
( With
|
||||||
|
-- Comments
|
||||||
|
, and
|
||||||
|
-- also
|
||||||
|
, items
|
||||||
|
-- !
|
||||||
|
)
|
||||||
|
)
|
||||||
|
#test prefer-dense-empty-list
|
||||||
|
import VeryLongModuleNameThatCouldEvenCauseAnEmptyBindingListToExpandIntoMultipleLine
|
||||||
|
( )
|
||||||
|
|
||||||
|
#test preamble full-preamble
|
||||||
|
{-# LANGUAGE BangPatterns #-}
|
||||||
|
|
||||||
|
{-
|
||||||
|
- Test module
|
||||||
|
-}
|
||||||
|
module Test
|
||||||
|
( test1
|
||||||
|
-- ^ test
|
||||||
|
, test2
|
||||||
|
-- | test
|
||||||
|
, test3
|
||||||
|
, test4
|
||||||
|
, test5
|
||||||
|
, test6
|
||||||
|
, test7
|
||||||
|
, test8
|
||||||
|
, test9
|
||||||
|
, test10
|
||||||
|
-- Test 10
|
||||||
|
) where
|
||||||
|
|
||||||
|
-- Test
|
||||||
|
import Data.List ( nub ) -- Test
|
||||||
|
{- Test -}
|
||||||
|
import qualified Data.List as L
|
||||||
|
( foldl' ) {- Test -}
|
||||||
|
|
||||||
|
-- Test
|
||||||
|
import Test ( test )
|
||||||
|
|
||||||
|
#test sorted-imports
|
||||||
|
import Aaa
|
||||||
|
import Baa
|
||||||
|
|
||||||
|
#test sorted-import-groups
|
||||||
|
import Zaa
|
||||||
|
import Zab
|
||||||
|
<BLANKLINE>
|
||||||
|
import Aaa
|
||||||
|
import Baa
|
||||||
|
|
||||||
|
#test sorted-qualified-imports
|
||||||
|
import Boo
|
||||||
|
import qualified Zoo
|
||||||
|
|
||||||
|
#test imports-groups-same-module
|
||||||
|
import Boo ( a )
|
||||||
|
<BLANKLINE>
|
||||||
|
import Boo ( b )
|
||||||
|
|
||||||
|
#test sorted-imports-nested
|
||||||
|
import A.B.C
|
||||||
|
import A.B.D
|
|
@ -0,0 +1,66 @@
|
||||||
|
#group module/top
|
||||||
|
|
||||||
|
|
||||||
|
#test simple
|
||||||
|
module Main where
|
||||||
|
|
||||||
|
#test no-exports
|
||||||
|
module Main () where
|
||||||
|
|
||||||
|
#test one-export
|
||||||
|
module Main (main) where
|
||||||
|
|
||||||
|
#test several-exports
|
||||||
|
module Main (main, test1, test2) where
|
||||||
|
|
||||||
|
#test many-exports
|
||||||
|
module Main
|
||||||
|
( main
|
||||||
|
, test1
|
||||||
|
, test2
|
||||||
|
, test3
|
||||||
|
, test4
|
||||||
|
, test5
|
||||||
|
, test6
|
||||||
|
, test7
|
||||||
|
, test8
|
||||||
|
, test9
|
||||||
|
) where
|
||||||
|
|
||||||
|
#test exports-with-comments
|
||||||
|
module Main
|
||||||
|
( main
|
||||||
|
-- main
|
||||||
|
, test1
|
||||||
|
, test2
|
||||||
|
-- Test 3
|
||||||
|
, test3
|
||||||
|
, test4
|
||||||
|
-- Test 5
|
||||||
|
, test5
|
||||||
|
-- Test 6
|
||||||
|
) where
|
||||||
|
|
||||||
|
#test simple-export-with-things
|
||||||
|
module Main (Test(..)) where
|
||||||
|
|
||||||
|
#test simple-export-with-module-contents
|
||||||
|
module Main (module Main) where
|
||||||
|
|
||||||
|
#test export-with-things
|
||||||
|
module Main (Test(Test, a, b)) where
|
||||||
|
|
||||||
|
#test export-with-things-comment
|
||||||
|
-- comment1
|
||||||
|
|
||||||
|
module Main
|
||||||
|
( Test(Test, a, b)
|
||||||
|
, foo -- comment2
|
||||||
|
) -- comment3
|
||||||
|
where
|
||||||
|
|
||||||
|
#test export-with-empty-thing
|
||||||
|
module Main (Test()) where
|
||||||
|
|
||||||
|
#test empty-with-comment
|
||||||
|
-- Intentionally left empty
|
|
@ -0,0 +1,249 @@
|
||||||
|
#group expression/op-precedence
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
#test basic precedence-aware layouting
|
||||||
|
operatorExpr1 =
|
||||||
|
( foo1 * barrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrr1
|
||||||
|
+ foo2 * barrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrr2
|
||||||
|
+ foo3 * barrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrr3
|
||||||
|
+ foo4 * barrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrr4
|
||||||
|
+ foo5 * barrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrr5
|
||||||
|
+ foo6 * barrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrr6
|
||||||
|
+ foo7 * barrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrr7
|
||||||
|
+ foo8 * barrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrr8
|
||||||
|
+ foo9 * barrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrr9
|
||||||
|
)
|
||||||
|
|
||||||
|
#test nested different precedences
|
||||||
|
operatorExpr2 =
|
||||||
|
( foo1 * barrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrr1
|
||||||
|
+ foo2 * barrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrr2
|
||||||
|
+ foo3 * barrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrr3
|
||||||
|
+ foo4 * barrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrr4
|
||||||
|
== foo5 * barrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrr5
|
||||||
|
+ foo6 * barrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrr6
|
||||||
|
+ foo7 * barrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrr7
|
||||||
|
+ foo8 * barrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrr8
|
||||||
|
+ foo9 * barrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrr9
|
||||||
|
)
|
||||||
|
|
||||||
|
#test simple comment respecting
|
||||||
|
alternatives = -- a
|
||||||
|
( -- b
|
||||||
|
alternativeOne -- c
|
||||||
|
<|> alterantiveTwo -- d
|
||||||
|
<|> alternativeThree -- e
|
||||||
|
) -- f
|
||||||
|
|
||||||
|
#golden retaining comments while minimizing duplicated parens
|
||||||
|
#pending
|
||||||
|
-- brittany { lconfig_operatorParenthesisRefactorMode: PRMMinimize }
|
||||||
|
alternatives = -- a
|
||||||
|
x
|
||||||
|
+ ( -- b
|
||||||
|
( -- c
|
||||||
|
alternativeOne -- c
|
||||||
|
<|> alterantiveTwo -- d
|
||||||
|
<|> alternativeThree -- e
|
||||||
|
) -- f
|
||||||
|
) -- g
|
||||||
|
#expected
|
||||||
|
-- brittany { lconfig_operatorParenthesisRefactorMode: PRMMinimize }
|
||||||
|
alternatives = -- a
|
||||||
|
x
|
||||||
|
+ -- b
|
||||||
|
( -- c
|
||||||
|
alternativeOne -- c
|
||||||
|
<|> alterantiveTwo -- d
|
||||||
|
<|> alternativeThree -- e
|
||||||
|
) -- f -- g
|
||||||
|
|
||||||
|
#golden refactoring unnecessary parens basic example
|
||||||
|
-- brittany { lconfig_operatorParenthesisRefactorMode: PRMMinimize }
|
||||||
|
operatorExpr1 =
|
||||||
|
( (goo1 * barrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrr1)
|
||||||
|
+ goo2 * barrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrr2
|
||||||
|
+ goo3 * barrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrr3
|
||||||
|
+ goo4 * barrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrr4
|
||||||
|
)
|
||||||
|
#expected
|
||||||
|
-- brittany { lconfig_operatorParenthesisRefactorMode: PRMMinimize }
|
||||||
|
operatorExpr1 =
|
||||||
|
( goo1 * barrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrr1
|
||||||
|
+ goo2 * barrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrr2
|
||||||
|
+ goo3 * barrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrr3
|
||||||
|
+ goo4 * barrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrr4
|
||||||
|
)
|
||||||
|
|
||||||
|
#test feature flag fixityAwareOps works
|
||||||
|
-- brittany { lconfig_fixityAwareOps: False }
|
||||||
|
operatorExpr1 =
|
||||||
|
( goo1
|
||||||
|
* barrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrr1
|
||||||
|
+ goo2
|
||||||
|
* barrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrr2
|
||||||
|
+ goo3
|
||||||
|
* barrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrr3
|
||||||
|
+ goo4
|
||||||
|
* barrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrr4
|
||||||
|
+ goo5
|
||||||
|
* barrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrr5
|
||||||
|
+ goo6
|
||||||
|
* barrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrr6
|
||||||
|
+ goo7
|
||||||
|
* barrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrr7
|
||||||
|
+ goo8
|
||||||
|
* barrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrr8
|
||||||
|
+ goo9
|
||||||
|
* barrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrr9
|
||||||
|
)
|
||||||
|
|
||||||
|
#golden op-app simple golden test
|
||||||
|
operatorExpr1 =
|
||||||
|
( goo1
|
||||||
|
* barrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrr1
|
||||||
|
+ goo2
|
||||||
|
* barrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrr2
|
||||||
|
+ goo3
|
||||||
|
* barrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrr3
|
||||||
|
+ goo4
|
||||||
|
* barrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrr4
|
||||||
|
+ goo5
|
||||||
|
* barrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrr5
|
||||||
|
+ goo6
|
||||||
|
* barrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrr6
|
||||||
|
+ goo7
|
||||||
|
* barrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrr7
|
||||||
|
+ goo8
|
||||||
|
* barrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrr8
|
||||||
|
+ goo9
|
||||||
|
* barrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrr9
|
||||||
|
)
|
||||||
|
#expected
|
||||||
|
operatorExpr1 =
|
||||||
|
( goo1 * barrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrr1
|
||||||
|
+ goo2 * barrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrr2
|
||||||
|
+ goo3 * barrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrr3
|
||||||
|
+ goo4 * barrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrr4
|
||||||
|
+ goo5 * barrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrr5
|
||||||
|
+ goo6 * barrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrr6
|
||||||
|
+ goo7 * barrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrr7
|
||||||
|
+ goo8 * barrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrr8
|
||||||
|
+ goo9 * barrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrr9
|
||||||
|
)
|
||||||
|
|
||||||
|
#golden op-app mixed golden
|
||||||
|
doop =
|
||||||
|
some long invocation ==
|
||||||
|
loooooooooongman + (third nested expression)
|
||||||
|
- 4 && {- meow -} 5
|
||||||
|
- 6
|
||||||
|
> 7
|
||||||
|
`mod` loooooooooongwoman || ill just invoke a function with these args
|
||||||
|
|| foo && dooasdoiaosdoi ** oaisdoioasido <= asduiuaisduiasdu + asdahjsd + ahsjdhjhasd
|
||||||
|
#expected
|
||||||
|
doop =
|
||||||
|
some long invocation == loooooooooongman + (third nested expression) - 4
|
||||||
|
&& {- meow -} 5 - 6 > 7 `mod` loooooooooongwoman
|
||||||
|
|| ill just invoke a function with these args
|
||||||
|
|| foo
|
||||||
|
&& dooasdoiaosdoi ** oaisdoioasido
|
||||||
|
<= asduiuaisduiasdu + asdahjsd + ahsjdhjhasd
|
||||||
|
|
||||||
|
#golden op-app mixed golden with added parens
|
||||||
|
-- brittany { lconfig_fixityBasedAddAlignParens: True }
|
||||||
|
doop =
|
||||||
|
some long invocation ==
|
||||||
|
loooooooooongman + (third nested expression)
|
||||||
|
- 4 && {- meow -} 5
|
||||||
|
- 6
|
||||||
|
> 7
|
||||||
|
`mod` loooooooooongwoman || ill just invoke a function with these args
|
||||||
|
|| foo && dooasdoiaosdoi ** oaisdoioasido <= asduiuaisduiasdu + asdahjsd + ahsjdhjhasd
|
||||||
|
#expected
|
||||||
|
-- brittany { lconfig_fixityBasedAddAlignParens: True }
|
||||||
|
doop =
|
||||||
|
( ( some long invocation == loooooooooongman + (third nested expression) - 4
|
||||||
|
&& {- meow -} 5 - 6 > 7 `mod` loooooooooongwoman
|
||||||
|
)
|
||||||
|
|| ill just invoke a function with these args
|
||||||
|
|| ( foo
|
||||||
|
&& ( dooasdoiaosdoi ** oaisdoioasido
|
||||||
|
<= asduiuaisduiasdu + asdahjsd + ahsjdhjhasd
|
||||||
|
)
|
||||||
|
)
|
||||||
|
)
|
||||||
|
|
||||||
|
#golden multiline mixed op expression 1
|
||||||
|
-- brittany { lconfig_fixityBasedAddAlignParens: True }
|
||||||
|
meow =
|
||||||
|
[docSeparator, docForceSL od1, docSeparator, docForceSL ed1]
|
||||||
|
++ join
|
||||||
|
[ [docSeparator, docForceSingleline od, docSeparator, docForceSingleline ed]
|
||||||
|
| (od, ed) <- ems
|
||||||
|
]
|
||||||
|
++ [docSeparator, docForceSingleline odN, docSeparator, lastWrap edN]
|
||||||
|
#expected
|
||||||
|
-- brittany { lconfig_fixityBasedAddAlignParens: True }
|
||||||
|
meow =
|
||||||
|
( [docSeparator, docForceSL od1, docSeparator, docForceSL ed1]
|
||||||
|
++ join
|
||||||
|
[ [ docSeparator
|
||||||
|
, docForceSingleline od
|
||||||
|
, docSeparator
|
||||||
|
, docForceSingleline ed
|
||||||
|
]
|
||||||
|
| (od, ed) <- ems
|
||||||
|
]
|
||||||
|
++ [docSeparator, docForceSingleline odN, docSeparator, lastWrap edN]
|
||||||
|
)
|
||||||
|
|
||||||
|
#golden multiline mixed op expression 2
|
||||||
|
-- brittany { lconfig_fixityBasedAddAlignParens: True }
|
||||||
|
meow =
|
||||||
|
[docSeparator, docForceSingleline od1, docSeparator, docForceSingleline ed1, something]
|
||||||
|
++ join
|
||||||
|
[ [docSeparator, docForceSingleline od, docSeparator, docForceSingleline ed]
|
||||||
|
| (od, ed) <- ems
|
||||||
|
]
|
||||||
|
++ [docSeparator, docForceSingleline odN, docSeparator, lastWrap edN, something]
|
||||||
|
#expected
|
||||||
|
-- brittany { lconfig_fixityBasedAddAlignParens: True }
|
||||||
|
meow =
|
||||||
|
( [ docSeparator
|
||||||
|
, docForceSingleline od1
|
||||||
|
, docSeparator
|
||||||
|
, docForceSingleline ed1
|
||||||
|
, something
|
||||||
|
]
|
||||||
|
++ join
|
||||||
|
[ [ docSeparator
|
||||||
|
, docForceSingleline od
|
||||||
|
, docSeparator
|
||||||
|
, docForceSingleline ed
|
||||||
|
]
|
||||||
|
| (od, ed) <- ems
|
||||||
|
]
|
||||||
|
++ [ docSeparator
|
||||||
|
, docForceSingleline odN
|
||||||
|
, docSeparator
|
||||||
|
, lastWrap edN
|
||||||
|
, something
|
||||||
|
]
|
||||||
|
)
|
||||||
|
|
||||||
|
#test operator-paren-alignment inside do and other op
|
||||||
|
func = do
|
||||||
|
other
|
||||||
|
( aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
|
||||||
|
**~ bbbbbbbbbbbbbbbbbb
|
||||||
|
**~ cccccccccccccccccccccccccccccccccccccccccccccccccc
|
||||||
|
)
|
||||||
|
== 13
|
||||||
|
|
||||||
|
#test allow lambdacase parspacing after operator
|
||||||
|
foo = do
|
||||||
|
abc `forM_` \case
|
||||||
|
True -> 1
|
||||||
|
False -> 0
|
|
@ -0,0 +1,29 @@
|
||||||
|
#group type signatures/pragmas
|
||||||
|
|
||||||
|
#test inline pragma 1
|
||||||
|
func = f
|
||||||
|
where
|
||||||
|
{-# INLINE f #-}
|
||||||
|
f = id
|
||||||
|
|
||||||
|
#test inline pragma 2
|
||||||
|
func = ($)
|
||||||
|
where
|
||||||
|
{-# INLINE ($) #-}
|
||||||
|
($) = id
|
||||||
|
|
||||||
|
#test inline pragma 3
|
||||||
|
func = f
|
||||||
|
where
|
||||||
|
{-# INLINE CONLIKE [1] f #-}
|
||||||
|
f = id
|
||||||
|
|
||||||
|
#test noinline pragma 1
|
||||||
|
{-# NOINLINE func #-}
|
||||||
|
func :: Int
|
||||||
|
|
||||||
|
#test inline pragma 4
|
||||||
|
func = f
|
||||||
|
where
|
||||||
|
{-# INLINE [~1] f #-}
|
||||||
|
f = id
|
|
@ -0,0 +1,265 @@
|
||||||
|
#group type signatures
|
||||||
|
|
||||||
|
|
||||||
|
#test simple001
|
||||||
|
func :: a -> a
|
||||||
|
|
||||||
|
#test long typeVar
|
||||||
|
func
|
||||||
|
:: lkasdlkjalsdjlakjsdlkjasldkjalskdjlkajsd
|
||||||
|
-> lkasdlkjalsdjlakjsdlkjasldkjalskdjlkajsd
|
||||||
|
|
||||||
|
#test keep linebreak mode
|
||||||
|
func
|
||||||
|
:: lkasdlkjalsdjlakjsdlkjasldkjalskdjlkajsd
|
||||||
|
-> lakjsdlkjasldkj
|
||||||
|
-> lakjsdlkjasldkj
|
||||||
|
|
||||||
|
#test simple parens 1
|
||||||
|
func :: ((a))
|
||||||
|
|
||||||
|
#test simple parens 2
|
||||||
|
func :: (a -> a) -> a
|
||||||
|
|
||||||
|
#test simple parens 3
|
||||||
|
func :: a -> (a -> a)
|
||||||
|
|
||||||
|
#test did anyone say parentheses?
|
||||||
|
func :: (((((((((())))))))))
|
||||||
|
|
||||||
|
-- current output is.. funny. wonder if that can/needs to be improved..
|
||||||
|
#test give me more!
|
||||||
|
#pending nested tuples over line length
|
||||||
|
func :: ((((((((((((((((((((((((((((((((((((((((((()))))))))))))))))))))))))))))))))))))))))))
|
||||||
|
|
||||||
|
#test unit
|
||||||
|
func :: ()
|
||||||
|
|
||||||
|
|
||||||
|
###############################################################################
|
||||||
|
|
||||||
|
#test paren'd func 1
|
||||||
|
func
|
||||||
|
:: ( lkasdlkjalsdjlakjsdlkjasldkjalskdjlkajsd
|
||||||
|
-> lakjsdlkjasldkj
|
||||||
|
-> lakjsdlkjasldkj
|
||||||
|
)
|
||||||
|
|
||||||
|
#test paren'd func 2
|
||||||
|
func
|
||||||
|
:: lkasdlkjalsdjlakjsdlkjasldkjalskdjlkajsd
|
||||||
|
-> (lakjsdlkjasldkj -> lakjsdlkjasldkj)
|
||||||
|
|
||||||
|
#test paren'd func 3
|
||||||
|
func
|
||||||
|
:: (lkasdlkjalsdjlakjsdlkjasldkjalskdjlkajsd -> lakjsdlkjasldkj)
|
||||||
|
-> lakjsdlkjasldkj
|
||||||
|
|
||||||
|
#test paren'd func 4
|
||||||
|
func
|
||||||
|
:: ( lkasdlkjalsdjlakjsdlkjasldkjalskdjlkajsd
|
||||||
|
-> lkasdlkjalsdjlakjsdlkjasldkjalskdjlkajsd
|
||||||
|
)
|
||||||
|
-> lakjsdlkjasldkj
|
||||||
|
|
||||||
|
#test paren'd func 5
|
||||||
|
func
|
||||||
|
:: ( ( lkasdlkjalsdjlakjsdlkjasldkjalskdjlkajsd
|
||||||
|
-> lkasdlkjalsdjlakjsdlkjasldkjalskdjlkajsd
|
||||||
|
)
|
||||||
|
)
|
||||||
|
|
||||||
|
###############################################################################
|
||||||
|
|
||||||
|
#test type application 1
|
||||||
|
func :: asd -> Either a b
|
||||||
|
|
||||||
|
#test type application 2
|
||||||
|
func
|
||||||
|
:: asd
|
||||||
|
-> Either
|
||||||
|
lkasdlkjalsdjlakjsdlkjasldkjalskdjlkajsd
|
||||||
|
lkasdlkjalsdjlakjsdlkjasldkjalskdjlkajsd
|
||||||
|
|
||||||
|
#test type application 3
|
||||||
|
func
|
||||||
|
:: asd
|
||||||
|
-> Trither
|
||||||
|
lkasdlkjalsdjlakjsdlkjasldkjalskdjlkajsd
|
||||||
|
lkasdlkjalsdjlakjsdlkjasldkjalskdjlkajsd
|
||||||
|
lkasdlkjalsdjlakjsdlkjasldkjalskdjlkajsd
|
||||||
|
|
||||||
|
#test type application 4
|
||||||
|
func
|
||||||
|
:: Trither
|
||||||
|
lkasdlkjalsdjlakjsdlkjasldkjalskdjlkajsd
|
||||||
|
lkasdlkjalsdjlakjsdlkjasldkjalskdjlkajsd
|
||||||
|
lkasdlkjalsdjlakjsdlkjasldkjalskdjlkajsd
|
||||||
|
-> asd
|
||||||
|
|
||||||
|
#test type application 5
|
||||||
|
func
|
||||||
|
:: Trither
|
||||||
|
lkasdlkjalsdjlakjsdlkjasldkjalskdjlkajsd
|
||||||
|
lkasdlkjalsdjlakjsdlkjasldkjalskdjlkajsd
|
||||||
|
(lkasdlkjalsdjlakjsdlkjasldkjalskdjlkajsd -> asd)
|
||||||
|
|
||||||
|
#test type application 6
|
||||||
|
func
|
||||||
|
:: Trither
|
||||||
|
asd
|
||||||
|
lkasdlkjalsdjlakjsdlkjasldkjalskdjlkajsd
|
||||||
|
( lkasdlkjalsdjlakjsdlkjasldkjalskdjlkajsd
|
||||||
|
-> lkasdlkjalsdjlakjsdlkjasldkjalskdjlkajsd
|
||||||
|
)
|
||||||
|
|
||||||
|
#test type application paren 1
|
||||||
|
func
|
||||||
|
:: asd
|
||||||
|
-> ( Trither
|
||||||
|
lkasdlkjalsdjlakjsdlkjasldkjalskdjlkajsd
|
||||||
|
lkasdlkjalsdjlakjsdlkjasldkjalskdjlkajsd
|
||||||
|
lkasdlkjalsdjlakjsdlkjasldkjalskdjlkajsd
|
||||||
|
)
|
||||||
|
|
||||||
|
#test type application paren 2
|
||||||
|
func
|
||||||
|
:: asd
|
||||||
|
-> ( Trither
|
||||||
|
lkasdlkjalsdjlakjsdlkjasldkjalskdjlkajsd
|
||||||
|
lkasdlkjalsdjlakjsdlkjasldkjalskdjlkajsd
|
||||||
|
)
|
||||||
|
lkasdlkjalsdjlakjsdlkjasldkjalskdjlkajsd
|
||||||
|
|
||||||
|
#test type application paren 3
|
||||||
|
func
|
||||||
|
:: ( Trither
|
||||||
|
lkasdlkjalsdjlakjsdlkjasldkjalskdjlkajsd
|
||||||
|
lkasdlkjalsdjlakjsdlkjasldkjalskdjlkajsd
|
||||||
|
)
|
||||||
|
lkasdlkjalsdjlakjsdlkjasldkjalskdjlkajsd
|
||||||
|
-> asd
|
||||||
|
|
||||||
|
###############################################################################
|
||||||
|
|
||||||
|
#test list simple
|
||||||
|
func :: [a -> b]
|
||||||
|
|
||||||
|
#test list func
|
||||||
|
func
|
||||||
|
:: [ lkasdlkjalsdjlakjsdlkjasldkjalskdjlkajsd
|
||||||
|
-> lkasdlkjalsdjlakjsdlkjasldkjalskdjlkajsd
|
||||||
|
]
|
||||||
|
|
||||||
|
#test list paren
|
||||||
|
func
|
||||||
|
:: [ ( lkasdlkjalsdjlakjsdlkjasldkjalskdjlkajsd
|
||||||
|
-> lkasdlkjalsdjlakjsdlkjasldkjalskdjlkajsd
|
||||||
|
)
|
||||||
|
]
|
||||||
|
|
||||||
|
################################################################## -- #############
|
||||||
|
|
||||||
|
#test tuple type 1
|
||||||
|
func :: (a, b, c)
|
||||||
|
|
||||||
|
#test tuple type 2
|
||||||
|
func :: ((a, b, c), (a, b, c), (a, b, c))
|
||||||
|
|
||||||
|
#test tuple type long
|
||||||
|
func
|
||||||
|
:: ( lkasdlkjalsdjlakjsdlkjasldkjalskdjlkajsd
|
||||||
|
, lkasdlkjalsdjlakjsdlkjasldkjalskdjlkajsd
|
||||||
|
, lkasdlkjalsdjlakjsdlkjasldkjalskdjlkajsd
|
||||||
|
)
|
||||||
|
|
||||||
|
#test tuple type nested
|
||||||
|
func
|
||||||
|
:: ( ( lkasdlkjalsdjlakjsdlkjasldkjalskdjlkajsd
|
||||||
|
, (lkasdlkjalsdjlakjsdlkjasldkjalskdjlkajsd)
|
||||||
|
, lkasdlkjalsdjlakjsdlkjasldkjalskdjlkajsd
|
||||||
|
)
|
||||||
|
)
|
||||||
|
|
||||||
|
#test tuple type function
|
||||||
|
func
|
||||||
|
:: [ ( lkasdlkjalsdjlakjsdlkjasldkjalskdjlkajsd
|
||||||
|
, lkasdlkjalsdjlakjsdlkjasldkjalskdjlkajsd
|
||||||
|
, lkasdlkjalsdjlakjsdlkjasldkjalskdjlkajsd
|
||||||
|
)
|
||||||
|
]
|
||||||
|
###############################################################################
|
||||||
|
#test type operator stuff
|
||||||
|
#pending HsOpTy
|
||||||
|
test050 :: a :+: b
|
||||||
|
test051 :: lkasdlkjalsdjlakjsdlkjasldkjalskdjlkajsd
|
||||||
|
:+: lkasdlkjalsdjlakjsdlkjasldkjalskdjlkajsd
|
||||||
|
test052 :: lkasdlkjalsdjlakjsdlkjasldkjalskdjlkajsd
|
||||||
|
-> lkasdlkjalsdjlakjsdlkjasldkjalskdjlkajsd
|
||||||
|
:+: lkasdlkjalsdjlakjsdlkjasldkjalskdjlkajsd
|
||||||
|
-> lkasdlkjalsdjlakjsdlkjasldkjalskdjlkajsd
|
||||||
|
|
||||||
|
###############################################################################
|
||||||
|
|
||||||
|
#test forall oneliner
|
||||||
|
{-# LANGUAGE ScopedTypeVariables #-}
|
||||||
|
func :: forall (a :: *) b . a -> b
|
||||||
|
|
||||||
|
#test forall context multiline
|
||||||
|
{-# LANGUAGE ScopedTypeVariables #-}
|
||||||
|
func
|
||||||
|
:: forall m
|
||||||
|
. Foo
|
||||||
|
=> ColMap2
|
||||||
|
-> ColInfo
|
||||||
|
-> ColInfo
|
||||||
|
-> ColInfo
|
||||||
|
-> ColInfo
|
||||||
|
-> m ()
|
||||||
|
|
||||||
|
#test forall no-context multiline
|
||||||
|
{-# LANGUAGE ScopedTypeVariables #-}
|
||||||
|
func
|
||||||
|
:: forall m
|
||||||
|
. ColMap2
|
||||||
|
-> ColInfo
|
||||||
|
-> ColInfo
|
||||||
|
-> ColInfo
|
||||||
|
-> ColInfo
|
||||||
|
-> ColInfo
|
||||||
|
-> m ()
|
||||||
|
|
||||||
|
#test forall context multiline with comments
|
||||||
|
{-# LANGUAGE RankNTypes #-}
|
||||||
|
addFlagStringParam
|
||||||
|
:: forall f out
|
||||||
|
. (Applicative f)
|
||||||
|
=> String -- ^ short flag chars, i.e. "v" for -v
|
||||||
|
-> [String] -- ^ list of long names, i.e. ["verbose"]
|
||||||
|
-> String -- ^ param name
|
||||||
|
-> Flag String -- ^ properties
|
||||||
|
-> CmdParser f out String
|
||||||
|
|
||||||
|
#test language pragma issue
|
||||||
|
{-# LANGUAGE ScopedTypeVariables #-}
|
||||||
|
func :: forall (a :: *) b . a -> b
|
||||||
|
|
||||||
|
#test comments 1
|
||||||
|
func :: a -> b -- comment
|
||||||
|
|
||||||
|
#test comments 2
|
||||||
|
funcA :: a -> b -- comment A
|
||||||
|
funcB :: a -> b -- comment B
|
||||||
|
|
||||||
|
#test comments all
|
||||||
|
-- a
|
||||||
|
func -- b
|
||||||
|
:: -- c
|
||||||
|
a -- d
|
||||||
|
-> -- e
|
||||||
|
( -- f
|
||||||
|
c -- g
|
||||||
|
, -- h
|
||||||
|
d -- i
|
||||||
|
) -- j
|
||||||
|
-- k
|
|
@ -0,0 +1,94 @@
|
||||||
|
#group decl/type synonyms
|
||||||
|
|
||||||
|
|
||||||
|
#test simple-synonym
|
||||||
|
|
||||||
|
type MySynonym = String
|
||||||
|
|
||||||
|
#test parameterised-synonym
|
||||||
|
|
||||||
|
type MySynonym a = [a]
|
||||||
|
|
||||||
|
#test long-function-synonym
|
||||||
|
|
||||||
|
-- | Important comment thrown in
|
||||||
|
type MySynonym b a
|
||||||
|
= MySynonym a b -> MySynonym a b -> MyParamType a b -> MyParamType a b
|
||||||
|
|
||||||
|
#test overflowing-function-synonym
|
||||||
|
|
||||||
|
type MySynonym3 b a
|
||||||
|
= MySynonym a b
|
||||||
|
-> MySynonym a b
|
||||||
|
-- ^ RandomComment
|
||||||
|
-> MyParamType a b
|
||||||
|
-> MyParamType a b
|
||||||
|
-> MySynonym2 b a
|
||||||
|
|
||||||
|
#test synonym-with-kind-sig
|
||||||
|
|
||||||
|
{-# LANGUAGE StarIsType #-}
|
||||||
|
|
||||||
|
type MySynonym (a :: * -> *)
|
||||||
|
= MySynonym a b
|
||||||
|
-> MySynonym a b
|
||||||
|
-> MyParamType a b
|
||||||
|
-> MyParamType a b
|
||||||
|
-> MySynonym2 b a
|
||||||
|
|
||||||
|
#test synonym-with-constraint
|
||||||
|
|
||||||
|
type MySynonym a = Num a => a -> Int
|
||||||
|
|
||||||
|
#test synonym-overflowing-with-constraint
|
||||||
|
|
||||||
|
type MySynonym a
|
||||||
|
= Num a
|
||||||
|
=> AReallyLongTypeName
|
||||||
|
-> AnotherReallyLongTypeName
|
||||||
|
-> AThirdTypeNameToOverflow
|
||||||
|
|
||||||
|
#test synonym-forall
|
||||||
|
|
||||||
|
{-# LANGUAGE RankNTypes #-}
|
||||||
|
|
||||||
|
type MySynonym = forall a . [a]
|
||||||
|
|
||||||
|
#test synonym-operator
|
||||||
|
|
||||||
|
type (:+:) a b = (a, b)
|
||||||
|
|
||||||
|
#test synonym-infix
|
||||||
|
|
||||||
|
type a `MySynonym` b = a -> b
|
||||||
|
|
||||||
|
#test synonym-infix-operator
|
||||||
|
|
||||||
|
type a :+: b = (a, b)
|
||||||
|
|
||||||
|
#test synonym-infix-parens
|
||||||
|
|
||||||
|
type (a `Foo` b) c = (a, b, c)
|
||||||
|
|
||||||
|
#test synonym-comments
|
||||||
|
|
||||||
|
type Foo a -- fancy type comment
|
||||||
|
= -- strange comment
|
||||||
|
Int
|
||||||
|
|
||||||
|
#test synonym-type-operators
|
||||||
|
type (a :+: b) = (a, b)
|
||||||
|
|
||||||
|
#test synonym-multi-parens
|
||||||
|
#pending loses extra parens
|
||||||
|
|
||||||
|
type ((a :+: b) c) = (a, c)
|
||||||
|
|
||||||
|
#test synonym-tuple-type-many-comments
|
||||||
|
|
||||||
|
type Foo
|
||||||
|
= ( -- t1
|
||||||
|
A -- t2
|
||||||
|
, -- t3
|
||||||
|
B -- t4
|
||||||
|
) -- t5
|
|
@ -0,0 +1,80 @@
|
||||||
|
#group extensions/datakinds-promoted-types
|
||||||
|
|
||||||
|
### The spaces before commas are undesirable
|
||||||
|
#test 1
|
||||||
|
test :: Proxy '[ 'True ]
|
||||||
|
test = Proxy @'[ 'True ]
|
||||||
|
#test 2
|
||||||
|
test :: Proxy '[True]
|
||||||
|
test = Proxy @'[True]
|
||||||
|
#test 3
|
||||||
|
test :: Proxy '[ 'True, False ]
|
||||||
|
test = Proxy @'[ 'True, False ]
|
||||||
|
#test 4
|
||||||
|
test :: Proxy '[True, False]
|
||||||
|
test = Proxy @'[True, False]
|
||||||
|
#test 5
|
||||||
|
test :: Proxy '[True, 'False]
|
||||||
|
test = Proxy @'[True, 'False]
|
||||||
|
#test 6
|
||||||
|
test :: Proxy '[ 'True, 'False ]
|
||||||
|
test = Proxy @'[ 'True, 'False ]
|
||||||
|
#test 7
|
||||||
|
test :: Proxy '[ 'Just 'True, False ]
|
||||||
|
test = Proxy @'[ 'Just 'True, False ]
|
||||||
|
#test 8
|
||||||
|
test :: Proxy '[Just True, False]
|
||||||
|
test = Proxy @'[Just True, False]
|
||||||
|
#test 9
|
||||||
|
test :: Proxy '[('True)]
|
||||||
|
test = Proxy @'[('True)]
|
||||||
|
#test 10
|
||||||
|
test :: Proxy ('Just 'True)
|
||||||
|
test = Proxy @('Just 'True)
|
||||||
|
#test 11
|
||||||
|
test :: Proxy ('True)
|
||||||
|
test = Proxy @('True)
|
||||||
|
|
||||||
|
#test with-comment-1
|
||||||
|
test
|
||||||
|
:: Proxy '[-- comment
|
||||||
|
'True ]
|
||||||
|
test = Proxy @'[-- comment
|
||||||
|
'True ]
|
||||||
|
|
||||||
|
#test with-comment-2
|
||||||
|
test
|
||||||
|
:: Proxy '[-- comment
|
||||||
|
True]
|
||||||
|
test = Proxy @'[-- comment
|
||||||
|
True]
|
||||||
|
|
||||||
|
#test with-comment-3
|
||||||
|
test
|
||||||
|
:: Proxy '[{- comment -} 'True ]
|
||||||
|
test = Proxy @'[{- comment -} 'True ]
|
||||||
|
|
||||||
|
#test with-comment-4
|
||||||
|
test
|
||||||
|
:: Proxy '[{- comment -}
|
||||||
|
'True ]
|
||||||
|
test = Proxy @'[{- comment -}
|
||||||
|
'True ]
|
||||||
|
|
||||||
|
#test with-comment-5
|
||||||
|
test
|
||||||
|
:: Proxy '[{- comment -} True]
|
||||||
|
test = Proxy @'[{- comment -} True]
|
||||||
|
|
||||||
|
#test with-comment-6
|
||||||
|
test
|
||||||
|
:: Proxy '[{- comment -}
|
||||||
|
True]
|
||||||
|
test = Proxy @'[{- comment -}
|
||||||
|
True]
|
||||||
|
|
||||||
|
#test explicit-list-type non-promoted
|
||||||
|
type Foo = '[Bool, Bool, Bool]
|
||||||
|
|
||||||
|
#test explicit-list-type promoted
|
||||||
|
type Foo = '[ 'Bool, Bool, Bool ]
|
|
@ -0,0 +1,28 @@
|
||||||
|
#group extensions/implicitparams
|
||||||
|
|
||||||
|
|
||||||
|
#test ImplicitParams 1
|
||||||
|
{-# LANGUAGE ImplicitParams #-}
|
||||||
|
func :: (?asd::Int) -> ()
|
||||||
|
|
||||||
|
#test ImplicitParams 2
|
||||||
|
{-# LANGUAGE ImplicitParams #-}
|
||||||
|
func
|
||||||
|
:: ( ?asd
|
||||||
|
:: lkasdlkjalsdjlakjsdlkjasldkjalskdjlkajsd
|
||||||
|
-> lkasdlkjalsdjlakjsdlkjasldkjalskdjlkajsd
|
||||||
|
)
|
||||||
|
-> ()
|
||||||
|
|
||||||
|
#test IP usage
|
||||||
|
{-# LANGUAGE ImplicitParams #-}
|
||||||
|
foo = ?bar
|
||||||
|
|
||||||
|
#test IP binding
|
||||||
|
{-# LANGUAGE ImplicitParams #-}
|
||||||
|
foo = let ?bar = Foo in value
|
||||||
|
|
||||||
|
#test IP type signature
|
||||||
|
{-# LANGUAGE ImplicitParams #-}
|
||||||
|
foo :: (?bar::Bool) => ()
|
||||||
|
foo = ()
|
|
@ -1,3 +1,7 @@
|
||||||
|
#group extensions/lambdacase
|
||||||
|
|
||||||
|
|
||||||
|
#test lambdacase 1
|
||||||
{-# LANGUAGE LambdaCase #-}
|
{-# LANGUAGE LambdaCase #-}
|
||||||
func = \case
|
func = \case
|
||||||
FooBar -> x
|
FooBar -> x
|
|
@ -0,0 +1,23 @@
|
||||||
|
#group extensions/multiwayif
|
||||||
|
|
||||||
|
|
||||||
|
#test multiwayif 1
|
||||||
|
{-# LANGUAGE MultiWayIf #-}
|
||||||
|
func = if
|
||||||
|
| cond1 -> loooooooooooooooooooooooooooooong expr1
|
||||||
|
| cond2 -> loooooooooooooooooooooooooooooong expr2
|
||||||
|
|
||||||
|
#test multiwayif 2
|
||||||
|
{-# LANGUAGE MultiWayIf #-}
|
||||||
|
func = do
|
||||||
|
foo
|
||||||
|
bar $ if
|
||||||
|
| cond1 -> loooooooooooooooooooooooooooooong expr1
|
||||||
|
| cond2 -> loooooooooooooooooooooooooooooong expr2
|
||||||
|
|
||||||
|
#test multiwayif comment between cases
|
||||||
|
func = do
|
||||||
|
if
|
||||||
|
| abc -> yes
|
||||||
|
-- | test comment
|
||||||
|
| _ -> no
|
|
@ -0,0 +1,10 @@
|
||||||
|
#group extensions/overloadedlabels
|
||||||
|
|
||||||
|
|
||||||
|
#test bare label
|
||||||
|
{-# LANGUAGE OverloadedLabels #-}
|
||||||
|
foo = #bar
|
||||||
|
|
||||||
|
#test applied and composed label
|
||||||
|
{-# LANGUAGE OverloadedLabels #-}
|
||||||
|
foo = #bar . #baz $ fmap #foo xs
|
|
@ -0,0 +1,24 @@
|
||||||
|
#group extensions/overloadedrecorddot
|
||||||
|
|
||||||
|
#test getfield
|
||||||
|
{-# LANGUAGE OverloadedRecordDot #-}
|
||||||
|
recorddot1 = a.b.c
|
||||||
|
|
||||||
|
#test getfield
|
||||||
|
{-# LANGUAGE OverloadedRecordDot #-}
|
||||||
|
recorddot2 =
|
||||||
|
{-before-} a.b.c {-after-}
|
||||||
|
|
||||||
|
#test projection
|
||||||
|
{-# LANGUAGE OverloadedRecordDot #-}
|
||||||
|
recorddot3 =
|
||||||
|
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
|
||||||
|
& (.bbbbbbbbbbbbbbbbbbbbbbbbbbb)
|
||||||
|
& (.ccccccccccccccccccccccccccccccccccccc)
|
||||||
|
& (.ddddddddddddddddddddddddddddddddddddddddddddddddddd)
|
||||||
|
|
||||||
|
#test projection too long
|
||||||
|
{-# LANGUAGE OverloadedRecordDot #-}
|
||||||
|
recorddot4 =
|
||||||
|
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
|
||||||
|
& (.bbbbbbbbbbbbbbbbbbbbbbbbbbb.ccccccccccccccccccccccccccccccccccccc.ddddddddddddddddddddddddddddddddddddddddddddddddddd)
|
|
@ -0,0 +1,100 @@
|
||||||
|
#group extensions/patternsynonyms
|
||||||
|
|
||||||
|
|
||||||
|
#test bidirectional pattern
|
||||||
|
{-# LANGUAGE PatternSynonyms #-}
|
||||||
|
pattern J x = Just x
|
||||||
|
|
||||||
|
#test unidirection pattern
|
||||||
|
{-# LANGUAGE PatternSynonyms #-}
|
||||||
|
pattern F x <- (x, _)
|
||||||
|
|
||||||
|
#test explicitly bidirectional pattern
|
||||||
|
{-# LANGUAGE PatternSynonyms #-}
|
||||||
|
pattern HeadC x <- x : xs where
|
||||||
|
HeadC x = [x]
|
||||||
|
|
||||||
|
#test Multiple arguments
|
||||||
|
{-# LANGUAGE PatternSynonyms #-}
|
||||||
|
pattern Head2 x y <- x : y : xs where
|
||||||
|
Head2 x y = [x, y]
|
||||||
|
|
||||||
|
#test Infix argument
|
||||||
|
{-# LANGUAGE PatternSynonyms #-}
|
||||||
|
pattern x :> y = [x, y]
|
||||||
|
|
||||||
|
#test Record argument
|
||||||
|
{-# LANGUAGE PatternSynonyms #-}
|
||||||
|
pattern MyData { a, b, c } = [a, b, c]
|
||||||
|
|
||||||
|
#test long pattern match
|
||||||
|
{-# LANGUAGE PatternSynonyms #-}
|
||||||
|
pattern myLongLeftVariableName `MyLongInfixPatternMatcher` myLongRightVariableName =
|
||||||
|
[myLongLeftVariableName, myLongRightVariableName]
|
||||||
|
|
||||||
|
#test long explicitly bidirectional match
|
||||||
|
{-# LANGUAGE PatternSynonyms #-}
|
||||||
|
pattern myLeftVariableName `MyInfixPatternMatcher` myRightVariableName <-
|
||||||
|
[myLongLeftVariableName, myLongRightVariableName] where
|
||||||
|
MyInfixPatternMatcher x y = [x, x, y]
|
||||||
|
|
||||||
|
#test Pattern synonym types
|
||||||
|
{-# LANGUAGE PatternSynonyms #-}
|
||||||
|
pattern J :: a -> Maybe a
|
||||||
|
pattern J x = Just x
|
||||||
|
|
||||||
|
#test pattern synonym bidirectional multiple cases
|
||||||
|
{-# LANGUAGE PatternSynonyms #-}
|
||||||
|
{-# LANGUAGE ViewPatterns #-}
|
||||||
|
pattern Signed x <- (asSigned -> x) where
|
||||||
|
Signed (Neg x) = -x
|
||||||
|
Signed Zero = 0
|
||||||
|
Signed (Pos x) = x
|
||||||
|
|
||||||
|
#test pattern synonym bidirectional multiple cases long
|
||||||
|
{-# LANGUAGE PatternSynonyms #-}
|
||||||
|
{-# LANGUAGE ViewPatterns #-}
|
||||||
|
pattern Signed xxxxxxxxxxxxxxxxxxxxxxxx <-
|
||||||
|
(asSigned -> xxxxxxxxxxxxxxxxxxxxxxxx) where
|
||||||
|
Signed (Neg x) = -x
|
||||||
|
Signed Zero = 0
|
||||||
|
Signed (Pos x) = x
|
||||||
|
|
||||||
|
#test pattern synonym bidirectional multiple cases with comments
|
||||||
|
{-# LANGUAGE PatternSynonyms #-}
|
||||||
|
{-# LANGUAGE ViewPatterns #-}
|
||||||
|
pattern Signed x <- (asSigned -> x) where
|
||||||
|
Signed (Neg x) = -x -- negative comment
|
||||||
|
Signed Zero = 0 -- zero comment
|
||||||
|
Signed (Pos x) = x -- positive comment
|
||||||
|
|
||||||
|
#test Pattern synonym types multiple names
|
||||||
|
{-# LANGUAGE PatternSynonyms #-}
|
||||||
|
pattern J, K :: a -> Maybe a
|
||||||
|
|
||||||
|
#test Pattern synonym type sig wrapped
|
||||||
|
{-# LANGUAGE PatternSynonyms #-}
|
||||||
|
pattern LongMatcher
|
||||||
|
:: longlongtypevar
|
||||||
|
-> longlongtypevar
|
||||||
|
-> longlongtypevar
|
||||||
|
-> Maybe [longlongtypevar]
|
||||||
|
pattern LongMatcher x y z = Just [x, y, z]
|
||||||
|
|
||||||
|
|
||||||
|
#group extensions/patternsynonyms+explicitnamespaces
|
||||||
|
|
||||||
|
|
||||||
|
#test explicitnamespaces_patternsynonyms export
|
||||||
|
{-# LANGUAGE ExplicitNamespaces #-}
|
||||||
|
{-# LANGUAGE PatternSynonyms #-}
|
||||||
|
module Test (type (++), (++), pattern Foo) where
|
||||||
|
|
||||||
|
#test explicitnamespaces_patternsynonyms import
|
||||||
|
{-# LANGUAGE ExplicitNamespaces #-}
|
||||||
|
{-# LANGUAGE PatternSynonyms #-}
|
||||||
|
import Test ( type (++)
|
||||||
|
, (++)
|
||||||
|
, pattern (:.)
|
||||||
|
, pattern Foo
|
||||||
|
)
|
|
@ -0,0 +1,34 @@
|
||||||
|
#group extensions/quasiquotes
|
||||||
|
|
||||||
|
|
||||||
|
#test quasi-quotes simple 1
|
||||||
|
{-# LANGUAGE QuasiQuotes #-}
|
||||||
|
func = [blub|
|
||||||
|
asd
|
||||||
|
qwe
|
||||||
|
|]
|
||||||
|
|
||||||
|
#test quasi-quotes simple 2
|
||||||
|
{-# LANGUAGE QuasiQuotes #-}
|
||||||
|
func = [blub|
|
||||||
|
asd
|
||||||
|
qwe|]
|
||||||
|
|
||||||
|
#test quasi-quotes ignoring layouting
|
||||||
|
{-# LANGUAGE QuasiQuotes #-}
|
||||||
|
func = do
|
||||||
|
let body = [json|
|
||||||
|
hello
|
||||||
|
|]
|
||||||
|
pure True
|
||||||
|
|
||||||
|
#test quasi-quotes ignoring layouting, strict mode
|
||||||
|
-- brittany { lconfig_allowHangingQuasiQuotes: False }
|
||||||
|
{-# LANGUAGE QuasiQuotes #-}
|
||||||
|
func = do
|
||||||
|
let
|
||||||
|
body =
|
||||||
|
[json|
|
||||||
|
hello
|
||||||
|
|]
|
||||||
|
pure True
|
|
@ -0,0 +1,17 @@
|
||||||
|
#group extensions/recursivedo
|
||||||
|
|
||||||
|
|
||||||
|
#test recursivedo 1
|
||||||
|
{-# LANGUAGE RecursiveDo #-}
|
||||||
|
foo = do
|
||||||
|
rec a <- f b
|
||||||
|
b <- g a
|
||||||
|
return (a, b)
|
||||||
|
|
||||||
|
#test recursivedo 2
|
||||||
|
{-# LANGUAGE RecursiveDo #-}
|
||||||
|
foo = do
|
||||||
|
rec -- comment
|
||||||
|
a <- f b
|
||||||
|
b <- g a
|
||||||
|
return (a, b)
|
|
@ -0,0 +1,14 @@
|
||||||
|
#group extensions/unboxedtuples
|
||||||
|
|
||||||
|
|
||||||
|
#test unboxed-tuple and vanilla names
|
||||||
|
{-# LANGUAGE UnboxedTuples #-}
|
||||||
|
spanKey :: (# Int, Int #) -> (# Int, Int #)
|
||||||
|
spanKey = case foo of
|
||||||
|
(# bar, baz #) -> (# baz, bar #)
|
||||||
|
|
||||||
|
#test unboxed-tuple and hashed name
|
||||||
|
{-# LANGUAGE MagicHash, UnboxedTuples #-}
|
||||||
|
spanKey :: (# Int#, Int# #) -> (# Int#, Int# #)
|
||||||
|
spanKey = case foo of
|
||||||
|
(# bar#, baz# #) -> (# baz# +# bar#, bar# #)
|
|
@ -0,0 +1,45 @@
|
||||||
|
#group feature/import-merging
|
||||||
|
|
||||||
|
|
||||||
|
#golden merge imports down to constructor-level
|
||||||
|
import Data.Bool ( Bool(True) )
|
||||||
|
import Data.Bool ( Bool(False) )
|
||||||
|
#expected
|
||||||
|
import Data.Bool ( Bool(False, True) )
|
||||||
|
|
||||||
|
#golden wildcard trumps explicit+hiding
|
||||||
|
import Data.Map ( Map )
|
||||||
|
import Data.Map
|
||||||
|
import Data.Map hiding ( toList )
|
||||||
|
#expected
|
||||||
|
import Data.Map
|
||||||
|
|
||||||
|
#golden explicit+hiding do not merge for now
|
||||||
|
import Data.Map ( Map )
|
||||||
|
import Data.Map hiding ( toList )
|
||||||
|
#expected
|
||||||
|
import Data.Map ( Map )
|
||||||
|
import Data.Map hiding ( toList )
|
||||||
|
|
||||||
|
#golden hiding+hiding do not merge for now
|
||||||
|
import Data.Map hiding ( toList )
|
||||||
|
import Data.Map hiding ( fromList )
|
||||||
|
#expected
|
||||||
|
import Data.Map hiding ( toList )
|
||||||
|
import Data.Map hiding ( fromList )
|
||||||
|
|
||||||
|
#golden qualified and qualified-as merge but separately
|
||||||
|
import qualified Data.Map ( toList )
|
||||||
|
import qualified Data.Map ( fromList )
|
||||||
|
import qualified Data.Map as M
|
||||||
|
( Map )
|
||||||
|
import qualified Data.Map as M
|
||||||
|
( take )
|
||||||
|
#expected
|
||||||
|
import qualified Data.Map ( fromList
|
||||||
|
, toList
|
||||||
|
)
|
||||||
|
import qualified Data.Map as M
|
||||||
|
( Map
|
||||||
|
, take
|
||||||
|
)
|
|
@ -0,0 +1,31 @@
|
||||||
|
#group feature/minimize-parens
|
||||||
|
|
||||||
|
#golden minimize parens basic test
|
||||||
|
-- brittany { lconfig_operatorParenthesisRefactorMode: PRMMinimize }
|
||||||
|
func = func (abc) (def)
|
||||||
|
#expected
|
||||||
|
-- brittany { lconfig_operatorParenthesisRefactorMode: PRMMinimize }
|
||||||
|
func = func abc def
|
||||||
|
|
||||||
|
#test minimize parens test that it keep necessary parens
|
||||||
|
-- brittany { lconfig_operatorParenthesisRefactorMode: PRMMinimize }
|
||||||
|
func = func (abc False) ("asd" ++ "def")
|
||||||
|
|
||||||
|
|
||||||
|
#golden minimize nested parens 1
|
||||||
|
-- brittany { lconfig_operatorParenthesisRefactorMode: PRMMinimize }
|
||||||
|
func = func ((((((((nested))))))))
|
||||||
|
#expected
|
||||||
|
-- brittany { lconfig_operatorParenthesisRefactorMode: PRMMinimize }
|
||||||
|
func = func nested
|
||||||
|
|
||||||
|
#golden minimize nested parens 2
|
||||||
|
-- brittany { lconfig_operatorParenthesisRefactorMode: PRMMinimize }
|
||||||
|
func = func ((((((((nested + expression))))))))
|
||||||
|
#expected
|
||||||
|
-- brittany { lconfig_operatorParenthesisRefactorMode: PRMMinimize }
|
||||||
|
func = func (nested + expression)
|
||||||
|
|
||||||
|
#test does not remove parens on InfixN
|
||||||
|
-- brittany { lconfig_operatorParenthesisRefactorMode: PRMMinimize }
|
||||||
|
func = (a == Foo) == (b == Bar)
|
|
@ -0,0 +1,27 @@
|
||||||
|
#group other/whitespace-newlines
|
||||||
|
|
||||||
|
#test module-import-newlines
|
||||||
|
|
||||||
|
module Main where
|
||||||
|
|
||||||
|
import Prelude
|
||||||
|
|
||||||
|
firstDecl = True
|
||||||
|
|
||||||
|
#test function-where-newlines
|
||||||
|
|
||||||
|
func = do
|
||||||
|
|
||||||
|
-- complex first step
|
||||||
|
aaa
|
||||||
|
|
||||||
|
-- complex second step
|
||||||
|
bbb
|
||||||
|
|
||||||
|
where
|
||||||
|
|
||||||
|
helper :: Helper
|
||||||
|
helper = helpful
|
||||||
|
|
||||||
|
other :: Other
|
||||||
|
other = True
|
File diff suppressed because it is too large
Load Diff
|
@ -0,0 +1,35 @@
|
||||||
|
###############################################################################
|
||||||
|
###############################################################################
|
||||||
|
###############################################################################
|
||||||
|
#group pending
|
||||||
|
###############################################################################
|
||||||
|
###############################################################################
|
||||||
|
###############################################################################
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
## this testcase is not about idempotency, but about _how_ the output differs
|
||||||
|
## from the input; i cannot really express this yet with the current
|
||||||
|
## test-suite.
|
||||||
|
## #test ayaz
|
||||||
|
##
|
||||||
|
## myManageHook =
|
||||||
|
## composeOne [isFullscreen -?> doFullFloat, isDialog -?> doFloat, transience]
|
||||||
|
## <+> composeAll
|
||||||
|
## [ className =? "Pidgin" --> doFloat
|
||||||
|
## , className =? "XCalc" --> doFloat
|
||||||
|
## -- plan9port's acme
|
||||||
|
## , className =? "acme" --> doFloat
|
||||||
|
## -- Acme with Vi bindings editor
|
||||||
|
## , title =? "ED" --> doFloat
|
||||||
|
## , title =? "wlc-x11" --> doFloat
|
||||||
|
## , className =? "Skype" --> doFloat
|
||||||
|
## , className =? "ffplay" --> doFloat
|
||||||
|
## , className =? "mpv" --> doFloat
|
||||||
|
## , className =? "Plugin-container" --> doFloat -- Firefox flash, etc.
|
||||||
|
## -- Firefox works well tiled, but it has dialog windows we want to float.
|
||||||
|
## , appName =? "Browser" --> doFloat
|
||||||
|
## ]
|
||||||
|
## where
|
||||||
|
## role = stringProperty "WM_WINDOW_ROLE"
|
||||||
|
|
File diff suppressed because it is too large
Load Diff
|
@ -0,0 +1,43 @@
|
||||||
|
###############################################################################
|
||||||
|
###############################################################################
|
||||||
|
###############################################################################
|
||||||
|
#group indent-policy-multiple
|
||||||
|
###############################################################################
|
||||||
|
###############################################################################
|
||||||
|
###############################################################################
|
||||||
|
|
||||||
|
#test long
|
||||||
|
-- brittany { lconfig_indentAmount: 4, lconfig_indentPolicy: IndentPolicyMultiple }
|
||||||
|
func =
|
||||||
|
mweroiuxlskdfjlksjdflkjsdfljksldkjflkjsdflkj
|
||||||
|
+ mweroiuxlskdfjlksjdflkjsdfljksldkjflkjsdflkj
|
||||||
|
|
||||||
|
#test let indAmount=4
|
||||||
|
-- brittany { lconfig_indentAmount: 4, lconfig_indentPolicy: IndentPolicyMultiple }
|
||||||
|
foo = do
|
||||||
|
let aaaaaaaaaaaaaaaaaaaaaaaaaaaaaa =
|
||||||
|
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaa + aaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
|
||||||
|
foo
|
||||||
|
|
||||||
|
#test let indAmount=8
|
||||||
|
-- brittany { lconfig_indentAmount: 8, lconfig_indentPolicy: IndentPolicyMultiple }
|
||||||
|
foo = do
|
||||||
|
let aaaaaaaaaaaaaaaaaaaaaaaaaaaaaa =
|
||||||
|
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaa + aaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
|
||||||
|
foo
|
||||||
|
foo = do
|
||||||
|
let aaaaaaaaaaaaaaaaaaaaaaaaaaaaaa =
|
||||||
|
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
|
||||||
|
+ aaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
|
||||||
|
+ aaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
|
||||||
|
foo
|
||||||
|
|
||||||
|
#test nested do-block
|
||||||
|
-- brittany { lconfig_indentAmount: 4, lconfig_indentPolicy: IndentPolicyMultiple }
|
||||||
|
foo =
|
||||||
|
asdyf8asdf
|
||||||
|
"ajsdfas"
|
||||||
|
[ asjdf asyhf $ do
|
||||||
|
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
|
||||||
|
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
|
||||||
|
]
|
|
@ -1 +0,0 @@
|
||||||
func :: a -> a
|
|
|
@ -1,3 +0,0 @@
|
||||||
func
|
|
||||||
:: lkasdlkjalsdjlakjsdlkjasldkjalskdjlkajsd
|
|
||||||
-> (lakjsdlkjasldkj -> lakjsdlkjasldkj)
|
|
|
@ -1 +0,0 @@
|
||||||
func = klajsdas klajsdas klajsdas
|
|
|
@ -1,3 +0,0 @@
|
||||||
func = lakjsdlajsdljasdlkjasldjasldjasldjalsdjlaskjd
|
|
||||||
lakjsdlajsdljasdlkjasldjasldjasldjalsdjlaskjd
|
|
||||||
lakjsdlajsdljasdlkjasldjasldjasldjalsdjlaskjd
|
|
|
@ -1,3 +0,0 @@
|
||||||
func = lakjsdlajsdljasdlkjasldjasldjasldjalsdjlaskjd lakjsdlajsdljas
|
|
||||||
lakjsdlajsdljas
|
|
||||||
lakjsdlajsdljas
|
|
|
@ -1 +0,0 @@
|
||||||
func = (1 +)
|
|
|
@ -1 +0,0 @@
|
||||||
func = (+ 1)
|
|
|
@ -1 +0,0 @@
|
||||||
func = (1 `abc`)
|
|
|
@ -1 +0,0 @@
|
||||||
func = (`abc` 1)
|
|
|
@ -1 +0,0 @@
|
||||||
func = (abc, def)
|
|
|
@ -1 +0,0 @@
|
||||||
func = (abc, )
|
|
|
@ -1 +0,0 @@
|
||||||
func = (, abc)
|
|
|
@ -1,3 +0,0 @@
|
||||||
func
|
|
||||||
:: (lkasdlkjalsdjlakjsdlkjasldkjalskdjlkajsd -> lakjsdlkjasldkj)
|
|
||||||
-> lakjsdlkjasldkj
|
|
|
@ -1,6 +0,0 @@
|
||||||
myTupleSection =
|
|
||||||
( verylaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaargefirstelement
|
|
||||||
,
|
|
||||||
, verylaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaargethirdelement
|
|
||||||
,
|
|
||||||
)
|
|
|
@ -1,4 +0,0 @@
|
||||||
func =
|
|
||||||
( lakjsdlajsdljasdlkjasldjasldjasldjalsdjlaskjd
|
|
||||||
, lakjsdlajsdljasdlkjasldjasldjasldjalsdjlaskjd
|
|
||||||
)
|
|
|
@ -1,6 +0,0 @@
|
||||||
foo = if True
|
|
||||||
then
|
|
||||||
-- iiiiii
|
|
||||||
"a "
|
|
||||||
else
|
|
||||||
"b "
|
|
|
@ -1,5 +0,0 @@
|
||||||
func = if cond
|
|
||||||
then pure 42
|
|
||||||
else do
|
|
||||||
-- test
|
|
||||||
abc
|
|
|
@ -1,3 +0,0 @@
|
||||||
func = case x of
|
|
||||||
False -> False
|
|
||||||
True -> True
|
|
|
@ -1,7 +0,0 @@
|
||||||
func =
|
|
||||||
case
|
|
||||||
lakjsdlajsdljasdlkjasldjasldjasldjalsdjlaskjd
|
|
||||||
lakjsdlajsdljasdlkjasldjasldjasldjalsdjlaskjd
|
|
||||||
of
|
|
||||||
False -> False
|
|
||||||
True -> True
|
|
|
@ -1,7 +0,0 @@
|
||||||
func = do
|
|
||||||
case
|
|
||||||
lakjsdlajsdljasdlkjasldjasldjasldjalsdjlaskjd
|
|
||||||
lakjsdlajsdljasdlkjasldjasldjasldjalsdjlaskjd
|
|
||||||
of
|
|
||||||
False -> False
|
|
||||||
True -> True
|
|
|
@ -1 +0,0 @@
|
||||||
func = case x of {}
|
|
|
@ -1,5 +0,0 @@
|
||||||
func =
|
|
||||||
case
|
|
||||||
lakjsdlajsdljasdlkjasldjasldjasldjalsdjlaskjd
|
|
||||||
lakjsdlajsdljasdlkjasldjasldjasldjalsdjlaskjd
|
|
||||||
of {}
|
|
|
@ -1,5 +0,0 @@
|
||||||
func = do
|
|
||||||
case
|
|
||||||
lakjsdlajsdljasdlkjasldjasldjasldjalsdjlaskjd
|
|
||||||
lakjsdlajsdljasdlkjasldjasldjasldjalsdjlaskjd
|
|
||||||
of {}
|
|
|
@ -1,5 +0,0 @@
|
||||||
func
|
|
||||||
:: ( lkasdlkjalsdjlakjsdlkjasldkjalskdjlkajsd
|
|
||||||
-> lkasdlkjalsdjlakjsdlkjasldkjalskdjlkajsd
|
|
||||||
)
|
|
||||||
-> lakjsdlkjasldkj
|
|
|
@ -1,3 +0,0 @@
|
||||||
func = do
|
|
||||||
stmt
|
|
||||||
stmt
|
|
|
@ -1,3 +0,0 @@
|
||||||
func = do
|
|
||||||
x <- stmt
|
|
||||||
stmt x
|
|
|
@ -1,3 +0,0 @@
|
||||||
func = do
|
|
||||||
let x = 13
|
|
||||||
stmt x
|
|
|
@ -1,7 +0,0 @@
|
||||||
func =
|
|
||||||
foooooo
|
|
||||||
$ [ case
|
|
||||||
foooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooo
|
|
||||||
of
|
|
||||||
_ -> True
|
|
||||||
]
|
|
|
@ -1,4 +0,0 @@
|
||||||
testMethod foo bar baz qux =
|
|
||||||
let x = undefined foo bar baz qux qux baz bar :: String
|
|
||||||
-- some comment explaining the in expression
|
|
||||||
in undefined foo x :: String
|
|
|
@ -1,4 +0,0 @@
|
||||||
testMethod foo bar baz qux =
|
|
||||||
let x = undefined :: String
|
|
||||||
-- some comment explaining the in expression
|
|
||||||
in undefined :: String
|
|
|
@ -1,3 +0,0 @@
|
||||||
testMethod foo bar baz qux =
|
|
||||||
-- some comment explaining the in expression
|
|
||||||
let x = undefined :: String in undefined :: String
|
|
|
@ -1,6 +0,0 @@
|
||||||
foo foo bar baz qux =
|
|
||||||
let a = 1
|
|
||||||
b = 2
|
|
||||||
c = 3
|
|
||||||
-- some comment explaining the in expression
|
|
||||||
in undefined :: String
|
|
|
@ -1,6 +0,0 @@
|
||||||
func =
|
|
||||||
foo
|
|
||||||
$ [ aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
|
|
||||||
, bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb
|
|
||||||
]
|
|
||||||
++ [ccccccccccccccccccccccccccccccccccccccccccccccccccccccccc]
|
|
|
@ -1 +0,0 @@
|
||||||
module Main where
|
|
|
@ -1,5 +0,0 @@
|
||||||
func
|
|
||||||
:: ( ( lkasdlkjalsdjlakjsdlkjasldkjalskdjlkajsd
|
|
||||||
-> lkasdlkjalsdjlakjsdlkjasldkjalskdjlkajsd
|
|
||||||
)
|
|
||||||
)
|
|
|
@ -1 +0,0 @@
|
||||||
module Main () where
|
|
|
@ -1 +0,0 @@
|
||||||
module Main (main) where
|
|
|
@ -1 +0,0 @@
|
||||||
module Main (main, test1, test2) where
|
|
|
@ -1,12 +0,0 @@
|
||||||
module Main
|
|
||||||
( main
|
|
||||||
, test1
|
|
||||||
, test2
|
|
||||||
, test3
|
|
||||||
, test4
|
|
||||||
, test5
|
|
||||||
, test6
|
|
||||||
, test7
|
|
||||||
, test8
|
|
||||||
, test9
|
|
||||||
) where
|
|
|
@ -1,12 +0,0 @@
|
||||||
module Main
|
|
||||||
( main
|
|
||||||
-- main
|
|
||||||
, test1
|
|
||||||
, test2
|
|
||||||
-- Test 3
|
|
||||||
, test3
|
|
||||||
, test4
|
|
||||||
-- Test 5
|
|
||||||
, test5
|
|
||||||
-- Test 6
|
|
||||||
) where
|
|
|
@ -1 +0,0 @@
|
||||||
module Main (Test(..)) where
|
|
|
@ -1 +0,0 @@
|
||||||
module Main (module Main) where
|
|
|
@ -1 +0,0 @@
|
||||||
module Main (Test(Test, a, b)) where
|
|
|
@ -1,6 +0,0 @@
|
||||||
-- comment1
|
|
||||||
module Main
|
|
||||||
( Test(Test, a, b)
|
|
||||||
, foo -- comment2
|
|
||||||
) -- comment3
|
|
||||||
where
|
|
|
@ -1 +0,0 @@
|
||||||
module Main (Test()) where
|
|
|
@ -1 +0,0 @@
|
||||||
func :: asd -> Either a b
|
|
|
@ -1 +0,0 @@
|
||||||
-- Intentionally left empty
|
|
|
@ -1 +0,0 @@
|
||||||
import Data.List
|
|
|
@ -1 +0,0 @@
|
||||||
import Data.List as L
|
|
|
@ -1 +0,0 @@
|
||||||
import qualified Data.List
|
|
|
@ -1 +0,0 @@
|
||||||
import qualified Data.List as L
|
|
|
@ -1 +0,0 @@
|
||||||
import safe Data.List as L
|
|
|
@ -1 +0,0 @@
|
||||||
import {-# SOURCE #-} Data.List ( )
|
|
|
@ -1 +0,0 @@
|
||||||
import safe qualified Data.List
|
|
|
@ -1 +0,0 @@
|
||||||
import {-# SOURCE #-} safe qualified Data.List
|
|
|
@ -1 +0,0 @@
|
||||||
import qualified "base" Data.List
|
|
|
@ -1,5 +0,0 @@
|
||||||
func
|
|
||||||
:: asd
|
|
||||||
-> Either
|
|
||||||
lkasdlkjalsdjlakjsdlkjasldkjalskdjlkajsd
|
|
||||||
lkasdlkjalsdjlakjsdlkjasldkjalskdjlkajsd
|
|
|
@ -1,3 +0,0 @@
|
||||||
import {-# SOURCE #-} safe qualified "base" Data.List as L
|
|
||||||
import {-# SOURCE #-} safe qualified "base" Data.List ( )
|
|
||||||
import {-# SOURCE #-} safe qualified Data.List hiding ( )
|
|
|
@ -1 +0,0 @@
|
||||||
import qualified Data.List ( )
|
|
|
@ -1 +0,0 @@
|
||||||
import Data.List ( nub )
|
|
|
@ -1,4 +0,0 @@
|
||||||
import Data.List ( foldl'
|
|
||||||
, indexElem
|
|
||||||
, nub
|
|
||||||
)
|
|
|
@ -1,14 +0,0 @@
|
||||||
import Test ( Long
|
|
||||||
, anymore
|
|
||||||
, fit
|
|
||||||
, items
|
|
||||||
, line
|
|
||||||
, list
|
|
||||||
, not
|
|
||||||
, onA
|
|
||||||
, quite
|
|
||||||
, single
|
|
||||||
, that
|
|
||||||
, will
|
|
||||||
, with
|
|
||||||
)
|
|
|
@ -1,11 +0,0 @@
|
||||||
import Test ( (+)
|
|
||||||
, (:!)(..)
|
|
||||||
, (:*)((:.), T7, t7)
|
|
||||||
, (:.)
|
|
||||||
, T
|
|
||||||
, T2()
|
|
||||||
, T3(..)
|
|
||||||
, T4(T4)
|
|
||||||
, T5(T5, t5)
|
|
||||||
, T6((<|>))
|
|
||||||
)
|
|
|
@ -1,3 +0,0 @@
|
||||||
import Test hiding ( )
|
|
||||||
import Test as T
|
|
||||||
hiding ( )
|
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue