From 0e7601749d53d59df528ede996d8b54352051498 Mon Sep 17 00:00:00 2001 From: Simon Peyton Jones Date: Fri, 17 Feb 2017 13:58:58 +0000 Subject: Simplify OutputableBndr This replaces three methods in OutputableBndr with one, and adds comments. There's also a tiny change in the placement of equals signs in debug-prints. I like it better that way, but if it complicates life for anyone we can put it back. --- compiler/utils/Outputable.hs | 18 ++++++------------ 1 file changed, 6 insertions(+), 12 deletions(-) (limited to 'compiler/utils') diff --git a/compiler/utils/Outputable.hs b/compiler/utils/Outputable.hs index d78411a893..8a2afbec79 100644 --- a/compiler/utils/Outputable.hs +++ b/compiler/utils/Outputable.hs @@ -962,18 +962,12 @@ class Outputable a => OutputableBndr a where -- prefix position of an application, thus (f a b) or ((+) x) -- or infix position, thus (a `f` b) or (x + y) - pprNonRecBndrKeyword, pprRecBndrKeyword :: a -> SDoc - -- Print which keyword introduces the binder in Core code. This should be - -- "let" or "letrec" for a value but "join" or "joinrec" for a join point. - pprNonRecBndrKeyword _ = text "let" - pprRecBndrKeyword _ = text "letrec" - - pprLamsOnLhs :: a -> Int - -- For a join point of join arity n, we want to print j = \x1 ... xn -> e - -- as "j x1 ... xn = e" to differentiate when a join point returns a - -- lambda (the first rendering looks like a nullary join point returning - -- an n-argument function). - pprLamsOnLhs _ = 0 + bndrIsJoin_maybe :: a -> Maybe Int + bndrIsJoin_maybe _ = Nothing + -- When pretty-printing we sometimes want to find + -- whether the binder is a join point. You might think + -- we could have a function of type (a->Var), but Var + -- isn't available yet, alas {- ************************************************************************ -- cgit v1.2.1