Skip to content
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

5.4 Exercise: Monads: Transform and Roll Out is misleading #247

Open
asarkar opened this issue Jan 16, 2024 · 0 comments
Open

5.4 Exercise: Monads: Transform and Roll Out is misleading #247

asarkar opened this issue Jan 16, 2024 · 0 comments

Comments

@asarkar
Copy link

asarkar commented Jan 16, 2024

The problem description states:

Responses are therefore represented as a stack of monads:

type Response[A] = Future[Either[String, A]]

and methods getPowerLevel and canSpecialMove both return Response.

However, the solution redefines the Response[A] type:

type Response[A] = EitherT[Future, String, A]

This is very misleading. Using the Response shown in the problem description, there's no monad stack involved, and it is difficult to understand what the exercise wants.

IMO, it'll be clearer if the Response type definition is left as an exercise for students, with the requirement that the stack is of type Future[Either[String, *]].

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant