check.mli 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. (** This module is a meta-checker. It will take many checkers and aggregate
  2. their result together before providing an unified result.
  3. The modules required to be declared before being used, using the [build]
  4. method, and provided as an array :
  5. {[
  6. let _, e1 = build (module …)
  7. let _, e2 = build (module …)
  8. module Check = Make (struct
  9. let t = [| e1; e2 |]
  10. end)
  11. ]}
  12. *)
  13. module Id : sig
  14. type 'a typeid
  15. (** The type created on-the-fly. *)
  16. end
  17. type t
  18. (** Type of check to apply *)
  19. val build :
  20. (module S.Analyzer
  21. with type Expression.t = _
  22. and type Expression.t' = _
  23. and type Instruction.t = _
  24. and type Instruction.t' = _
  25. and type Location.t = 'a
  26. and type context = _) ->
  27. 'a Id.typeid * t
  28. (** Build a new check from a module following S.Analyzer signature.
  29. Return the result type which hold the final result value, and checker
  30. itself. *)
  31. val get_module : t -> (module S.Analyzer)
  32. type result
  33. val get : 'a Id.typeid -> result -> 'a option
  34. (** The method [get] can be used to get the internal value for one of the
  35. checker used.
  36. *)
  37. module Make (A : sig
  38. val t : t array
  39. end) : sig
  40. include S.Analyzer with type Location.t = result array
  41. end
  42. [@@warning "-67"]