|
|
|
|
|
by crimsonalucard
2588 days ago
|
|
>(Given any sets A and B there is always a function from A to B unless B is empty and A is nonempty. But that's not very helpful, is it?) Can you clarify this? I can't define a -> f a because the functor can't determine one? What about like for list functor? Int -> [Int]
Doesn't this work?>This doesn't mean anything. A natural transformation is from one functor F:C->D to another functor G:C->D. Not from a functor to... a category? Huh? I'm still kind of confused. Yeah you're right it doesn't make sense. But then the parent poster is saying that a -> f a
is the natural transformation from identity functor to f it seems off to me. It looks to me like it's just a functor from a to f a. So I'm confused with the nomenclature here. a is a category and f a is another category how is a mapping between categories a natural transformation?Isn't this type signature the natural transformation from identity to f?: (a -> a) -> f a
--edit:I think I see where I'm confused. Your last comment on the parent helped. Thanks. |
|
Sorry I confused you here. I meant, if you had a function of that type (a -> f a), you would want a naturality relation to hold for it, like how 'return' for monads is meant to relate to fmap.
As it is, just having a map "a -> f a" is not a natural transformation.
(I think you might be confusing objects of Hask with the category Hask itself. Remember that "a -> f a" means "for each object 'a' of Hask, a function that takes an element of 'a' to an element of 'f a'. The functor is f : Hask -> Hask, an endofunctor. (In haskell, Hask is replaced by stars.) "f a" is the object of Hask that F sends "a" to.)