src/funcynim/predicate

  Source   Edit

This module provides an API to manipulate and combine predicates (procedures of type T -> bool).

Since 1.1.0.

Types

Predicate[T] = T -> bool
Since 1.1.0.   Source   Edit

Procs

func `and`[T](left, right: Predicate[T]): Predicate[T]

Combines left and right predicates with the short circuiting and.

Since 1.1.0.

  Source   Edit
func `not`[T](self: Predicate[T]): Predicate[T]
Since 1.1.0.   Source   Edit
func `or`[T](left, right: Predicate[T]): Predicate[T]

Combines left and right predicates with the short circuiting or.

Since 1.1.0.

  Source   Edit
func alwaysFalse[T](_: T): bool
Since 1.1.0.   Source   Edit
func alwaysTrue[T](_: T): bool
Since 1.1.0.   Source   Edit
func combine[T](left: Predicate[T]; right: Predicate[T];
                combiner: (left: bool, right: bool) -> bool): Predicate[T]

Combines left and right predicates with the given combiner.

Since 1.1.0.

  Source   Edit
func combine[T](left: Predicate[T]; right: Predicate[T];
                combiner: (right: bool) -> ((left: bool) -> bool)): Predicate[T]

Combines left and right predicates with the given curried combiner.

Since 1.1.0.

  Source   Edit
func fold[A; B](self: Predicate[A]; then, else: A -> B): A -> B
Since 1.1.0.   Source   Edit
proc test[T](self: Predicate[T]; value: T): bool
Since 1.1.0.   Source   Edit