Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
GHC
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package Registry
Model registry
Operate
Terraform modules
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Gesh
GHC
Commits
4a736252
Commit
4a736252
authored
26 years ago
by
Keith Wansbrough
Browse files
Options
Downloads
Patches
Plain Diff
[project @ 1999-03-24 12:29:05 by kw217]
Fix pretty-printing of FunTys to not throw away NoteTys (eg type synonyms).
parent
4f4d5030
Loading
Loading
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
ghc/compiler/types/PprType.lhs
+7
-6
7 additions, 6 deletions
ghc/compiler/types/PprType.lhs
with
7 additions
and
6 deletions
ghc/compiler/types/PprType.lhs
+
7
−
6
View file @
4a736252
...
...
@@ -19,7 +19,7 @@ module PprType(
-- friends:
-- (PprType can see all the representations it's trying to print)
import Type ( Type(..), TyNote(..), Kind, ThetaType,
splitFunTys,
splitDictTy_maybe,
splitDictTy_maybe,
splitForAllTys, splitSigmaTy, splitRhoTy,
isDictTy, splitTyConApp_maybe, splitFunTy_maybe,
boxedTypeKind
...
...
@@ -180,12 +180,13 @@ ppr_ty env ctxt_prec ty@(ForAllTy _ _)
ppr_ty env ctxt_prec (FunTy ty1 ty2)
-- We fiddle the precedences passed to left/right branches,
--
so that right associativity comes out nicely...
= maybeParen ctxt_prec fUN_PREC (sep (ppr_ty env fUN_PREC ty1 : pp_rest))
= maybeParen ctxt_prec fUN_PREC (sep (ppr_ty env fUN_PREC ty1 : pp_rest ty2))
--
we don't want to lose usage annotations or synonyms,
-- so we can't use splitFunTys here.
where
(arg_tys, result_ty) = splitFunTys ty2
pp_rest = [ ptext SLIT("-> ") <> ppr_ty env fUN_PREC ty | ty <- arg_tys ++ [result_ty] ]
pp_rest (FunTy ty1 ty2) = pp_codom ty1 : pp_rest ty2
pp_rest ty = [pp_codom ty]
pp_codom ty = ptext SLIT("->") <+> ppr_ty env fUN_PREC ty
ppr_ty env ctxt_prec (AppTy ty1 ty2)
= maybeParen ctxt_prec tYCON_PREC $
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment