summaryrefslogtreecommitdiff
path: root/compiler
diff options
context:
space:
mode:
authorSimon Peyton Jones <simonpj@microsoft.com>2017-01-13 15:58:06 +0000
committerSimon Peyton Jones <simonpj@microsoft.com>2017-01-16 11:57:16 +0000
commit563d64fd067219a0e42c5f1c83830d2847243f6f (patch)
treefb319756d74163acba3f1d727f1bf5bd5d805977 /compiler
parent5a9a1738023aeb742e537fb4a59c4aa8fecc1f8a (diff)
downloadhaskell-563d64fd067219a0e42c5f1c83830d2847243f6f.tar.gz
Comments about TyBinders (only)
Diffstat (limited to 'compiler')
-rw-r--r--compiler/types/TyCoRep.hs13
1 files changed, 5 insertions, 8 deletions
diff --git a/compiler/types/TyCoRep.hs b/compiler/types/TyCoRep.hs
index 63aba3cf44..ef6917aeba 100644
--- a/compiler/types/TyCoRep.hs
+++ b/compiler/types/TyCoRep.hs
@@ -409,8 +409,9 @@ same kinds.
-- ('Named') or nondependent ('Anon'). They may also be visible or not.
-- See Note [TyBinders]
data TyBinder
- = Named TyVarBinder
- | Anon Type -- Visibility is determined by the type (Constraint vs. *)
+ = Named TyVarBinder -- A type-lambda binder
+ | Anon Type -- A term-lambda binder
+ -- Visibility is determined by the type (Constraint vs. *)
deriving Data.Data
-- | Remove the binder's variable from the set, if the binder has
@@ -437,7 +438,7 @@ A TyBinder represents the type of binders -- that is, the type of an
argument to a Pi-type. GHC Core currently supports two different
Pi-types:
- * A non-dependent function,
+ * A non-dependent function type,
written with ->, e.g. ty1 -> ty2
represented as FunTy ty1 ty2
@@ -447,12 +448,8 @@ Pi-types:
Both Pi-types classify terms/types that take an argument. In other
words, if `x` is either a function or a polytype, `x arg` makes sense
-(for an appropriate `arg`). It is thus often convenient to group
-Pi-types together. This is ForAllTy.
+(for an appropriate `arg`).
-The two constructors for TyBinder sort out the two different possibilities.
-`Named` builds a polytype, while `Anon` builds an ordinary function.
-(ForAllTy (Anon arg) res used to be called FunTy arg res.)
Note [TyBinders and ArgFlags]
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~