Safe Haskell | None |
---|---|
Language | Haskell2010 |
General-purpose utility functions
- data VerificationRes
- = VerSuccess
- | VerFailure ![Text]
- isVerFailure :: VerificationRes -> Bool
- isVerSuccess :: VerificationRes -> Bool
- verifyGeneric :: [(Bool, Text)] -> VerificationRes
Documentation
data VerificationRes Source #
isVerFailure :: VerificationRes -> Bool Source #
isVerSuccess :: VerificationRes -> Bool Source #
verifyGeneric :: [(Bool, Text)] -> VerificationRes Source #
This function takes list of (predicate, message) pairs and checks each predicate. If predicate is False it's considered an error. If there is at least one error this function returns VerFailure, otherwise VerSuccess is returned. It's useful to verify some data before using it. Example usage: `verifyGeneric [(checkA, "A is bad"), (checkB, "B is bad")]`