package yocaml
Install
dune-project
Dependency
Authors
Maintainers
Sources
sha256=c5237c5f345f76c829fd9f4ec5fcd05051e6f4372b24ecf798a48c2649ce9a0e
sha512=babeab686e031160882b739f07773bf1a2ae94a10de8992a4d812b35a487a353c2d3d915ac17fe74b7961570984c62d022c9108aa72562b5d81f93829ef62576
doc/yocaml/Yocaml/Data/Validation/String/index.html
Module Validation.StringSource
equal expected actual ensures that actual is equal to expected.
not_equal not_expected actual ensures that actual is not equal to not_expected.
not_empty actual ensures that actual is not empty.
not_blank actual ensures that actual is not blank (after trimming whitespace).
has_prefix ~prefix actual ensures that actual starts with prefix.
has_suffix ~suffix actual ensures that actual ends with suffix.
has_length expected_length actual ensures that actual has exactly expected_length characters.
length_gt min_length actual ensures that actual has more than min_length characters.
length_ge min_length actual ensures that actual has at least min_length characters.
length_eq expected_length actual is an alias for has_length.
length_lt max_length actual ensures that actual has fewer than max_length characters.
length_le max_length actual ensures that actual has at most max_length characters.
contains_only ~chars actual ensures that actual contains only characters from chars.
exclude_chars ~chars actual ensures that actual does not contain any characters from chars.
one_of ?case_sensitive valid_strings actual ensures that actual is one of valid_strings. If case_sensitive is false, comparison is case-insensitive.
val where :
?message:(string -> string) ->
(string -> bool) ->
string ->
string validated_valuewhere ?message predicate actual ensures that actual satisfies predicate. message is used for custom error messages.
val where_opt :
?message:(string -> string) ->
(string -> 'b option) ->
string ->
'b validated_valuewhere_opt ?pp predicate x ensure that predicate x return Some. pp is used for error-reporting.
Useful function to be used with regular string validators.