checkListOfEnum
lib.trivial.checkListOfEnum
Docs pulled from | This Revision | 17 minutes ago
Check if the elements in a list are valid values from a enum, returning the identity function, or throwing an error message otherwise.
Inputs
msg
-
1. Function argument
valid
-
2. Function argument
given
-
3. Function argument
Type
String -> List ComparableVal -> List ComparableVal -> a -> a
Examples
lib.trivial.checkListOfEnum
usage example
let colorVariants = ["bright" "dark" "black"]
in checkListOfEnum "color variants" [ "standard" "light" "dark" ] colorVariants;
=>
error: color variants: bright, black unexpected; valid ones: standard, light, dark