package dolmen

  1. Overview
  2. Docs

Module Builtin.StrSource

Sourcetype _ t =
  1. | T
    (*

    String: ttype: type constructor for strings.

    *)
  2. | Raw of string
    (*

    Str s: String: string literals.

    *)
  3. | Length
    (*

    Str_length: String -> Int: string length.

    *)
  4. | At
    (*

    Str_at: String -> Int -> String: Singleton string containing a character at given position or empty string when position is out of range. The leftmost position is 0.

    *)
  5. | To_code
    (*

    Str_to_code: String -> Int: Str_to_code s is the code point of the only character of s, if s is a singleton string; otherwise, it is -1.

    *)
  6. | Of_code
    (*

    Str_of_code: Int -> String: Str_of_code n is the singleton string whose only character is code point n if n is in the range 0, 196607; otherwise, it is the empty string.

    *)
  7. | Is_digit
    (*

    Str_is_digit: String -> Prop.T: Digit check Str.is_digit s is true iff s consists of a single character which is a decimal digit, that is, a code point in the range 0x0030 ... 0x0039.

    *)
  8. | To_int
    (*

    Str_to_int: String -> Int: Conversion to integers Str.to_int s with s consisting of digits (in the sense of str.is_digit) evaluates to the positive integer denoted by s when seen as a number in base 10 (possibly with leading zeros). It evaluates to -1 if s is empty or contains non-digits.

    *)
  9. | Of_int
    (*

    Str_of_int : Int -> String: Conversion from integers. Str.from_int n with n non-negative is the corresponding string in decimal notation, with no leading zeros. If n < 0, it is the empty string.

    *)
  10. | Concat
    (*

    Str_concat: String -> String -> String: string concatenation.

    *)
  11. | Sub
    (*

    Str_sub: String -> Int -> Int -> String: Str_sub s i n evaluates to the longest (unscattered) substring of s of length at most n starting at position i. It evaluates to the empty string if n is negative or i is not in the interval 0,l-1 where l is the length of s.

    *)
  12. | Index_of
    (*

    Str_index_of: String -> String -> Int -> Int: Index of first occurrence of second string in first one starting at the position specified by the third argument. Str_index_of s t i, with 0 <= i <= |s| is the position of the first occurrence of t in s at or after position i, if any. Otherwise, it is -1. Note that the result is i whenever i is within the range 0, |s| and t is empty.

    *)
  13. | Replace
    (*

    Str_replace: String -> String -> String -> String: Replace Str_replace s t t' is the string obtained by replacing the first occurrence of t in s, if any, by t'. Note that if t is empty, the result is to prepend t' to s; also, if t does not occur in s then the result is s.

    *)
  14. | Replace_all
    (*

    Str_replace_all: String -> String -> String -> String: Str_replace_all s t t’ is s if t is the empty string. Otherwise, it is the string obtained from s by replacing all occurrences of t in s by t’, starting with the first occurrence and proceeding in left-to-right order.

    *)
  15. | Replace_re
    (*

    Str_replace_re: String -> String_RegLan -> String -> String: Str_replace_re s r t is the string obtained by replacing the shortest leftmost non-empty match of r in s, if any, by t. Note that if t is empty, the result is to prepend t to s.

    *)
  16. | Replace_re_all
    (*

    Str_replace_re_all: String -> String_RegLan -> String -> String: Str_replace_re_all s r t is the string obtained by replacing, left-to right, each shortest *non-empty* match of r in s by t.

    *)
  17. | Is_prefix
    (*

    Str_is_prefix: String -> String -> Prop.T: Prefix check Str_is_prefix s t is true iff s is a prefix of t.

    *)
  18. | Is_suffix
    (*

    Str_is_suffix: String -> String -> Prop.T: Suffix check Str_is_suffix s t is true iff s is a suffix of t.

    *)
  19. | Contains
    (*

    Str_contains: String -> String -> Prop.T: Inclusion check Str_contains s t is true iff s contains t.

    *)
  20. | Lexicographic_strict
    (*

    Str_lexicographic_strict: String -> String -> Prop.T: lexicographic ordering (strict).

    *)
  21. | Lexicographic_large
    (*

    Str_lexicographic_large: String -> String -> Prop.T: reflexive closure of the lexicographic ordering.

    *)
  22. | In_re
    (*

    Str_in_re: String -> String_RegLan -> Prop.T: set membership.

    *)
Sourcemodule RegLan : sig ... end