elm-validate
elm-validate copied to clipboard
Convenience functions for validating Elm data.
I have the following problem with the current design: It assumes that type of dirty un-validatied input ~~ the type of clean validated output: validation turns `Subject` into a `Valid...
The function `ifNotFloat` will error if the `subject` *is* a float, whereas `ifNotInt` will error if the subject *is not* an int. I believe the behavior of `ifNotInt` is correct....
`ifNoRegexMatch` is mostly a copy-paste of the `ifInvalidEmail` function but it takes an additional String, `pattern` which it interprets as a regular expression and validates the given subject against it.
In the if.... functions section, instead of `modelValidator : Validator Model String` it should be `modelValidator : Validator String Model`
Some sort of contravariant map would allow reusing validators in different contexts. Possible names, with input from @norpan and @gyzerok on slack: - [`preMap`](http://klaftertief.github.io/elm-search/?q=preMap) - [`comap`](http://klaftertief.github.io/elm-search/?q=comap) - `contraMap` (not used...
In the [package documentation](https://package.elm-lang.org/packages/rtfeldman/elm-validate/4.0.1/Validate) there are many examples for ifNotInt in the following form ``` elm ifNotInt .age "Age must be a whole number." ``` But the signature expects the...
Fixed ifNotFloat to create an error in case it could not be parsed to a float. Previously it was creating the error in case it could be parsed to a...
I found typo and fixed it.
There is `ifTrue : (subject -> Bool) -> error -> Validator error subject` to return a fixed error, when a predicate is not true. I think it's a good idea...
Hi, sorry if I've missed this somehow in existing API. I have this part of form which is only displayed if the "trafficking" checkbox is checked, so I need to...