package yuujinchou

  1. Overview
  2. Docs
Legend:
Library
Module
Module type
Parameter
Class
Class type
type 'a error =
  1. | ReplacementNotUsed of 'a Pattern.pattern
  2. | EmptyInverseJoin of 'a Pattern.pattern

Error type

type 'a result_ = [
  1. | `NoMatch
    (*

    The pattern does not match the name

    *)
  2. | `Matched of (Pattern.path * 'a) list
    (*

    The pattern matches the name, with a list of tagged new names after renaming

    *)
]

The result type of pattern matching

val run : default:'a -> join:('a -> 'a -> 'a) -> meet:('a -> 'a -> 'a) -> 'a Pattern.pattern -> Pattern.path -> ('a result_, 'a error) result

The pattern matching engine.

  • parameter default

    The default attribute for the engine to start with.

  • parameter join

    The join operator to resolve conflicting attributes.

  • parameter meet

    The meet operator to resolve conflicting attributes.

val run_ : unit Pattern.pattern -> Pattern.path -> (unit result_, unit error) result

The engine specialized to the unit type as the attribute type

val check : 'a Pattern.pattern -> (unit, 'a error) result

Check whether the pattern would lead to errors if run.

val pp_result_ : (Format.formatter -> 'a -> unit) -> Format.formatter -> 'a result_ -> unit

Pretty-printer for result_.

val pp_result : (Format.formatter -> 'a -> unit) -> Format.formatter -> ('a result_, 'a error) result -> unit

Pretty-printer for results of pattern matching.

val pp_check_result : (Format.formatter -> 'a -> unit) -> Format.formatter -> (unit, 'a error) result -> unit

Pretty-printer for results checking patterns.

OCaml

Innovation. Community. Security.