Hacker News new | ask | show | jobs
by crimsonalucard 2424 days ago
So you're saying the constructor of the type itself is a -> f a. Right?

I think I get it. Thanks.

2 comments

I put this in another comment, but I think you're thinking 'a' is a category, but it's an object in a category. The type for a functor (in Haskell) is Hask -> Hask, which is represented by the star notation Sniffnoy uses. That is, it sends objects of Hask to objects of Hask. The object mapping for a functor in Haskell is defined by its "data" or "type" definition.

The notation "a -> f a" means a function that sends elements of 'a' to elements of 'f a', where 'a' is an object of the category Hask. (Functors don't look into the objects at the element level.)

Thanks for the clarification. I think I get it despite the incorrect notation. You guys are talking about some sort of type of types?
Yeah, the "type of types" is called a kind in Haskell https://wiki.haskell.org/Kind https://en.wikipedia.org/wiki/Kind_(type_theory)

Caveat: there seems to be some reason not to think of kinds as actually being the types of datatypes, but I don't understand why that is.

No. It's not a -> f a. It's * -> *. There is no a -> f a here. You are simply mistaken in thinking that any such thing is part of the definition of a functor.