aboutsummaryrefslogtreecommitdiffstats
path: root/lib/protocols/Evaluator.ml
blob: 789fb9df82f1375efb1d500a6c5617992ea6353d (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
class type implementation = object
  method invoke : 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 = Handle.invoke i (fun o -> o#invoke program)