-
Notifications
You must be signed in to change notification settings - Fork 48
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Definition of Functor #564
Comments
For the functors, you're right that a functor must follow the 2 laws (identity and associativity), but I'm not so sure about the As for the monads, you need to see whether it has the
You can see in this post (#539) helps explain how to evaluate. Not all monads need to be functors; you need to see what methods they have and whether they follow the rules. |
I think the equivalence of associativity should be |
Omg yes my bad! Thanks for checking! Shall edit my post |
Hi all!
I'm confused about how to decide whether something is a functor. So far my understanding is that a functor should have a constructor, a map() mathod, and follows the functor laws stated in lectures.
However, I'm not sure about the constructor part, like is "new A(sth)" accepted? Or it has to has construction methods like "of(sth)" or "make(sth)".
Also, is it correct to just take monad as "functors with flatmap() mathod"?
Thx :)
The text was updated successfully, but these errors were encountered: