last commit was crazy it was always an ifoldr

This commit is contained in:
crumbtoo
2024-03-17 06:01:15 -06:00
parent 99ef4535ba
commit 64482660e1
2 changed files with 5 additions and 3 deletions

View File

@@ -167,8 +167,10 @@ instance (Out b) => Out (DataCon b) where
instance (Out b) => Out (Type b) where
outPrec _ (VarT n) = ttext n
outPrec _ (ConT n) = ttext n
outPrec p (s Core.:-> t) = maybeParens (p>appPrec-1) $
hsep [ outPrec appPrec s, "->", outPrec (appPrec-1) t ]
outPrec p (s Core.:-> t) = maybeParens (p>arrPrec) $
hsep [ outPrec arrPrec1 s, "->", outPrec arrPrec t ]
where arrPrec = appPrec-1
arrPrec1 = appPrec
outPrec p (AppT f x) = maybeParens (p>appPrec) $
outPrec appPrec f <+> outPrec appPrec1 x
outPrec p FunT = maybeParens (p>0) "->"