-
Notifications
You must be signed in to change notification settings - Fork 0
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
Can anyone explain what is a functor and a monad is😭 #599
Comments
hi! from my understanding, a functor is a context that makes use of map(). for eg, given a Context[something], we can map functions of type Function<? super T, ? extends T> to get Context[somethingElse]. a monad on the other hand makes use of flatMap(). so, given the same Context[something], we use flatMap() to apply functions of type Function<? super T, Context<? extends T>> to get Context[somethingElse]. since Optional makes use of both map() and flatMap(), it's both a functor and a monad. but this is just based on my understanding of how to differentiate them though. it may not be entirely accurate and there are definitely proper ways of defining them (using the laws maybe...?) |
^does anyone know if functors and monads are tested? |
Monads and functors are tested since it's part of Lecture 11. |
Do look at the laws covered in the lecture slides regarding the laws of functions & monads to see what classifies as functors and monads. From my understanding, something would be considered a functor if
Something would be considered a monad if it fulfils all
|
my TA mentioned that monads and functors aren't tested |
Hi, my TA says it can be tested! Everything except the implementation of Infinite Lists and Asynchronous Programming/CompletableFuture is tested! |
oh ggg!! :o |
tbh abit hard to understand.. |
sos
The text was updated successfully, but these errors were encountered: