Safe Haskell | Safe |
---|---|
Language | Haskell2010 |
AUTHOR
- Dr. Alistair Ward
DESCRIPTION
- A class to define the simple interface, to which data which can self-validation, should conform.
- class SelfValidator v where
- getFirstError :: SelfValidator v => v -> String
- extractErrors :: [(Bool, String)] -> [String]
Type-classes
class SelfValidator v where Source #
The interface to which data which can self-validate should conform.
SelfValidator v => SelfValidator [v] Source # | |
SelfValidator v => SelfValidator (Maybe v) Source # | |
SelfValidator v => SelfValidator (Set v) Source # | |
(SelfValidator a, SelfValidator b) => SelfValidator (a, b) Source # | |
(Ix index, SelfValidator element) => SelfValidator (Array index element) Source # | |
SelfValidator v => SelfValidator (Map k v) Source # | |
(SelfValidator a, SelfValidator b, SelfValidator c) => SelfValidator (a, b, c) Source # | |
Functions
getFirstError :: SelfValidator v => v -> String Source #
Returns the first error only (so only call on failure of isValid
), since subsequent tests may be based on invalid data.