Comment

Comment by leorocky

I don't understand what a functor is or why an array is a functor. Can anyone please explain? I did the wikipedia article for category theory and I read some stack overflow questions and I'm not sure I understand why an array is a functor. It seems some languages have their own meaning for what a "functor" is, confusing the issue.

My initial guess is that a functor is just sort of like a function that casts or does something like return an interface type from a type that implements the interface or a base class. Is that right? I still don't understand why an array is a functor though, I'd imagine it would at least have to be a function?

Edit:

Actually I think he's talking about Haskell's version of an iterable, and it would then make sense to call an array a functor.

https://en.wikibooks.org/wiki/Haskell/The_Functor_class

Why is that called a functor instead of an iterable or enumerable though?

parent leorocky 12 years ago

Discussion

Live from the official Hacker News API

A modern reader for Hacker News · SvelteKit + Skeleton