package predef
We have our own FP predef for 2 reasons.
1. The obvious political reasons. I don't think there are any really good reasons to need more than one implementation of this library (if we do our job correctly).
Probably more importantly:
2. Library dependencies _do_ have a cost. Especially in the JVM world where we insist of relying on binary compatibility.
- Alphabetic
- By Inheritance
- predef
- AnyRef
- Any
- Hide All
- Show All
- Public
- Protected
Type Members
- trait Applicative[F[_]] extends Functor[F]
- trait ApplicativeSyntax extends AnyRef
Convenience syntax for
Applicative
usage.Convenience syntax for
Applicative
usage.Please forgive the use of overloading here, which avoids having to have an
ApplicativeBuilder
. - trait DecimalPlus[A] extends AnyRef
Operations that are unfortunately missing from
Fractional
- class EitherOps[L, R] extends AnyRef
- trait Functor[F[_]] extends AnyRef
- abstract class Identity[A] extends AnyRef
The simplest form of monad that we can use with hedgehog.
The simplest form of monad that we can use with hedgehog.
NOTE: We _must_ use some form of call-by-need value for our M in GenT[M, ?] to avoid stack overflows.
- trait IntegralPlus[A] extends AnyRef
Operations that are unfortunately missing from
Integral
- sealed trait LazyList[A] extends AnyRef
A _very_ naive lazy-list.
A _very_ naive lazy-list. Unfortunately using Scala
Stream
results in the head being evaluated prematurely for shrinking. - trait Monad[F[_]] extends Applicative[F]
- type State[S, A] = StateT[Identity, S, A]
- case class StateT[M[_], S, A](run: (S) => M[(S, A)]) extends Product with Serializable
- abstract class StateTImplicits1 extends AnyRef
- abstract class StateTImplicits2 extends StateTImplicits1
- trait StateTOpt[M[_]] extends AnyRef
Value Members
- def State: StateTOpt[Identity]
- implicit def eitherOps[L, R](e: Either[L, R]): EitherOps[L, R]
- def findMap[A, B](fa: LazyList[A])(f: (A) => Option[B]): Option[B]
- Annotations
- @tailrec()
- def replicateM[M[_], A](n: Int, fa: M[A])(implicit F: Applicative[M]): M[List[A]]
Performs the action
n
times, returning the list of results. - def sequence[M[_], A](fa: List[M[A]])(implicit F: Applicative[M]): M[List[A]]
Strict sequencing in an applicative functor
M
that ignores the value infa
. - def some[A](a: A): Option[A]
- def stateT[M[_]]: StateTOpt[M]
- def traverse[M[_], A, B](fa: List[A])(f: (A) => M[B])(implicit F: Applicative[M]): M[List[B]]
- object Applicative
- object DecimalPlus
- object Functor
- object Identity
- object IntegralPlus
- object LazyList
- object Monad
- object StateT extends StateTImplicits2 with Serializable