Module Types.Type_check_tree
type typ = TypedC.typval pp : Stdlib.Format.formatter -> 'a t -> unitval is_valid : 'a t -> boolCheck if the type checking is valid
val create_typing_node :
'a ->
printer:(Stdlib.Format.formatter -> 'a -> unit) ->
typ ->
'a typing_nodeCreate a typing_node from a block, a pretty printer and a type
val sub_check : 'a typing_node -> 'sub t -> 'a tsub_check node sub returns a type tree with node node that is valid iff sub is valid
'sub t -------- : 'a t 'a node
val no_error : 'a typing_node -> 'a tThe type checking went smoothly and raised no errors
val type_error : 'a typing_node -> [ `Typing ] Operator.Alarm.t -> 'a tEmit an error and logs it onto the datatype
Map a function returning a type_check_tree onto a List.t, used in combination with and_
val and_ : 'a typing_node -> tlist -> 'a tConstruct a conjuction of type_check_tree, eagerly evaluated
'sub1 t ... 'subn t
------------------- : 'a t
'a nodeval or_ : 'a typing_node -> ('b -> _ t) -> 'b list -> 'a tLazily construct a disjunction of type tree TODO: improve this documentation
val try_with :
'a 'b. 'a t ->
'b ->
(typ -> [ `Typing ] Operator.Alarm.t -> 'b) ->
'btry_with t default catcher tries to evaluate the typing_tree t to a default value, and catch the first potential error encoutered with catcher
val find_first_error :
_ t ->
(typ -> [ `Typing ] Operator.Alarm.t -> bool) ->
boolfind_first_error t catcher finds the first error in a type tree and applies the catcher, returns true if no error is found. Uses try_with
val save : 'a t -> unitImperativaly save the type checking logs and returns the error tree if the type checking failed
We need this type for higher kinded polymorphism on the different blocks typing tree
val for_all_logs : poly_pred -> booliterates on all the logged typing trees