Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

6
  • 5
    Another source of kinds are the kinds of types whose values might be "unlifted" or "unboxed". The kind * a.k.a. Type is the kind of types like Int whose values are "lifted", that is, that can be pending computations (thunks) or even undefined. But Haskell also has types like Int# which are actual "machine ints" that can't be thunks. And each possible in-memory representation has its own kind. This aspect of GHC is still evolving. downloads.haskell.org/~ghc/9.0.1/docs/html/users_guide/exts/…
    – danidiaz
    Commented Feb 12, 2022 at 13:46
  • @danidiaz Yeah, I vaguely follow the developments in that area as they appear in GHC release notes. But I've never really had to use unlifted/unboxed things, so I don't have a good grasp of how it all fits together; I just know where to start reading when I do need to get a better grasp.
    – Ben
    Commented Feb 13, 2022 at 0:44
  • @Ben I have a question about this part: "PolyKinds adds kind variables that work exactly the same way type variables work. Now we can have kinds like forall k. (* -> k) -> k." Forall k is universal k. And * is not constrained, although at least 1 person has written that * is not a wildcard either. What is the difference between * and forall k? Commented Feb 14, 2022 at 11:00
  • 1
    @JamesStrieter k is a variable, you can instantiate it to any kind you like: *, or * -> *, or (* -> *) -> *, etc. * is one specific concrete kind. It doesn't stand as a placeholder to be instantiated by something else, it is the most basic kind; it is also called Type, now, but it always acted like a basic name like Type, not like a wildcard or operator as the * symbol might suggest.
    – Ben
    Commented Feb 14, 2022 at 22:21
  • 1
    @JamesStrieter You could, although "having zero arity" isn't a very distinctive feature. Every member of the kind Bool is also zero arity (True and False, lifted to type-level with the DataKinds extension). Any enum-like type will similarly contain only zero-arity things. Type is a much better name, since that describes what it means and what is unique about it: every type-level thing whose kind is Type can be used as the type of things at the term level, while no type-level thing with a different kind can be used that way.
    – Ben
    Commented Feb 16, 2022 at 11:23