Skip to content

Commit

Permalink
Simplify ContT.defer
Browse files Browse the repository at this point in the history
There's no need to use a DeferCont here.
  • Loading branch information
cb372 committed Jan 15, 2019
1 parent bbf90b9 commit 5f2f5e1
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions core/src/main/scala/cats/data/ContT.scala
Original file line number Diff line number Diff line change
Expand Up @@ -96,8 +96,10 @@ object ContT {
* }
* }}}
*/
def defer[M[_], A, B](b: => B)(implicit M: Defer[ContT[M, A, ?]]): ContT[M, A, B] =
M.defer(pure(b))
def defer[M[_], A, B](b: => B): ContT[M, A, B] =
apply { cb =>
cb(b)
}

/**
* Build a computation that makes use of a callback, also known as a continuation.
Expand Down

0 comments on commit 5f2f5e1

Please sign in to comment.