package yocaml

  1. Overview
  2. Docs
Core engine of the YOCaml Static Site Generator

Install

dune-project
 Dependency

Authors

Maintainers

Sources

yocaml-3.0.0.tbz
sha256=c5237c5f345f76c829fd9f4ec5fcd05051e6f4372b24ecf798a48c2649ce9a0e
sha512=babeab686e031160882b739f07773bf1a2ae94a10de8992a4d812b35a487a353c2d3d915ac17fe74b7961570984c62d022c9108aa72562b5d81f93829ef62576

doc/yocaml/Yocaml/Data/Validation/String/index.html

Module Validation.StringSource

Sourceval equal : string -> string -> string validated_value

equal expected actual ensures that actual is equal to expected.

Sourceval not_equal : string -> string -> string validated_value

not_equal not_expected actual ensures that actual is not equal to not_expected.

Sourceval not_empty : string -> string validated_value

not_empty actual ensures that actual is not empty.

Sourceval not_blank : string -> string validated_value

not_blank actual ensures that actual is not blank (after trimming whitespace).

Sourceval has_prefix : prefix:string -> string -> string validated_value

has_prefix ~prefix actual ensures that actual starts with prefix.

Sourceval has_suffix : suffix:string -> string -> string validated_value

has_suffix ~suffix actual ensures that actual ends with suffix.

Sourceval has_length : int -> string -> string validated_value

has_length expected_length actual ensures that actual has exactly expected_length characters.

Sourceval length_gt : int -> string -> string validated_value

length_gt min_length actual ensures that actual has more than min_length characters.

Sourceval length_ge : int -> string -> string validated_value

length_ge min_length actual ensures that actual has at least min_length characters.

Sourceval length_eq : int -> string -> string validated_value

length_eq expected_length actual is an alias for has_length.

Sourceval length_lt : int -> string -> string validated_value

length_lt max_length actual ensures that actual has fewer than max_length characters.

Sourceval length_le : int -> string -> string validated_value

length_le max_length actual ensures that actual has at most max_length characters.

Sourceval contains_only : chars:char list -> string -> string validated_value

contains_only ~chars actual ensures that actual contains only characters from chars.

Sourceval exclude_chars : chars:char list -> string -> string validated_value

exclude_chars ~chars actual ensures that actual does not contain any characters from chars.

Sourceval one_of : ?case_sensitive:bool -> string list -> string -> string validated_value

one_of ?case_sensitive valid_strings actual ensures that actual is one of valid_strings. If case_sensitive is false, comparison is case-insensitive.

Sourceval where : ?message:(string -> string) -> (string -> bool) -> string -> string validated_value

where ?message predicate actual ensures that actual satisfies predicate. message is used for custom error messages.

Sourceval where_opt : ?message:(string -> string) -> (string -> 'b option) -> string -> 'b validated_value

where_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.

Sourceval lowercase_ascii : string -> string
Sourceval trim : string -> string