-- Hoogle documentation, generated by Haddock -- See Hoogle, http://www.haskell.org/hoogle/ -- | Validity typeclass -- -- Note: There are companion instance packages for this library: -- --
-- instance Validity Prime where -- isValid (Prime n) = isPrime n --module Data.Validity -- | A class of types that have additional invariants defined upon them -- that aren't enforced by the type system class Validity a isValid :: Validity a => a -> Bool -- | Construct a valid element from an unchecked element constructValid :: Validity a => a -> Maybe a -- | Construct a valid element from an unchecked element, throwing -- error on invalid elements. constructValidUnsafe :: (Show a, Validity a) => a -> a instance (Data.Validity.Validity a, Data.Validity.Validity b) => Data.Validity.Validity (a, b) instance (Data.Validity.Validity a, Data.Validity.Validity b, Data.Validity.Validity c) => Data.Validity.Validity (a, b, c) instance Data.Validity.Validity a => Data.Validity.Validity [a] instance Data.Validity.Validity a => Data.Validity.Validity (GHC.Base.Maybe a) -- | Relative validity module Data.RelativeValidity -- | A class of types that have additional invariants defined upon them -- that aren't enforced by the type system -- -- If there is a Validity a instance as well, then a -- isValidFor b should imply isValid a for any -- b. -- -- If there is a Validity b instance as well, then a -- isValidFor b should imply isValid b for any -- a. class RelativeValidity a b isValidFor :: RelativeValidity a b => a -> b -> Bool