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

"Composing ADTs" tutorial code does not work as expected #343

Open
matthew-healy opened this issue Feb 26, 2021 · 2 comments
Open

"Composing ADTs" tutorial code does not work as expected #343

matthew-healy opened this issue Feb 26, 2021 · 2 comments

Comments

@matthew-healy
Copy link

Hi folks,

I started following the eff tutorial earlier today. When I reached the section on Composing ADTs with the Eff monad I found that I was completely unable to get the code to run in the way the documentation suggests it should.

You can find my attempt on Scastie here. I've checked my code multiple times and I can't find any differences to the code in the tutorial. However, as far as I can tell, only the first line of the for-comprehension in program is ever "run".

E.g. if I modify program to instead read:

def program[R :_interact :_dataOp]: Eff[R, Unit] =
  for {
    _ <- tellUser("hello")
    _ <- tellUser("goodbye")
  } yield ()

only hello is printed to the console.

Apologies if a GH issue isn't the right place to raise this, but I've been banging my head against it for a while and have absolutely no idea what (if anything) I've done wrong. Any help would be much appreciated (as would pointers on a better place to ask this question, if appropriate 😄 ).

Thanks!

@benhutchison
Copy link
Collaborator

benhutchison commented Feb 27, 2021 via email

@matthew-healy
Copy link
Author

Hey Ben - that's totally fair, thanks for letting me know! I'll take a look at cats MTL instead. 😁

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

2 participants