Hi all,
Just wondering if there could be a typo in section 7.7.2.1 of the GHC manual
(type family declarations)
http://www.haskell.org/ghc/docs/latest/html/users_guide/type-families.html
Specifically, it says
type family F a b :: * -> * -- F's arity is 2,
-- al
Hi Tyson,
I don't think this is a bug.
> type family F a b :: * -> * -- F's arity is 2,
> -- although its overall kind is * -> * -> * -> *
> F Char [Int] -- OK! Kind: * -> *
Char :: *
[Int] :: *
So we can "fill" in the first two * in the kind * -> * -> * ->
> type family F a b :: * -> * -- F's arity is 2,
> -- although its overall kind is * -> * -> * -> *
I believe what you're missing is that with the definition F a b :: *
-> *, F needs three arguments (of kind *) in order to become kind *.
If F a b :: * -> * as stated,
Hi Max and Niklas,
Thank you both for your answers. I get it now.
I didn't read carefully enough to note that the explicit type on F a b was the
type of F and the type of F (although, in retrospect, this last interpretation
wouldn't have worked as we would have need at least * -> * -> *).
Tha