Safe Haskell | Safe-Inferred |
---|---|
Language | Haskell98 |
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.
:: v | |
-> [String] | Return either null, or the reasons why the data is invalid. |
SelfValidator v => SelfValidator [v] | |
SelfValidator v => SelfValidator (Maybe v) | |
SelfValidator v => SelfValidator (Set v) | |
(SelfValidator a, SelfValidator b) => SelfValidator (a, b) | |
(Ix index, SelfValidator element) => SelfValidator (Array index element) | |
SelfValidator v => SelfValidator (Map k v) | |
(SelfValidator a, SelfValidator b, SelfValidator c) => SelfValidator (a, b, c) |
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.
extractErrors :: [(Bool, String)] -> [String] Source
Extracts the failed tests from those specified.