package codept-lib

  1. Overview
  2. Docs

Create a solver using the environment module Envt for name resolution and dependendy tracking and the parameter module Param

Parameters

module Envt : Stage.envt
module Eval : Stage.outliner with type envt := Envt.t

Signature

type state = {
  1. resolved : Unit.r Pkg.map;
  2. env : Envt.t;
  3. pending : Eval.on_going i list;
  4. postponed : Unit.s list;
}
val start : Envt.t -> Unit.s list -> state
val eval : ?learn:bool -> state -> Eval.on_going i -> state

eval ~learn {resolved; envt; rest} unit try to compute the signature of unit, and if successful add the unit to the resolved list. Otherwise, the unit is added to the unresolved list. The learn parameter determines, if the environment is updated when the unit is fully resolved

val resolve_dependencies : ?learn:bool -> state -> (Envt.t * Unit.r list, state) result
val resolve_split_dependencies : Envt.t -> Unit.s list Unit.pair -> (Unit.r list Unit.pair, [> `Mli of state | `Ml of Unit.r list * state ]) result

Resolve mli unit first, then use the new environment to resolve ml units

val alias_resolver : state -> Failure.alias_resolver

Resolve current aliases

expose current blocker on an on_going element

val approx_and_try_harder : state -> state

Add approximation to make cycle resolvable, possibly adding spurious dependencies. Drop intermediary units that are deemed non-resolvable

val eq : state -> state -> bool

Compare if two states would lead to the same result for the solver (weak equality?).

val solve : Envt.t -> Unit.s list Unit.pair -> Unit.r list Unit.pair

Solve *

OCaml

Innovation. Community. Security.