Adjust rendering of kind signatures and implicit parameters
Previously there was no space between type variable and ‘::’, which is why I
started digging this in the first place.
commita2b75213b32760942be53cf879ff5cddc183686a
authormrkkrp <mark.karpov@tweag.io>
dateMon 8 Jul 2019, 22:18 (7 years ago)
parent99619d6
data/examples/declaration/data/kind-annotations-out.hsnew file+1
@@ -0,0 +1 @@
1+data Something (n :: Nat) = Something
data/examples/declaration/data/kind-annotations.hsnew file+1
@@ -0,0 +1 @@
1+data Something (n :: Nat) = Something
data/examples/declaration/value/function/implicit-params-out.hs+9
@@ -4,3 +4,12 @@ sortBy :: (a -> a -> Bool) -> [a] -> [a]
44
55sort :: (?cmp :: a -> a -> Bool) => [a] -> [a]
66sort = sortBy ?cmp
7+
8+sort'
9+ :: ( ?cmp
10+ :: a -> a -> Bool
11+ , ?foo :: Int
12+ )
13+ => [a]
14+ -> [a]
15+sort' = sort
data/examples/declaration/value/function/implicit-params.hs+5
@@ -3,3 +3,8 @@ sortBy :: (a -> a -> Bool) -> [a] -> [a]
33
44sort :: (?cmp :: a -> a -> Bool) => [a] -> [a]
55sort = sortBy ?cmp
6+
7+sort' :: (?cmp
8+ :: a -> a -> Bool
9+ ,?foo :: Int) => [a] -> [a]
10+sort' = sort
src/Ormolu/Printer/Meat/Type.hs+3−2
@@ -69,15 +69,16 @@ p_hsType = \case
6969 located y p_hsType
7070 HsParTy NoExt t ->
7171 parens (located t p_hsType)
72− HsIParamTy NoExt n t -> do
72+ HsIParamTy NoExt n t -> sitcc $ do
7373 located n atom
7474 breakpoint
7575 inci $ do
7676 txt ":: "
7777 located t p_hsType
7878 HsStarTy NoExt _ -> txt "*"
79− HsKindSig NoExt t k -> do
79+ HsKindSig NoExt t k -> sitcc $ do
8080 located t p_hsType
81+ space -- FIXME
8182 inci $ do
8283 txt ":: "
8384 located k p_hsType