Closed lisardo closed 6 years ago
I got it working:
ifInRange : Int -> Int -> (subject -> Int) -> error -> Validator error subject
ifInRange min max subjectToInt error =
ifFalse (\subject -> (subjectToInt subject) >= min && (subjectToInt subject) <= max) error
I'll close the issue.
I'm trying to figure out a way to create a Validator if an Int is between a specific range (e.g. 18 and 120).
The real life use case is to validate age of people.
Is there a way this can be done in the new version of the library?