aboutsummaryrefslogblamecommitdiffstats
path: root/lib/protocols/Evaluator.ml
blob: 9f4f5c612a0ddcc9066ba1ba1888da4ca83f851b (plain) (tree)
1
2
3
4
5
6
7
8
9
10
                                  
                                                                                                







                                                                                       
                                                                                  
class type implementation = object
  method invoke : Handle.t -> within:Handle.t -> (Handle.t, Concepts.Condition.condition) result
end

type Handle.protocol += Evaluator of implementation
type t = implementation

let make impl = Evaluator (impl :> implementation)
let from handle = Handle.into handle (function Evaluator impl -> Some impl | _ -> None)
let require = Handle.require from
let invoke i program ~within = Handle.invoke i (fun o -> o#invoke program ~within)