aboutsummaryrefslogtreecommitdiffstats
path: root/lib/protocols/Evaluator.ml
blob: 95c2ef8ece560ed8f9cb7b99464033530af9feac (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
class type implementation = object
  method capabilities : string BatSet.t
  method admit : string -> (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 capabilities i = Handle.invoke i (fun o -> o#capabilities)
let admit i source = Handle.invoke i (fun o -> o#admit source)