Permalink
Browse files

use polymorphic lambdas (#1261)

  • Loading branch information...
1 parent fabab8f commit f53658f4f5218622949d1f72a32f1bf82c416e0b @xuwei-k xuwei-k committed on GitHub Sep 15, 2016
Showing with 82 additions and 136 deletions.
  1. +1 −3 core/src/main/scala/scalaz/Const.scala
  2. +1 −3 core/src/main/scala/scalaz/Coyoneda.scala
  3. +2 −4 core/src/main/scala/scalaz/EitherT.scala
  4. +1 −4 core/src/main/scala/scalaz/FingerTree.scala
  5. +2 −6 core/src/main/scala/scalaz/Free.scala
  6. +4 −6 core/src/main/scala/scalaz/FreeAp.scala
  7. +2 −6 core/src/main/scala/scalaz/FreeT.scala
  8. +1 −4 core/src/main/scala/scalaz/IdT.scala
  9. +6 −6 core/src/main/scala/scalaz/IndexedContsT.scala
  10. +3 −3 core/src/main/scala/scalaz/Isomorphism.scala
  11. +1 −4 core/src/main/scala/scalaz/Kleisli.scala
  12. +3 −3 core/src/main/scala/scalaz/LazyEitherT.scala
  13. +3 −3 core/src/main/scala/scalaz/LazyOptionT.scala
  14. +3 −4 core/src/main/scala/scalaz/Lens.scala
  15. +4 −7 core/src/main/scala/scalaz/ListT.scala
  16. +4 −7 core/src/main/scala/scalaz/MaybeT.scala
  17. +5 −9 core/src/main/scala/scalaz/NaturalTransformation.scala
  18. +4 −7 core/src/main/scala/scalaz/OptionT.scala
  19. +1 −4 core/src/main/scala/scalaz/ReaderWriterStateT.scala
  20. +1 −4 core/src/main/scala/scalaz/StateT.scala
  21. +3 −5 core/src/main/scala/scalaz/StoreT.scala
  22. +3 −3 core/src/main/scala/scalaz/StreamT.scala
  23. +2 −6 core/src/main/scala/scalaz/TheseT.scala
  24. +1 −3 core/src/main/scala/scalaz/TracedT.scala
  25. +1 −4 core/src/main/scala/scalaz/WriterT.scala
  26. +3 −4 effect/src/main/scala/scalaz/effect/RegionT.scala
  27. +3 −3 effect/src/main/scala/scalaz/effect/ST.scala
  28. +7 −10 iteratee/src/main/scala/scalaz/iteratee/IterateeT.scala
  29. +7 −1 project/build.scala
@@ -103,7 +103,5 @@ object Const extends ConstInstances {
/** A properly universally quantified constant function. */
def const[A](a: A): Function0 ~> λ[α => A] =
- new (Function0 ~> λ[α => A]) {
- override def apply[B](fa: Function0[B]): A = a
- }
+ λ[Function0 ~> λ[α => A]](_ => a)
}
@@ -105,9 +105,7 @@ object Coyoneda extends CoyonedaInstances {
/** Turns a natural transformation F ~> G into CF ~> CG */
def liftT[F[_], G[_]](fg: F ~> G): Coyoneda[F, ?] ~> Coyoneda[G, ?] =
- new (Coyoneda[F, ?] ~> Coyoneda[G, ?]) {
- def apply[A](c: Coyoneda[F, A]) = c.trans(fg)
- }
+ λ[Coyoneda[F, ?] ~> Coyoneda[G, ?]](_.trans(fg))
}
@@ -446,10 +446,8 @@ private trait EitherTBitraverse[F[_]] extends Bitraverse[EitherT[F, ?, ?]] with
}
private trait EitherTHoist[A] extends Hoist[λ[(α[_], β) => EitherT[α, A, β]]] {
- def hoist[M[_], N[_]](f: M ~> N)(implicit M: Monad[M]) = new (EitherT[M, A, ?] ~> EitherT[N, A, ?]) {
- def apply[B](mb: EitherT[M, A, B]): EitherT[N, A, B] =
- mb.mapT(f)
- }
+ def hoist[M[_], N[_]](f: M ~> N)(implicit M: Monad[M]) =
+ λ[EitherT[M, A, ?] ~> EitherT[N, A, ?]](_ mapT f)
def liftM[M[_], B](mb: M[B])(implicit M: Monad[M]): EitherT[M, A, B] = EitherT(M.map(mb)(\/.right))
@@ -1095,10 +1095,7 @@ sealed abstract class IndSeqInstances {
implicit val indSeqInstance: MonadPlus[IndSeq] with Traverse[IndSeq] with IsEmpty[IndSeq] =
new MonadPlus[IndSeq] with Traverse[IndSeq] with IsEmpty[IndSeq] with IsomorphismFoldable[IndSeq, FingerTree[Int, ?]]{
def G = implicitly
- override val naturalTrans = new (IndSeq ~> FingerTree[Int, ?]) {
- def apply[A](a: IndSeq[A]) =
- a.self
- }
+ override val naturalTrans = λ[IndSeq ~> FingerTree[Int, ?]](_.self)
def traverseImpl[G[_], A, B](fa: IndSeq[A])(f: A => G[B])(implicit G: Applicative[G]) = {
import std.anyVal._
implicit val r = UnitReducer((_: B) => 1)
@@ -114,9 +114,7 @@ sealed abstract class Free[S[_], A] {
/** Changes the suspension functor by the given natural transformation. */
final def mapSuspension[T[_]](f: S ~> T): Free[T, A] =
- flatMapSuspension(new (S ~> Free[T,?]) {
- def apply[X](s: S[X]) = Suspend(f(s))
- })
+ flatMapSuspension(λ[S ~> Free[T,?]](s => Suspend(f(s))))
/** Modifies the first suspension with the given natural transformation. */
final def mapFirstSuspension(f: S ~> S): Free[S, A] =
@@ -308,9 +306,7 @@ sealed abstract class Free[S[_], A] {
def duplicateF: Free[Free[S, ?], A] = extendF[Free[S,?]](NaturalTransformation.refl[Free[S,?]])
/** Extension in `Free` as a comonad in the endofunctor category. */
- def extendF[T[_]](f: Free[S, ?] ~> T): Free[T, A] = mapSuspension(new (S ~> T) {
- def apply[X](x: S[X]) = f(liftF(x))
- })
+ def extendF[T[_]](f: Free[S, ?] ~> T): Free[T, A] = mapSuspension(λ[S ~> T](x => f(liftF(x))))
/** Extraction from `Free` as a comonad in the endofunctor category. */
def extractF(implicit S: Monad[S]): S[A] = foldMap(NaturalTransformation.refl[S])
@@ -39,9 +39,9 @@ sealed abstract class FreeAp[F[_],A] {
* }}}
*/
def analyze[M:Monoid](f: F ~> λ[α => M]): M =
- foldMap[Const[M, ?]](new (F ~> Const[M, ?]) {
- def apply[X](x: F[X]): Const[M,X] = Const(f(x))
- }).getConst
+ foldMap[Const[M, ?]](
+ λ[F ~> Const[M, ?]](x => Const(f(x)))
+ ).getConst
/**
* The natural transformation from `FreeAp[F,_]` to `FreeAp[G,_]`
@@ -64,9 +64,7 @@ sealed abstract class FreeAp[F[_],A] {
* Embeds this program in the free monad on `F`.
*/
def monadic: Free[F,A] =
- foldMap[Free[F,?]](new (F ~> Free[F,?]) {
- def apply[B](fb: F[B]) = Free.liftF(fb)
- })
+ foldMap[Free[F,?]](λ[F ~> Free[F,?]](Free.liftF(_)))
/** Idiomatic function application */
def ap[B](f: FreeAp[F, A => B]): FreeAp[F,B] = f match {
@@ -190,9 +190,7 @@ sealed abstract class FreeTInstances5 extends FreeTInstances6 {
override def ask =
FreeT.liftM(M1.ask)
override def local[A](f: E => E)(fa: FreeT[S, M, A]) =
- fa.hoist(new (M ~> M){
- def apply[A](a: M[A]) = M1.local(f)(a)
- })
+ fa.hoist(λ[M ~> M](M1.local(f)(_)))
}
}
@@ -229,9 +227,7 @@ sealed abstract class FreeTInstances2 extends FreeTInstances3 {
implicit def freeTHoist[S[_]]: Hoist[FreeT[S, ?[_], ?]] =
new Hoist[FreeT[S, ?[_], ?]] {
def hoist[M[_]: Monad, N[_]](f: M ~> N) =
- new (FreeT[S, M, ?] ~> FreeT[S, N, ?]) {
- def apply[A](fa: FreeT[S, M, A]) = fa.hoist(f)
- }
+ λ[FreeT[S, M, ?] ~> FreeT[S, N, ?]](_ hoist f)
def liftM[G[_]: Monad, A](a: G[A]) =
FreeT.liftM(a)
def apply[G[_]: Monad] =
@@ -132,10 +132,7 @@ private object IdTHoist extends Hoist[IdT] {
new IdT[G, A](a)
def hoist[M[_]: Monad, N[_]](f: M ~> N) =
- new (IdT[M, ?] ~> IdT[N, ?]) {
- def apply[A](fa: IdT[M, A]): IdT[N, A] =
- new IdT[N, A](f(fa.run))
- }
+ λ[IdT[M, ?] ~> IdT[N, ?]](fa => new IdT(f(fa.run)))
implicit def apply[G[_] : Monad]: Monad[IdT[G, ?]] =
IdT.idTMonad[G]
@@ -73,14 +73,14 @@ trait IndexedContsTFunctions {
ContsT { k => M.bind(a)(W.copoint(k)) }
def xhoist[W[_], M[_], N[_], R, O](f: M ~> N, g: N ~> M)(implicit W: Functor[W]): IndexedContsT[W, M, R, O, ?] ~> IndexedContsT[W, N, R, O, ?] =
- new (IndexedContsT[W, M, R, O, ?] ~> IndexedContsT[W, N, R, O, ?]) {
- def apply[A](fa: IndexedContsT[W, M, R, O, A]): IndexedContsT[W, N, R, O, A] = IndexedContsT { wk => f(fa.run(W.map(wk) { k => { x => g(k(x)) } })) }
- }
+ λ[IndexedContsT[W, M, R, O, ?] ~> IndexedContsT[W, N, R, O, ?]](
+ fa => IndexedContsT { wk => f(fa.run(W.map(wk) { k => { x => g(k(x)) } })) }
+ )
def contracohoist[W[_], V[_], M[_], R, O](f: V ~> W): (IndexedContsT[W, M, R, O, ?] ~> IndexedContsT[V, M, R, O, ?]) =
- new (IndexedContsT[W, M, R, O, ?] ~> IndexedContsT[V, M, R, O, ?]) {
- def apply[A](fa: IndexedContsT[W, M, R, O, A]): IndexedContsT[V, M, R, O, A] = IndexedContsT { k => fa.run(f(k)) }
- }
+ λ[IndexedContsT[W, M, R, O, ?] ~> IndexedContsT[V, M, R, O, ?]](
+ fa => IndexedContsT { k => fa.run(f(k)) }
+ )
def shift[W[_], M[_], I, R, J, O, A](f: (A => IndexedContsT[W, M, I, I, O]) => IndexedContsT[W, M, R, J, J])(implicit W: Comonad[W], WA: Applicative[W], M: Monad[M]): IndexedContsT[W, M, R, O, A] =
IndexedContsT { k0 =>
@@ -63,9 +63,9 @@ sealed abstract class Isomorphisms extends IsomorphismsLow0{
}
def %~(f: G ~> G)(implicit FG: Arr[F, G] <~< (F ~> G), GF: Arr[G, F] <~< (G ~> F)): F ~> F =
- new (F ~> F) {
- def apply[A](a: F[A]): F[A] = GF(self.from)(f(FG(self.to)(a)))
- }
+ λ[F ~> F](
+ a => GF(self.from)(f(FG(self.to)(a)))
+ )
}
/**Isomorphism for arrows of kind (* -> * -> *) -> (* -> * -> *) -> * */
@@ -336,10 +336,7 @@ private trait KleisliMonadReader[F[_], R] extends MonadReader[Kleisli[F, R, ?],
private trait KleisliHoist[R] extends Hoist[Kleisli[?[_], R, ?]] {
def hoist[M[_]: Monad, N[_]](f: M ~> N): Kleisli[M, R, ?] ~> Kleisli[N, R, ?] =
- new (Kleisli[M, R, ?] ~> Kleisli[N, R, ?]) {
- def apply[A](m: Kleisli[M, R, A]): Kleisli[N, R, A] =
- m.mapT(f)
- }
+ λ[Kleisli[M, R, ?] ~> Kleisli[N, R, ?]](_ mapT f)
def liftM[G[_] : Monad, A](a: G[A]): Kleisli[G, R, A] =
Kleisli(_ => a)
@@ -279,9 +279,9 @@ sealed abstract class LazyEitherTInstances extends LazyEitherTInstances0 {
implicit def lazyEitherTHoist[A]: Hoist[λ[(a[_], b) => LazyEitherT[a, A, b]]] =
new Hoist[λ[(a[_], b) => LazyEitherT[a, A, b]]] {
override def hoist[M[_]: Monad, N[_]](f: M ~> N) =
- new (LazyEitherT[M, A, ?] ~> LazyEitherT[N, A, ?]) {
- def apply[B](mb: LazyEitherT[M, A, B]) = LazyEitherT(f(mb.run))
- }
+ λ[LazyEitherT[M, A, ?] ~> LazyEitherT[N, A, ?]](
+ mb => LazyEitherT(f(mb.run))
+ )
override def liftM[M[_], B](mb: M[B])(implicit M: Monad[M]) =
LazyEitherT(M.map(mb)(LazyEither.lazyRight[A].apply(_)))
override def apply[M[_]: Monad] =
@@ -162,9 +162,9 @@ private trait LazyOptionTHoist extends Hoist[LazyOptionT] {
LazyOptionT[G, A](G.map[A, LazyOption[A]](a)((a: A) => LazyOption.lazySome(a)))
def hoist[M[_]: Monad, N[_]](f: M ~> N) =
- new (LazyOptionT[M, ?] ~> LazyOptionT[N, ?]) {
- def apply[A](fa: LazyOptionT[M, A]): LazyOptionT[N, A] = LazyOptionT(f.apply(fa.run))
- }
+ λ[LazyOptionT[M, ?] ~> LazyOptionT[N, ?]](
+ fa => LazyOptionT(f.apply(fa.run))
+ )
implicit def apply[G[_] : Monad]: Monad[LazyOptionT[G, ?]] =
LazyOptionT.lazyOptionTMonadPlus[G]
@@ -157,10 +157,9 @@ sealed abstract class LensFamily[A1, A2, B1, B2] {
/** Contravariantly mapping the state of a state monad through a lens is a natural transformation */
def liftsNT: IndexedState[B1, B2, ?] ~> IndexedState[A1, A2, ?] =
- new (IndexedState[B1, B2, ?] ~> IndexedState[A1, A2, ?]) {
- def apply[C](s : IndexedState[B1, B2, C]): IndexedState[A1, A2, C] =
- IndexedState[A1, A2, C](a => modp(s(_), a))
- }
+ λ[IndexedState[B1, B2, ?] ~> IndexedState[A1, A2, ?]](
+ s => IndexedState(a => modp(s(_), a))
+ )
/** Lenses can be composed */
def compose[C1, C2](that: LensFamily[C1, C2, A1, A2]): LensFamily[C1, C2, B1, B2] =
@@ -109,9 +109,9 @@ sealed abstract class ListTInstances extends ListTInstances1 {
object ListT extends ListTInstances {
def listT[M[_]]: (λ[α => M[List[α]]] ~> ListT[M, ?]) =
- new (λ[α => M[List[α]]] ~> ListT[M, ?]) {
- def apply[A](a: M[List[A]]) = new ListT[M, A](a)
- }
+ λ[λ[α => M[List[α]]] ~> ListT[M, ?]](
+ new ListT(_)
+ )
def empty[M[_], A](implicit M: Applicative[M]): ListT[M, A] =
new ListT[M, A](M.point(Nil))
@@ -162,8 +162,5 @@ private trait ListTHoist extends Hoist[ListT] {
fromList(G.map(a)(entry => entry :: Nil))
def hoist[M[_], N[_]](f: M ~> N)(implicit M: Monad[M]): ListT[M, ?] ~> ListT[N, ?] =
- new (ListT[M, ?] ~> ListT[N, ?]) {
- def apply[A](a: ListT[M, A]): ListT[N, A] =
- a.mapT(f)
- }
+ λ[ListT[M, ?] ~> ListT[N, ?]](_ mapT f)
}
@@ -131,9 +131,9 @@ sealed abstract class MaybeTInstances extends MaybeTInstances0 {
object MaybeT extends MaybeTInstances {
def maybeT[M[_]] =
- new (λ[α => M[Maybe[α]]] ~> MaybeT[M, ?]) {
- def apply[A](a: M[Maybe[A]]) = new MaybeT[M, A](a)
- }
+ λ[λ[α => M[Maybe[α]]] ~> MaybeT[M, ?]](
+ new MaybeT(_)
+ )
def just[M[_], A](v: => A)(implicit M: Applicative[M]): MaybeT[M, A] =
MaybeT.maybeT[M].apply[A](M.point(Maybe.just(v)))
@@ -198,10 +198,7 @@ private trait MaybeTHoist extends Hoist[MaybeT] {
MaybeT[G, A](G.map[A, Maybe[A]](a)((a: A) => Maybe.just(a)))
def hoist[M[_]: Monad, N[_]](f: M ~> N) =
- new (MaybeT[M, ?] ~> MaybeT[N, ?]) {
- def apply[A](fa: MaybeT[M, A]): MaybeT[N, A] =
- fa.mapT(f)
- }
+ λ[MaybeT[M, ?] ~> MaybeT[N, ?]](_ mapT f)
implicit def apply[G[_] : Monad]: Monad[MaybeT[G, ?]] =
MaybeT.maybeTMonadPlus[G]
@@ -15,9 +15,9 @@ trait NaturalTransformation[-F[_], +G[_]] {
self =>
def apply[A](fa: F[A]): G[A]
- def compose[E[_]](f: E ~> F): E ~> G = new (E ~> G) {
- def apply[A](ea: E[A]) = self(f(ea))
- }
+ def compose[E[_]](f: E ~> F): E ~> G = λ[E ~> G](
+ ea => self(f(ea))
+ )
def andThen[H[_]](f: G ~> H): F ~> H =
f compose self
@@ -31,15 +31,11 @@ trait NaturalTransformations {
/** `refl` specialized to [[scalaz.Id.Id]]. */
def id =
- new (Id ~> Id) {
- def apply[A](a: A) = a
- }
+ λ[Id ~> Id](a => a)
/** A universally quantified identity function */
def refl[F[_]] =
- new (F ~> F) {
- def apply[A](fa: F[A]) = fa
- }
+ λ[F ~> F](fa => fa)
/** Reify a `NaturalTransformation`. */
implicit def natToFunction[F[_], G[_], A](f: F ~> G): F[A] => G[A] = x => f(x)
@@ -157,9 +157,9 @@ sealed abstract class OptionTInstances extends OptionTInstances0 {
object OptionT extends OptionTInstances {
def optionT[M[_]] =
- new (λ[α => M[Option[α]]] ~> OptionT[M, ?]) {
- def apply[A](a: M[Option[A]]) = new OptionT[M, A](a)
- }
+ λ[λ[α => M[Option[α]]] ~> OptionT[M, ?]](
+ new OptionT(_)
+ )
def some[M[_], A](v: => A)(implicit M: Applicative[M]): OptionT[M, A] =
OptionT.optionT[M].apply[A](M.point(Some(v)))
@@ -245,10 +245,7 @@ private trait OptionTHoist extends Hoist[OptionT] {
OptionT[G, A](G.map[A, Option[A]](a)((a: A) => some(a)))
def hoist[M[_]: Monad, N[_]](f: M ~> N) =
- new (OptionT[M, ?] ~> OptionT[N, ?]) {
- def apply[A](fa: OptionT[M, A]): OptionT[N, A] =
- fa.mapT(f)
- }
+ λ[OptionT[M, ?] ~> OptionT[N, ?]](_ mapT f)
implicit def apply[G[_] : Monad]: Monad[OptionT[G, ?]] = OptionT.optionTMonadPlus[G]
}
@@ -219,10 +219,7 @@ private trait ReaderWriterStateTHoist[R, W, S] extends Hoist[λ[(α[_], β) => R
implicit def W: Monoid[W]
def hoist[M[_], N[_]](f: M ~> N)(implicit M: Monad[M]) =
- new (ReaderWriterStateT[M, R, W, S, ?] ~> ReaderWriterStateT[N, R, W, S, ?]) {
- def apply[A](ma: ReaderWriterStateT[M, R, W, S, A]): ReaderWriterStateT[N, R, W, S, A] =
- ma.mapT(f)
- }
+ λ[ReaderWriterStateT[M, R, W, S, ?] ~> ReaderWriterStateT[N, R, W, S, ?]](_ mapT f)
def liftM[M[_], A](ma: M[A])(implicit M: Monad[M]): ReaderWriterStateT[M, R, W, S, A] =
ReaderWriterStateT( (r,s) => M.map(ma)((W.zero, _, s)))
@@ -268,10 +268,7 @@ private trait StateTHoist[S] extends Hoist[λ[(g[_], a) => StateT[g, S, a]]] {
def liftM[G[_], A](ga: G[A])(implicit G: Monad[G]): StateT[G, S, A] =
StateT(s => G.map(ga)(a => (s, a)))
- def hoist[M[_]: Monad, N[_]](f: M ~> N) = new (StateTF[M, S]#f ~> StateTF[N, S]#f) {
- def apply[A](action: StateT[M, S, A]) =
- action.mapT(f)
- }
+ def hoist[M[_]: Monad, N[_]](f: M ~> N) = λ[StateTF[M, S]#f ~> StateTF[N, S]#f](_ mapT f)
implicit def apply[G[_] : Monad]: Monad[StateT[G, S, ?]] = StateT.stateTMonadState[S, G]
}
@@ -184,10 +184,8 @@ private trait StoreTCohoist[S] extends Cohoist[λ[(ƒ[_], α) => StoreT[ƒ, S,
Cobind[G].map(a.run._1)((z: S => A) => z(a.run._2))
def cohoist[M[_], N[_]: Comonad](f: M ~> N) =
- new (StoreT[M, S, ?] ~> StoreT[N, S, ?]) {
- def apply[A](c: StoreT[M, S, A]) = {
- val (m, a) = c.run
- StoreT((f(m), a))
- }
+ λ[StoreT[M, S, ?] ~> StoreT[N, S, ?]]{ c =>
+ val (m, a) = c.run
+ StoreT((f(m), a))
}
}
@@ -384,11 +384,11 @@ private trait StreamTHoist extends Hoist[StreamT] {
def liftM[G[_], A](a: G[A])(implicit G: Monad[G]): StreamT[G, A] = StreamT[G, A](G.map(a)(Yield(_, empty)))
def hoist[M[_], N[_]](f: M ~> N)(implicit M: Monad[M]): StreamT[M, ?] ~> StreamT[N, ?] =
- new (StreamT[M, ?] ~> StreamT[N, ?]) {
- def apply[A](a: StreamT[M, A]): StreamT[N, A] = StreamT[N, A](f(M.map(a.step)(
+ λ[StreamT[M, ?] ~> StreamT[N, ?]](a =>
+ StreamT(f(M.map(a.step)(
_( yieldd = (a, as) => Yield(a, hoist(f) apply as)
, skip = as => Skip(hoist(f) apply as)
, done = Done
))))
- }
+ )
}
@@ -96,12 +96,8 @@ sealed abstract class TheseTInstances1 {
}
implicit def TheseTHoist[A: Semigroup]: Hoist[TheseT[?[_], A, ?]] = new Hoist[TheseT[?[_], A, ?]] {
- override def hoist[M[_]: Monad, N[_]](f: M ~> N) = {
- new (TheseT[M, A, ?] ~> TheseT[N, A, ?]) {
- override def apply[B](fa: TheseT[M, A, B]): TheseT[N, A, B] =
- fa.mapT(f)
- }
- }
+ override def hoist[M[_]: Monad, N[_]](f: M ~> N) =
+ λ[TheseT[M, A, ?] ~> TheseT[N, A, ?]](_ mapT f)
override def liftM[G[_]: Monad, B](a: G[B]): TheseT[G, A, B] = TheseT(Monad[G].map(a)(x => \&/.That(x)))
@@ -80,9 +80,7 @@ sealed abstract class TracedTInstances0 extends TracedTInstances1 {
implicit final def tracedTCohoist[C: Monoid]: Cohoist[Lambda[(w[_], b) => TracedT[w, C, b]]] =
new Cohoist[Lambda[(w[_], b) => TracedT[w, C, b]]] {
override def cohoist[M[_], N[_]: Comonad](f: M ~> N) =
- new (TracedT[M, C, ?] ~> TracedT[N, C, ?]) {
- def apply[A](fa: TracedT[M, C, A]) = fa.trans(f)
- }
+ λ[TracedT[M, C, ?] ~> TracedT[N, C, ?]](_ trans f)
override def lower[G[_], A](a: TracedT[G, C, A])(implicit G: Cobind[G]) =
a.lower
}
Oops, something went wrong.

0 comments on commit f53658f

Please sign in to comment.