All Downloads are FREE. Search and download functionalities are using the official Maven repository.

monocats.instances.functor.scala Maven / Gradle / Ivy

The newest version!
package monocats.instances

import cats.Functor
import monocats.MonoFunctor
import scala.language.higherKinds

package object functor extends FunctorInstances

trait FunctorInstances {
  implicit def monocatsFunctorInstances[F[_]: Functor, A] =
    new FunctorMonoFunctorInstance[F, A]
}

private[instances] class FunctorMonoFunctorInstance[F[_], A](
    implicit F: Functor[F])
    extends MonoFunctor[F[A]] {
  type Element = A

  def map(fa: F[A])(f: A => A): F[A] = F.map(fa)(f)
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy