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

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

The newest version!
package monocats.instances

import cats.Applicative
import monocats.MonoPointed
import scala.language.higherKinds

package object applicative extends ApplicativeInstances

trait ApplicativeInstances {
  implicit def monocatsApplicativeInstances[F[_]: Applicative, A] =
    new ApplicativeMonoPointedInstance[F, A]
}

private[instances] class ApplicativeMonoPointedInstance[F[_], A](
    implicit F: Applicative[F])
    extends FunctorMonoFunctorInstance[F, A]
    with MonoPointed[F[A]] {
  def point(a: Element): F[Element] = F.pure(a)
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy