summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSimon Peyton Jones <simonpj@microsoft.com>2015-04-09 15:02:08 +0100
committerSimon Peyton Jones <simonpj@microsoft.com>2015-04-09 17:36:59 +0100
commit2d68aa650b2c47e011aaa7e51227491c3f1e9866 (patch)
tree5d442e91827c26c5c12aef81b26391353fced604
parentf536d89603bb49dea192b47f54416dc88da980af (diff)
downloadhaskell-2d68aa650b2c47e011aaa7e51227491c3f1e9866.tar.gz
Comments about AnyK
-rw-r--r--compiler/prelude/TysPrim.hs12
1 files changed, 8 insertions, 4 deletions
diff --git a/compiler/prelude/TysPrim.hs b/compiler/prelude/TysPrim.hs
index b1007e0224..19c64ef9cd 100644
--- a/compiler/prelude/TysPrim.hs
+++ b/compiler/prelude/TysPrim.hs
@@ -728,16 +728,20 @@ The type constructor Any of kind forall k. k has these properties:
Note [Any kinds]
~~~~~~~~~~~~~~~~
-
The type constructor AnyK (of sort BOX) is used internally only to zonk kind
variables with no constraints on them. It appears in similar circumstances to
Any, but at the kind level. For example:
type family Length (l :: [k]) :: Nat
- type instance Length [] = Zero
-Length is kind-polymorphic, and when applied to the empty (promoted) list it
-will have the kind Length AnyK [].
+ f :: Proxy (Length []) -> Int
+ f = ....
+
+Length is kind-polymorphic. So what is the elaborated type of f?
+ f :: Proxy (Length AnyK ([] AnyK)) -> Int
+
+Just like (length []) at the term level, which elaborates to
+ length (Any *) ([] (Any *))
Note [Strangely-kinded void TyCons]
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~