package lrgrep
Install
dune-project
Dependency
Authors
Maintainers
Sources
sha256=84a1874d0c063da371e19c84243aac7c40bfcb9aaf204251e0eb0d1f077f2cde
sha512=5a16ff42a196fd741bc64a1bdd45b4dca0098633e73aa665829a44625ec15382891c3643fa210dbe3704336eab095d4024e093e37ae5313810f6754de6119d55
doc/fix/Fix/Memoize/Make/index.html
Module Memoize.MakeSource
Make constructs a memoizer for a type key that is equipped with an implementation of imperative maps.
Parameters
module M : sig ... endSignature
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.
Cycle is raised by defensive_fix when a dependency cycle is detected.
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.
val curried :
(((('a * 'b) -> 'c) -> ('a * 'b) -> 'c) -> ('a * 'b) -> 'c) ->
(('a -> 'b -> 'c) -> 'a -> 'b -> 'c) ->
'a ->
'b ->
'ccurried 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.