Relations between Functor typeclass and kind

Hi all, Some days ago, I was talking with someone about Kinds and GADTs. At some point he mention that types with this Kind: (* -> *) are called Functors. So, is there any relations between Functor typeclass and Functor kind? Is it considered as a "pattern"? if so, are there some other ones? If you have any link on this, I'll take them. Thanks in advance for your help.

On Thu, 19 Jun 2014 09:36:56 +0200, Gautier DI FOLCO
Hi all,
Some days ago, I was talking with someone about Kinds and GADTs. At some point he mention that types with this Kind: (* -> *) are called Functors. So, is there any relations between Functor typeclass and Functor kind? Is it considered as a "pattern"? if so, are there some other ones? If you have any link on this, I'll take them.
Thanks in advance for your help.
An argument could be made for all things of kind * -> * being (at least) functors (in the CT sense) from Hask to a discrete subcategory that contains only id :: F a -> F a but this is likely not what he meant. In general, things that are of kind * -> * are not necessarily Haskell Functors, for a simple counterexample see: newtype Auto a = Auto (a -> a) This type does not permit fmap, which would be equivalent to (a -> b) -> (a -> a) -> b -> b. The only general relationship between Functor and * -> * is that Functor's parameter must have that kind, for example in the instance Functor Maybe we have Maybe :: * -> *.

2014-06-19 9:45 GMT+02:00 Niklas Haas
On Thu, 19 Jun 2014 09:36:56 +0200, Gautier DI FOLCO < gautier.difolco@gmail.com> wrote:
Hi all,
Some days ago, I was talking with someone about Kinds and GADTs. At some point he mention that types with this Kind: (* -> *) are called Functors. So, is there any relations between Functor typeclass and Functor kind? Is it considered as a "pattern"? if so, are there some other ones? If you have any link on this, I'll take them.
Thanks in advance for your help.
An argument could be made for all things of kind * -> * being (at least) functors (in the CT sense) from Hask to a discrete subcategory that contains only id :: F a -> F a but this is likely not what he meant.
In general, things that are of kind * -> * are not necessarily Haskell Functors, for a simple counterexample see:
newtype Auto a = Auto (a -> a)
This type does not permit fmap, which would be equivalent to (a -> b) -> (a -> a) -> b -> b.
The only general relationship between Functor and * -> * is that Functor's parameter must have that kind, for example in the instance Functor Maybe we have Maybe :: * -> *. _______________________________________________ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
ok, it's clear, thanks.
participants (2)
-
Gautier DI FOLCO
-
Niklas Haas