diff options
author | Simon Peyton Jones <simonpj@microsoft.com> | 2017-02-17 13:58:58 +0000 |
---|---|---|
committer | Simon Peyton Jones <simonpj@microsoft.com> | 2017-02-17 14:00:30 +0000 |
commit | 0e7601749d53d59df528ede996d8b54352051498 (patch) | |
tree | 385714bb4676d0df959c846783558fbb824929de /compiler/utils | |
parent | e55986a9810129d47a59c0bd4fcdc96f32108041 (diff) | |
download | haskell-0e7601749d53d59df528ede996d8b54352051498.tar.gz |
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.
Diffstat (limited to 'compiler/utils')
-rw-r--r-- | compiler/utils/Outputable.hs | 18 |
1 files changed, 6 insertions, 12 deletions
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 {- ************************************************************************ |