Fix whitespace regression on forall+constraint type sig
parent
9d0669d6a6
commit
974826f98f
|
@ -680,3 +680,7 @@ a = \x -> x
|
|||
b = \ ~x -> x
|
||||
c = \ !x -> x
|
||||
d = \(~x) -> x
|
||||
|
||||
#test type signature with forall and constraint
|
||||
{-# LANGUAGE RankNTypes #-}
|
||||
func :: forall b . Show b => b -> String
|
||||
|
|
|
@ -766,12 +766,15 @@ layoutTyVarBndrs = mapM $ \case
|
|||
return $ (lrdrNameToText lrdrName, Just $ d)
|
||||
#endif
|
||||
|
||||
-- there is no specific reason this returns a list instead of a single
|
||||
-- BriDoc node.
|
||||
processTyVarBndrsSingleline
|
||||
:: [(Text, Maybe (ToBriDocM BriDocNumbered))] -> [ToBriDocM BriDocNumbered]
|
||||
processTyVarBndrsSingleline bndrDocs = bndrDocs >>= \case
|
||||
(tname, Nothing) -> [docLit $ Text.pack " " <> tname]
|
||||
(tname, Nothing) -> [docSeparator, docLit tname]
|
||||
(tname, Just doc) ->
|
||||
[ docLit $ Text.pack " (" <> tname <> Text.pack " :: "
|
||||
[ docSeparator
|
||||
, docLit $ Text.pack "(" <> tname <> Text.pack " :: "
|
||||
, docForceSingleline $ doc
|
||||
, docLit $ Text.pack ")"
|
||||
]
|
||||
|
|
Loading…
Reference in New Issue