CheckerCats

abstract
class CheckerCats extends Checker
trait Checker
class Object
trait Matchable
class Any

Type members

Types

type Check[A] = EitherT[WriterEC, Err, A]
type ReaderConfig[A] = Kleisli[IO, Config, A]
type ReaderEC[A] = Kleisli[ReaderConfig, Env, A]
type WriterEC[A] = WriterT[ReaderEC, Log, A]

Inherited types

type Config
Inherited from
Checker
type Env
Inherited from
Checker
type Err
Inherited from
Checker
type Log
Inherited from
Checker

Value members

Concrete methods

def addLog(log: Log): Check[Unit]
def attempt[A](c: Check[A]): Check[Either[Err, A]]
def checkAll[A](xs: List[Check[A]]): Check[List[A]]

Checks all elements in a list If any of the elements fail, fails

Checks all elements in a list If any of the elements fail, fails

def checkAllFailFAtFirstFlag[A, B : Monoid, F[_] : Monad](ls: => LazyList[A], check: A => F[(B, Boolean)], last: => B): F[(B, Boolean)]
def checkAllFlag[A, B : Monoid, F[_] : Monad](ls: => LazyList[A], check: A => F[(B, Boolean)], last: => B): F[(B, Boolean)]
def checkList[A, B](ls: List[A], check: A => Check[B]): Check[List[B]]
def checkLs[A](cs: List[Check[A]]): Check[List[A]]

Given a list of checks, return the list of values that pass It never fails (in case of failure, it ignores the value)

Given a list of checks, return the list of values that pass It never fails (in case of failure, it ignores the value)

def checkOneOf[A](cs: List[Check[A]], errNone: Err, errMoreThanOne: List[A] => Err): Check[A]
def checkPair1st[A, B](p: (Check[A], B)): Check[(A, B)]
def checkPair2nd[A, B](p: (A, Check[B])): Check[(A, B)]
def checkSequenceFlag[A : Monoid, F[_] : Monad](ls: => List[F[(A, Boolean)]], last: A): F[(A, Boolean)]
def checkSome[A](cs: List[Check[A]], errorIfNone: Err): Check[A]
def checkSome[A](cs: LazyList[Check[A]])(implicit ev: Monoid[Err]): Check[A]
def checkSomeFlag[A, B, F[_] : Monad](ls: => LazyList[A], check: A => F[(B, Boolean)], last: F[(B, Boolean)]): F[(B, Boolean)]

Given a computation check that returns a pair of value and a flag, returns the first value whose flag is true If none is true, returns the value of the computation parameter last

Given a computation check that returns a pair of value and a flag, returns the first value whose flag is true If none is true, returns the value of the computation parameter last

def checkSomeFlagCount[A, B : Monoid](ls: => LazyList[A], check: A => Check[(B, Boolean)], last: B): Check[(B, Int)]
def cond[A, B](check: Check[A], thenPart: A => Check[B], elsePart: Err => Check[B]): Check[B]

Attempts to execute a check If it fails, applies thenPart to the result, otherwise applies elsePart to the error

Attempts to execute a check If it fails, applies thenPart to the result, otherwise applies elsePart to the error

Type Params
A

type returned by the computation

B

type returned the the condition

Value Params
check

Computation to check

elsePart

part to be executed when the check fails

thenPart

part to be executed when it passes

def condFlag[A, B](check: Check[A], thenPart: A => Check[B], elsePart: Err => Check[B]): Check[(B, Boolean)]
def err[A](e: Err): Check[A]
def filterSuccess[A, B](ls: List[A], check: A => Check[B]): Check[List[(A, B)]]

Returns the list of values whose computation is successful

Returns the list of values whose computation is successful

Type Params
A

type of values

B

type returned by computation

Value Params
check

computation to check for each value

ls

list of values

Returns

a computation with a list of pairs for whom the computation was successful

def fromEither[A](e: Either[Err, A]): Check[A]
def fromEitherIO[A](e: EitherT[IO, Err, A]): Check[A]
def fromIO[A](io: IO[A]): Check[A]
def local[A](f: Env => Env)(c: Check[A]): Check[A]
def mkErr[F[_] : Applicative](e: Err): F[Err]
def ok[A](x: A): Check[A]
def optCheck[A, B](c: Option[A], check: A => Check[B], default: => Check[B]): Check[B]

If c is some value, applies check, otherwise applies default

If c is some value, applies check, otherwise applies default

Value Params
c

Optional value

check

check function

default

value in case there is no option

def orElse[A](c1: Check[A], c2: => Check[A]): Check[A]
def readerEC2check[A](c: ReaderEC[A]): Check[A]
def run[A](c: Check[A])(config: Config)(env: Env): IO[(Log, Either[Err, A])]
def runLocal[A](c: Check[A], f: Env => Env): Check[A]
def runLocalSafe[A](c: Check[A], f: Env => Env, safe: (Err, Env) => A): Check[A]

Run a computation in a local environment. If the computation fails, return the result of calling safe function over the current environment

Run a computation in a local environment. If the computation fails, return the result of calling safe function over the current environment

Value Params
c

computation to run

f

environment

safe

function to call if the computation fails

def runLocalW[A](f: Env => Env)(c: WriterEC[A]): WriterEC[A]
def sequence[A](xs: List[Check[A]]): Check[List[A]]
def validateCheck(condition: Boolean, e: Err): Check[Unit]
def writerEC2check[A](c: WriterEC[A]): Check[A]

Inherited methods

def runCheck[A](c: Check[A])(config: Config)(env: Env): IO[(Either[Err, A], Log)]
Inherited from
Checker
def runLog[A](c: Check[A])(config: Config)(env: Env): IO[Log]
Inherited from
Checker
def runValue[A](c: Check[A])(config: Config)(env: Env): IO[Either[Err, A]]
Inherited from
Checker

Concrete fields

lazy protected
val mWriterEC: Monad[WriterEC]

Implicits

Implicits

implicit
val logMonoid: Monoid[Log]