-
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
Ex 5 Level 6 flatmap #319
Comments
I managed to solve it with this approach by first assigning |
what i did was to do mapper.apply(this.thing).orElse(null) since the orElse method u created points to this which in this case refers to the mapper.apply |
I attempted this method but I got the error CAP#1 cannot be converted to Maybe<? extends R>. What did you do to avoid this? |
@brookie13 do u mind if u share ur method |
oo ur parameter is wrong. if u see the test case u realise flatMap can take in a param of Maybe Therefore ur flatMap param must be |
OHHH okay I fixed it and now it works. Thank you so much |
Hi currently stuck with level 6 for exercise 5. I am not too sure on how I can return a Maybe without having to typecast it. I've thought about using the map() function in the class and then take the Maybe value inside but I realised that the value would be considered as R instead of Maybe (thus leading to typecasting which brings up the warning). What is another way to go about with this problem?
The text was updated successfully, but these errors were encountered: