Cats-effect: Proposal: Add `useKleisli` to Resource

Created on 7 Jan 2019  路  2Comments  路  Source: typelevel/cats-effect

Given the existing:

def use[B](f: A => F[B])(implicit F: Bracket[F, Throwable]): F[B]

How about we add:

def useKleisli[B](f: Kleisli[F, A, B])(implicit F: Bracket[F, Throwable]): F[B]

While it's a minor syntactic improvement (usage goes from res.use(foo.run) to res.useKleisli(foo)), maybe it's worth having. WDYT?

Most helpful comment

I think it is introducing a new verb and adding words to the vocabulary is problematic, so it has to be worth it. In this case, I don't think it is.

All 2 comments

I think it is introducing a new verb and adding words to the vocabulary is problematic, so it has to be worth it. In this case, I don't think it is.

Fair enough :)

Was this page helpful?
0 / 5 - 0 ratings