package mrmime

  1. Overview
  2. Docs

Module Mrmime.LocationSource

Location module.

Sourcetype point = int

Type of point to a flow.

Sourcetype zone = {
  1. a : int;
  2. b : int;
}

Type of zone to a flow.

Sourcetype t

Type of location to a flow

Sourcetype 'a with_location
Sourcetype 'a w = 'a with_location
Sourceval make : point -> point -> t

make a b makes a new location of b - a byte(s) starting at a.

Sourceval some : zone -> t

some z makes a new location from a zone z.

Sourceval none : t

none is a unknowable location.

Sourceval pp : Format.formatter -> t -> unit

Pretty-printer of t.

Sourceval left : t -> point option

left location returns starting index of location.

Sourceval left_exn : t -> point

left_exn location is same as left but it raises an exception if location is an unknowable location (see none).

Sourceval right : t -> point option

right location returns stopping index of location.

Sourceval right_exn : t -> point

right_exn location is same as right but it raises an exception if location is an unknowable location (see none).

Sourceval length : t -> int option

length location returns length of location - how many bytes we have on location.

Sourceval length_exn : t -> int

Same as length but it raises an exception if location is an unknowable location (see none).

Sourceval with_location : location:t -> 'a -> 'a with_location

with_location ~location x injects location into x as a meta-data.

Sourceval inj : location:t -> 'a -> 'a with_location

Alias of with_location.

Sourceval without_location : 'a with_location -> 'a

without_location x extracts value without location meta-data.

Sourceval prj : 'a with_location -> 'a
Sourceval location : 'a with_location -> t

location t extracts location from a value.

Sourceval union : t -> t -> t

union a b merges two locations.

OCaml

Innovation. Community. Security.