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

Missing functions for RWST #2304

Closed
LukaJCB opened this issue Jun 23, 2018 · 13 comments
Closed

Missing functions for RWST #2304

LukaJCB opened this issue Jun 23, 2018 · 13 comments
Labels
good first issue Issues that are easier to take on for first time contributors help wanted low-hanging fruit

Comments

@LukaJCB
Copy link
Member

LukaJCB commented Jun 23, 2018

We're currently missing listen from Writer and local from Reader.

Here's an easy implementation:

def listen[A](fa: ReaderWriterStateT[M, E, L, S, A]): ReaderWriterStateT[M, E, L, S, (A, L)] =
  ReaderWriterStateT((e, s) => fa.run(e, s).map {
    case (l, s, a) => (l, s, (a, l))
  })

def local[A](f: E => E)(fa: ReaderWriterStateT[M, E, L, S, A]): ReaderWriterStateT[M, E, L, S, A] =
  ReaderWriterStateT((e, s) => fa.run(f(e), s))
@kubukoz
Copy link
Member

kubukoz commented Jun 23, 2018

You're spoiling the fun with these easy implementations!

@LukaJCB
Copy link
Member Author

LukaJCB commented Jun 26, 2018

Speaking of listen, we should add that one to WriterT as well:

def listen[A, L](w: WriterT[F, L, A]): WriterT[F, L, (A, L)] =
    WriterT(F.map(w.run) {
      case (l, a) => (l, a -> l)
    })

@calvinbrown085
Copy link
Contributor

Hi @LukaJCB I wouldn't mind picking this one up.

@YuvalItzchakov
Copy link
Contributor

@calvinbrown085 Did you end up working on this?

@calvinbrown085
Copy link
Contributor

@YuvalItzchakov I have not yet, I have not found the time! If someone else would like to pick this up please feel free!

@kun-song
Copy link
Contributor

kun-song commented Sep 1, 2018

@calvinbrown085 so I will take it :)

@CucumisSativus
Copy link
Contributor

Hey @satansk are you still working on it? If not would you mind me taking it from you?

@kun-song
Copy link
Contributor

@CucumisSativus I almost forget about this issue, but I will continue to work on this :)

@CucumisSativus
Copy link
Contributor

@satansk so, good luck with it! :)

@kailuowang kailuowang added the good first issue Issues that are easier to take on for first time contributors label May 21, 2019
@wojciechUrbanski
Copy link
Contributor

Hey @satansk, are You working on that issue? If not, can I take it?

@kun-song
Copy link
Contributor

@wojciechUrbanski go ahead, it's yours :)

@barambani
Copy link
Contributor

Happy to add it if no one is doing it.

@barambani
Copy link
Contributor

This can be closed now. Thanks.

@fthomas fthomas closed this as completed Feb 2, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Issues that are easier to take on for first time contributors help wanted low-hanging fruit
Projects
None yet
Development

No branches or pull requests

10 participants