From 5f2f5e109a0378e99bda123f9c33003654b0795a Mon Sep 17 00:00:00 2001 From: Chris Birchall Date: Tue, 15 Jan 2019 21:44:20 +0000 Subject: [PATCH] Simplify ContT.defer There's no need to use a DeferCont here. --- core/src/main/scala/cats/data/ContT.scala | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/core/src/main/scala/cats/data/ContT.scala b/core/src/main/scala/cats/data/ContT.scala index 9476dfd990..6aa0dd91ac 100644 --- a/core/src/main/scala/cats/data/ContT.scala +++ b/core/src/main/scala/cats/data/ContT.scala @@ -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.