com.phasmidsoftware.lascala.predicate

Members list

Type members

Classlikes

case object Always extends BasePredicate[Any]

"Always" sub-class of BasePredicate which evaluates to true. //@tparam T

"Always" sub-class of BasePredicate which evaluates to true. //@tparam T

Attributes

Supertypes
trait Singleton
trait Product
trait Mirror
trait Serializable
trait Product
trait Equals
class BasePredicate[Any]
trait Predicate[Any]
trait Any => Try[Boolean]
class Object
trait Matchable
class Any
Show all
Self type
Always.type
case class And[T](p1: Predicate[T], p2: Predicate[T]) extends BasePredicate[T]

"And" sub-class of BasePredicate yielding the conjunction of p1 and p2.

"And" sub-class of BasePredicate yielding the conjunction of p1 and p2.

Type parameters

T

the underlying type of the Predicate

Value parameters

p1

a function T=>Try[Boolean] which will typically be a Predicate; this function will always be evaluated

p2

a function T=>Try[Boolean] which will typically be a Predicate; this function may not be evaluated

Attributes

Supertypes
trait Serializable
trait Product
trait Equals
class BasePredicate[T]
trait Predicate[T]
trait T => Try[Boolean]
class Object
trait Matchable
class Any
Show all
abstract class BasePredicate[T](name: String) extends Predicate[T]

abstract class which partially implements Predicate[T]

abstract class which partially implements Predicate[T]

Type parameters

T

the underlying type of the Predicate

Value parameters

name

the name of this predicate

Attributes

Supertypes
trait Predicate[T]
trait T => Try[Boolean]
class Object
trait Matchable
class Any
Known subtypes
object Always
class And[T]
class EQ[T]
class Func[T]
class GE[T]
class GT[T]
class In[A]
class InBounds[T]
class InRange
class LE[T]
class LT[T]
class Matches[T]
class NE[T]
object Never
class Or[T]
class Pred[T, V]
Show all
Self type
case class EQ[T](y: T)(using evidence$1: Ordering[T]) extends BasePredicate[T]

"EQ" sub-class of BasePredicate which evaluates to true if x = y where x is the parameter passed into the apply method.

"EQ" sub-class of BasePredicate which evaluates to true if x = y where x is the parameter passed into the apply method.

Type parameters

T

the underlying type of the Predicate, which must implement Ordering

Value parameters

y

a T expression

Attributes

Supertypes
trait Serializable
trait Product
trait Equals
class BasePredicate[T]
trait Predicate[T]
trait T => Try[Boolean]
class Object
trait Matchable
class Any
Show all
case class Func[T](p: T => Boolean) extends BasePredicate[T]

"Func" sub-class of BasePredicate which evaluates to true if p(x) where x is the parameter passed into the apply method.

"Func" sub-class of BasePredicate which evaluates to true if p(x) where x is the parameter passed into the apply method.

Type parameters

T

the underlying type of the Predicate, which must implement Ordering

Value parameters

p

a T=> Boolean function (might be another predicate)

Attributes

Supertypes
trait Serializable
trait Product
trait Equals
class BasePredicate[T]
trait Predicate[T]
trait T => Try[Boolean]
class Object
trait Matchable
class Any
Show all
case class GE[T](y: T)(using evidence$1: Ordering[T]) extends BasePredicate[T]

"GE" sub-class of BasePredicate which evaluates to true if x >= y where x is the parameter passed into the apply method.

"GE" sub-class of BasePredicate which evaluates to true if x >= y where x is the parameter passed into the apply method.

Type parameters

T

the underlying type of the Predicate, which must implement Ordering

Value parameters

y

a T expression

Attributes

Supertypes
trait Serializable
trait Product
trait Equals
class BasePredicate[T]
trait Predicate[T]
trait T => Try[Boolean]
class Object
trait Matchable
class Any
Show all
case class GT[T](y: T)(using evidence$1: Ordering[T]) extends BasePredicate[T]

"GT" sub-class of BasePredicate which evaluates to true if x > y where x is the parameter passed into the apply method.

"GT" sub-class of BasePredicate which evaluates to true if x > y where x is the parameter passed into the apply method.

Type parameters

T

the underlying type of the Predicate, which must implement Ordering

Value parameters

y

a T expression

Attributes

Supertypes
trait Serializable
trait Product
trait Equals
class BasePredicate[T]
trait Predicate[T]
trait T => Try[Boolean]
class Object
trait Matchable
class Any
Show all
Self type
GT[T]
case class In[A](as: List[A]) extends BasePredicate[A]

"In" sub-class of BasePredicate which evaluates to true if as contains x where x is the parameter passed into the apply method.

"In" sub-class of BasePredicate which evaluates to true if as contains x where x is the parameter passed into the apply method.

Type parameters

A

the underlying type of the sequence

Value parameters

as

a sequence of A values

Attributes

Supertypes
trait Serializable
trait Product
trait Equals
class BasePredicate[A]
trait Predicate[A]
trait A => Try[Boolean]
class Object
trait Matchable
class Any
Show all
case class InBounds[T](min: T, max: T)(using evidence$1: Ordering[T]) extends BasePredicate[T]

"InBounds" sub-class of BasePredicate which evaluates to true if x >= min & x <= max where x is the parameter passed into the apply method.

"InBounds" sub-class of BasePredicate which evaluates to true if x >= min & x <= max where x is the parameter passed into the apply method.

Type parameters

T

the type of both min and max, and also the underlying type of the resulting Predicate

Value parameters

max

a T expression

min

a T expression

Attributes

Supertypes
trait Serializable
trait Product
trait Equals
class BasePredicate[T]
trait Predicate[T]
trait T => Try[Boolean]
class Object
trait Matchable
class Any
Show all
case class InRange(r: Range) extends BasePredicate[Int]

"InRange" sub-class of BasePredicate[Int] which evaluates to true if r contains x where x is the parameter passed into the apply method.

"InRange" sub-class of BasePredicate[Int] which evaluates to true if r contains x where x is the parameter passed into the apply method.

Value parameters

r

a Range

Attributes

Supertypes
trait Serializable
trait Product
trait Equals
class BasePredicate[Int]
trait Predicate[Int]
trait Int => Try[Boolean]
class Object
trait Matchable
class Any
Show all
case class InvalidPredicate(x: Throwable) extends BasePredicate[Any]

Attributes

Supertypes
trait Serializable
trait Product
trait Equals
class BasePredicate[Any]
trait Predicate[Any]
trait Any => Try[Boolean]
class Object
trait Matchable
class Any
Show all
case class LE[T](y: T)(using evidence$1: Ordering[T]) extends BasePredicate[T]

"LE" sub-class of BasePredicate which evaluates to true if x <= y where x is the parameter passed into the apply method.

"LE" sub-class of BasePredicate which evaluates to true if x <= y where x is the parameter passed into the apply method.

Type parameters

T

the underlying type of the Predicate, which must implement Ordering

Value parameters

y

a T expression

Attributes

Supertypes
trait Serializable
trait Product
trait Equals
class BasePredicate[T]
trait Predicate[T]
trait T => Try[Boolean]
class Object
trait Matchable
class Any
Show all
case class LT[T](y: T)(using evidence$1: Ordering[T]) extends BasePredicate[T]

"LT" sub-class of BasePredicate which evaluates to true if x < y where x is the parameter passed into the apply method.

"LT" sub-class of BasePredicate which evaluates to true if x < y where x is the parameter passed into the apply method.

Type parameters

T

the underlying type of the Predicate, which must implement Ordering

Value parameters

y

a T expression

Attributes

Supertypes
trait Serializable
trait Product
trait Equals
class BasePredicate[T]
trait Predicate[T]
trait T => Try[Boolean]
class Object
trait Matchable
class Any
Show all
case class Matches[T](f: PartialFunction[T, Boolean]) extends BasePredicate[T]

"Matches" sub-class of BasePredicate which evaluates to true if f.isDefinedAt(x) and f(x) where x is the parameter passed into the apply method.

"Matches" sub-class of BasePredicate which evaluates to true if f.isDefinedAt(x) and f(x) where x is the parameter passed into the apply method.

Type parameters

T

the underlying type of the Predicate

Value parameters

f

a T => Boolean partial function

Attributes

Supertypes
trait Serializable
trait Product
trait Equals
class BasePredicate[T]
trait Predicate[T]
trait T => Try[Boolean]
class Object
trait Matchable
class Any
Show all
case class NE[T](y: T)(using evidence$1: Ordering[T]) extends BasePredicate[T]

"NE" sub-class of BasePredicate which evaluates to true if x != y where x is the parameter passed into the apply method.

"NE" sub-class of BasePredicate which evaluates to true if x != y where x is the parameter passed into the apply method.

Type parameters

T

the underlying type of the Predicate, which must implement Ordering

Value parameters

y

a T expression

Attributes

Supertypes
trait Serializable
trait Product
trait Equals
class BasePredicate[T]
trait Predicate[T]
trait T => Try[Boolean]
class Object
trait Matchable
class Any
Show all
case object Never extends BasePredicate[Any]

"Never" sub-class of BasePredicate which evaluates to false. //@tparam T

"Never" sub-class of BasePredicate which evaluates to false. //@tparam T

Attributes

Supertypes
trait Singleton
trait Product
trait Mirror
trait Serializable
trait Product
trait Equals
class BasePredicate[Any]
trait Predicate[Any]
trait Any => Try[Boolean]
class Object
trait Matchable
class Any
Show all
Self type
Never.type
case class Or[T](p1: Predicate[T], p2: Predicate[T]) extends BasePredicate[T]

"Or" sub-class of BasePredicate yielding the disjunction of p1 and p2.

"Or" sub-class of BasePredicate yielding the disjunction of p1 and p2.

Type parameters

T

the underlying type of the Predicate

Value parameters

p1

a function T=>Try[Boolean] which will typically be a Predicate; this function will always be evaluated

p2

a function T=>Try[Boolean] which will typically be a Predicate; this function may not be evaluated

Attributes

Supertypes
trait Serializable
trait Product
trait Equals
class BasePredicate[T]
trait Predicate[T]
trait T => Try[Boolean]
class Object
trait Matchable
class Any
Show all
case class Pred[T, V](p: Predicate[V])(f: T => V) extends BasePredicate[T]

"Pred" sub-class of BasePredicate which evaluates to true if p(f(x)) where x is the parameter passed into the apply method.

"Pred" sub-class of BasePredicate which evaluates to true if p(f(x)) where x is the parameter passed into the apply method.

Type parameters

T

the input type of the function f

V

the output type of the function f and the underlying type of the resulting Predicate

Value parameters

f

a T=>V function

p

a Predicate

Attributes

Supertypes
trait Serializable
trait Product
trait Equals
class BasePredicate[T]
trait Predicate[T]
trait T => Try[Boolean]
class Object
trait Matchable
class Any
Show all
object Predicate

Attributes

Companion
trait
Supertypes
class Object
trait Matchable
class Any
Self type
Predicate.type
trait Predicate[T] extends T => Try[Boolean]

This trait extends the function class T=>Try[Boolean]. Predicates are intended to combine and form rules. At present, a Predicate is a Functor but not a Monad.

This trait extends the function class T=>Try[Boolean]. Predicates are intended to combine and form rules. At present, a Predicate is a Functor but not a Monad.

Created by robinhillyard on 5/24/16.

Attributes

Companion
object
Supertypes
trait T => Try[Boolean]
class Object
trait Matchable
class Any
Known subtypes
class BasePredicate[T]
object Always
class And[T]
class EQ[T]
class Func[T]
class GE[T]
class GT[T]
class In[A]
class InBounds[T]
class InRange
class LE[T]
class LT[T]
class Matches[T]
class NE[T]
object Never
class Or[T]
class Pred[T, V]
Show all
Self type
class PredicateException(s: String) extends Exception

Attributes

Supertypes
class Exception
class Throwable
trait Serializable
class Object
trait Matchable
class Any
Show all