Skip to content

Lift Concurrent actions to Fetch - #189

Merged
purrgrammer merged 2 commits into
masterfrom
liftf
Apr 26, 2019
Merged

Lift Concurrent actions to Fetch#189
purrgrammer merged 2 commits into
masterfrom
liftf

Conversation

@purrgrammer

Copy link
Copy Markdown
Contributor

Closes #188

@purrgrammer
purrgrammer requested a review from diesalbla April 25, 2019 15:09
Comment thread shared/src/main/scala/fetch.scala Outdated

def liftF[F[_] : Concurrent, A](f: F[A]): Fetch[F, A] =
Unfetch[F, A](for {
either <- f.attempt

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I prefer avoiding single-line for comprehensions:

Unfetch[F, A] ( f.attempt.map {
  case Left(err) => Throw[F, A](log => UnhandledException(err, log))
  case Right(r)  => Done[F, A](r)
})

@purrgrammer
purrgrammer merged commit f47a1e1 into master Apr 26, 2019
@purrgrammer
purrgrammer deleted the liftf branch April 26, 2019 09:46
bijancn pushed a commit to bijancn/fetch that referenced this pull request Sep 19, 2019
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

Successfully merging this pull request may close these issues.

Support for lifting F[_]: Concurrent without related Data/DataSource into Fetch

2 participants