package lrgrep

  1. Overview
  2. Docs
Detailed error messages for Menhir-generated parsers

Install

dune-project
 Dependency

Authors

Maintainers

Sources

lrgrep-0.9.tbz
sha256=e53de12e4c5cbe6bca00643593266b4f9fa2e3f6a138195eeff7a4329f5c1c75
sha512=7fd7c4d11506fea7cc11c9bbf5aea9142d905643553c0c90e1bb16b794106b0c14a266acf89ae91b6929008dc0ba6515f788642873e2e4ba6c3d49bd45d25127

doc/fix/Fix/Memoize/Char/index.html

Module Memoize.CharSource

A memoizer for the type char.

Sourcetype key = char

The type of keys.

Sourceval memoize : (key -> 'a) -> key -> 'a

memoize is a memoization combinator for the type key. The function call memoize f produces a function f' that behaves extensionally like f, but is memoized.

Sourcetype 'a t

The type of memoization tables.

Sourceval visibly_memoize : (key -> 'a) -> (key -> 'a) * 'a t

visibly_memoize is a memoization combinator that exposes the memoization table. The function call visibly_memoize f returns a pair of a memoized function f' and a memoization table.

Sourceval fix : ((key -> 'a) -> key -> 'a) -> key -> 'a

fix is a recursive memoization combinator.

Sourceexception Cycle of key list * key

Cycle is raised by defensive_fix when a dependency cycle is detected.

Sourceval defensive_fix : ((key -> 'a) -> key -> 'a) -> key -> 'a

defensive_fix works like fix, except it detects circular dependencies, which can arise if the second-order function supplied by the user does not follow a well-founded recursion pattern. When the user invokes f x, where f is the function returned by defensive_fix, if a cyclic dependency is detected, then Cycle (zs, z) is raised, where the list zs begins with z and continues with a series of intermediate keys, leading back to z. Note that undetected divergence remains possible; this corresponds to an infinite dependency chain, without a cycle.

Sourceval curried : (((('a * 'b) -> 'c) -> ('a * 'b) -> 'c) -> ('a * 'b) -> 'c) -> (('a -> 'b -> 'c) -> 'a -> 'b -> 'c) -> 'a -> 'b -> 'c

curried can be used to obtain a curried version of fix or defensive_fix in a concrete instance where the type key is a product type.