Commit c7327116 authored by Simon Peyton Jones's avatar Simon Peyton Jones
Browse files

Improve pretty-printing for pattern synonyms

Just better layout in output for the user
parent 307d1dfe
......@@ -862,11 +862,13 @@ pprIfaceDecl _ (IfacePatSyn { ifName = name,
= sdocWithDynFlags mk_msg
where
mk_msg dflags
= hsep [ text "pattern", pprPrefixOcc name, dcolon
, univ_msg, pprIfaceContextArr req_ctxt
, ppWhen insert_empty_ctxt $ parens empty <+> darrow
, ex_msg, pprIfaceContextArr prov_ctxt
, pprIfaceType $ foldr IfaceFunTy pat_ty arg_tys]
= hang (text "pattern" <+> pprPrefixOcc name)
2 (dcolon <+> sep [univ_msg
, pprIfaceContextArr req_ctxt
, ppWhen insert_empty_ctxt $ parens empty <+> darrow
, ex_msg
, pprIfaceContextArr prov_ctxt
, pprIfaceType $ foldr IfaceFunTy pat_ty arg_tys ])
where
univ_msg = pprUserIfaceForAll univ_bndrs
ex_msg = pprUserIfaceForAll ex_bndrs
......
......@@ -6,13 +6,13 @@ pattern Pu :: p -> p -- Defined at <interactive>:18:1
pattern Pue :: a -> a1 -> (a, Ex) -- Defined at <interactive>:19:1
pattern Pur :: (Eq a, Num a) => a -> [a]
-- Defined at <interactive>:20:1
pattern Purp :: (Eq a, Num a) => Show a1 => a
-> a1 -> ([a], UnivProv a1)
pattern Purp
:: (Eq a, Num a) => Show a1 => a -> a1 -> ([a], UnivProv a1)
-- Defined at <interactive>:21:1
pattern Pure :: (Eq a, Num a) => a -> a1 -> ([a], Ex)
-- Defined at <interactive>:22:1
pattern Purep :: (Eq a, Num a) => Show a1 => a
-> a1 -> ([a], ExProv)
pattern Purep
:: (Eq a, Num a) => Show a1 => a -> a1 -> ([a], ExProv)
-- Defined at <interactive>:23:1
pattern Pep :: () => Show a => a -> ExProv
-- Defined at <interactive>:24:1
......@@ -31,19 +31,26 @@ pattern Pue :: forall {a}. () => forall {a1}. a -> a1 -> (a, Ex)
-- Defined at <interactive>:19:1
pattern Pur :: forall {a}. (Eq a, Num a) => a -> [a]
-- Defined at <interactive>:20:1
pattern Purp :: forall {a} {a1}. (Eq a, Num a) => Show a1 => a
-> a1 -> ([a], UnivProv a1)
pattern Purp
:: forall {a} {a1}.
(Eq a, Num a) =>
Show a1 =>
a -> a1 -> ([a], UnivProv a1)
-- Defined at <interactive>:21:1
pattern Pure :: forall {a}. (Eq a, Num a) => forall {a1}. a
-> a1 -> ([a], Ex)
pattern Pure
:: forall {a}. (Eq a, Num a) => forall {a1}. a -> a1 -> ([a], Ex)
-- Defined at <interactive>:22:1
pattern Purep :: forall {a}. (Eq a, Num a) => forall {a1}. Show
a1 => a -> a1 -> ([a], ExProv)
pattern Purep
:: forall {a}.
(Eq a, Num a) =>
forall {a1}.
Show a1 =>
a -> a1 -> ([a], ExProv)
-- Defined at <interactive>:23:1
pattern Pep :: () => forall {a}. Show a => a -> ExProv
-- Defined at <interactive>:24:1
pattern Pup :: forall {a}. () => Show a => a -> UnivProv a
-- Defined at <interactive>:25:1
pattern Puep :: forall {b}. () => forall {a}. Show a => a
-> b -> (ExProv, b)
pattern Puep
:: forall {b}. () => forall {a}. Show a => a -> b -> (ExProv, b)
-- Defined at <interactive>:26:1
pattern Foo :: () => (b ~ a) => a :~~: b
-- Defined at <interactive>:5:1
pattern Bar :: forall k2 k1 (a :: k1) (b :: k2). () => (k2 ~ k1,
(b :: k2) ~~ (a :: k1)) => a :~~: b
pattern Bar
:: forall k2 k1 (a :: k1) (b :: k2).
() =>
(k2 ~ k1, (b :: k2) ~~ (a :: k1)) =>
a :~~: b
-- Defined at <interactive>:11:1
pattern Bam :: () => Ord a => a -> a -> (S a, S a)
-- Defined at <interactive>:21:1
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment