remove stray space for nullary ctors

This commit is contained in:
Paul Chiusano 2019-03-26 17:40:30 -04:00
parent 5fc75f5e70
commit 2ab759444e

View File

@ -74,12 +74,10 @@ prettyDataDecl env r name dd =
where
constructor (n, (_, _, (Type.ForallsNamed' _ t))) = constructor' n t
constructor (n, (_, _, t) ) = constructor' n t
constructor' n t =
P.group . P.hang' (prettyPattern env r name n) " " $
P.spaced (TypePrinter.pretty env 10 <$> case Type.unArrows t of
Nothing -> mempty
Just ts -> init ts
)
constructor' n t = case Type.unArrows t of
Nothing -> prettyPattern env r name n
Just ts -> P.group . P.hang' (prettyPattern env r name n) " "
$ P.spaced (TypePrinter.pretty env 10 <$> init ts)
header =
P.sep " " (prettyDataHeader name : (P.text . Var.name <$> DD.bound dd))
<> (" = " `P.orElse` "\n = ")