Commits

bergsoe  committed 29a58c1

API doc.

  • Participants
  • Parent commits 1156f73

Comments (0)

Files changed (1)

File src/PaplConstraint.mli

 (** {3 Types} *)
 
 type 'a t
+(** The type of a constraint on values of type ['a]. *)
 
 (** {3 Operations} *)
 
 val accept : 'a t -> 'a -> bool
+(** [accept c x] is true if and only if [c] accepts [x]. *)
 
 val reject : 'a t -> 'a -> bool
+(** [reject c x] is true if and only if [c] rejects [x]. *)
 
 (** {3 Constructors} *)
 
 val make_accept : ('a -> bool) -> 'a t
+(** The constraint [c = make_accept f] accepts [x] if and only if [f x] is
+    true. *)
 
 val make_reject : ('a -> bool) -> 'a t
+(** The constraint [c = make_reject f] rejects [x] if and only if [f x] is
+    true. *)
 
 val fixed_reject : bool -> 'a t
 (** A fixed constraint.
 *)
 
 val merge : ('a t) BatEnum.t -> 'a t
+(** The constraint [c = merge cs] rejects [x] if and only if any of the
+    constraints of [cs] rejects [x]. A logical equivalent is that [c] accepts
+    [x] if and only if all of the constraints of [cs] accept [x].
+*)
 
 val invert : 'a t -> 'a t
 (** Logical inversion of a constraint.
 
-    The constraint [c' = invert c] returns [not b] where [b] is the value
-    returned by [c].
+    The constraint [c' = invert c] returns [not b] for [x] where [b] is the
+    value returned by [accept c x] or [reject c x].
 *)
 
 val bind : ('b -> 'a) -> 'a t -> 'b t
+(** The constraint [c' = bind f c] applied to [x] is equivalent to [c] applied
+    to [f x].
+*)
 
 val constrain_path : 'a t -> 'a list t
+(** A constraint for a path.
+
+    The path constraint [pc = constrain_path c] rejects a list [xs] if any of
+    the elements [x] of [xs] is rejected by [c].
+*)