haskell - What does * (star) or other kinds mean in an instance list of haddock -
browsing haddocks of various packages come along instance documentations (control.category):
category k (coercion k) category * (->)
or (control.monad.trans.identity):
monadtrans (identityt *)
what here kind signature mean? doesn't show in source, have noticed seems occur in modules use polykinds extension. suspect typeapplication kind. e.g. last example means identityt
monad transformer if it's first argument has kind *
.
so questions are:
- is interpretation correct , kind signature refer to?
- in first
category
instance, how supposed knowk
kind , not type? or have know arity ofcategory
? - what source code analog syntax?
i not asking explanation of kinds.
to quote richard eisenberg’s recent post on haskell-cafe mailing list:
haddock struggles render types
-xpolykinds
enabled. problem ghc not require kind arguments written , not print them out (unless-fprint-explicit-kinds
). haddock, believe, prints out kinds whenever-xpolykinds
on. 2 different definitions same: it's 1 module has-xpolykinds
, other doesn't.the
*
kind of ordinary types.int
has kind*
(we writeint :: *
) whilemaybe
has kind* -> *
.typeable
has kindforall k. k -> constraint
, meaning it's polykinded. in first snippet below,*
argumenttypeable
instantiatesk
*
, because type variable has kind*
.
so yes, guessed, has polykinds
. haddock renders these poly-kinded types sort of “explicit kind application”. happens category
poly-kinded, having kind forall k. (k -> k -> *) -> constraint
, haddock renders kind application alongside each instance.
in opinion, bug or misfeature of haddock, since there no equivalent source code analog far know. confusing, , don’t know of better way understand recognize way manifests , visually infer what’s going on context.
Comments
Post a Comment