bishbosh-0.1.4.0: Plays chess.
Safe HaskellSafe-Inferred
LanguageHaskell2010

BishBosh.Property.SelfValidating

Description

AUTHOR
Dr. Alistair Ward
DESCRIPTION
Defines a class to which data capable of validating itself can confirm.
Synopsis

Type-classes

class SelfValidating a where Source #

  • This class serves data-types which must preserve compatibility beyond that which can be guarded by a smart-constructor.
  • E.g.: data-types which are constructed piece-meal & endure a temporarily invalid state.

Methods

findInvalidity :: a -> [String] Source #

Functions

findErrors :: [(selfValidator -> Bool, String)] -> selfValidator -> [String] Source #

Selects relevant error-messages from the specified association-list, to facilitate implementation of findInvalidity.

Predicates

isValid :: SelfValidating a => a -> Bool Source #

Predicate.

isInvalid :: SelfValidating a => a -> Bool Source #

Predicate.