package bap-std

  1. Overview
  2. Docs
Legend:
Library
Module
Module type
Parameter
Class
Class type

Variants of values.

type 'a t = 'a tag

register ~name ~uuid (module T) creates a new variant constructor, that accepts values of type T.t. Module T should implement Binable.S and Sexpable.S interfaces, provide compare and pretty-printing pp functions. This functions will be used to print, compare and serialize values.

The returned value of type T.t tag is a special key that can be used with create and get functions to pack and unpack values of type T.t into value.

val register : name:string -> uuid:string -> (module S with type t = 'a) -> 'a tag

register ~name ~uuid (module T) creates a new variant constructor, that accepts values of type T.t. Module T should implement Binable.S and Sexpable.S interfaces, provide compare and pretty-printing pp functions. This functions will be used to print, compare and serialize values.

The returned value of type T.t tag is a special key that can be used with create and get functions to pack and unpack values of type T.t into value.

val register_slot : (Bap_core_theory.Theory.program, 'a option) Bap_core_theory.KB.slot -> (module S with type t = 'a) -> 'a tag

register_slot slot (module T) reflects Knowledge property into BAP value.

slot tag returns a slot associated with the tag.

val name : 'a t -> string

name cons returns a name of a constructor.

val same : 'a t -> 'b t -> bool

same x y is true if tags x and y have the same type.

val same_witness : 'a t -> 'b t -> ('a, 'b) Core_kernel.Type_equal.t option

same_witness x y returns a value witnessing that value tags x and y has the same type.

val same_witness_exn : 'a t -> 'b t -> ('a, 'b) Core_kernel.Type_equal.t

same_witness_exn x y is the same as same_witness but raises exception if not (same x y).

val typeid : 'a t -> typeid

typeid t returns a type identifier of a type tag t.

OCaml

Innovation. Community. Security.