Skip to content

Commit

Permalink
stop importing cats.Functor in gen lens macros
Browse files Browse the repository at this point in the history
  • Loading branch information
enzief committed Jan 9, 2020
1 parent dfa0c89 commit bc1f323
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions macro/src/main/scala/monocle/macros/internal/Macro.scala
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,6 @@ private[macros] class MacroImpl(val c: blackbox.Context) {

c.Expr[PLens[S, T, A, B]](q"""
import monocle.PLens
import cats.Functor
import _root_.scala.language.higherKinds // prevent warning at call site

new PLens[$sTpe, $tTpe, $aTpe, $bTpe]{
Expand All @@ -85,8 +84,8 @@ private[macros] class MacroImpl(val c: blackbox.Context) {
override def set(a: $bTpe): $sTpe => $tTpe =
_.copy($field = a)

override def modifyF[$F[_]: Functor](f: $aTpe => $F[$bTpe])(s: $sTpe): $F[$tTpe] =
Functor[$F].map(f(s.$fieldMethod))(a => s.copy($field = a))
override def modifyF[$F[_]: cats.Functor](f: $aTpe => $F[$bTpe])(s: $sTpe): $F[$tTpe] =
cats.Functor[$F].map(f(s.$fieldMethod))(a => s.copy($field = a))

override def modify(f: $aTpe => $bTpe): $sTpe => $tTpe =
s => s.copy($field = f(s.$fieldMethod))
Expand Down

0 comments on commit bc1f323

Please sign in to comment.