Syncom.Associativity
Description for the associativity of user-defined operators.
The type of annotation for the associativity of an infix operator.
Let f
be an infix operator and a1
, a2
, and a3
be arguments. Then,
f
is left-associative, then a1 f a2 f a3
is parsed as (a1 f a2) f a3
f
is right-associative, then a1 f a2 f a3
is parsed as a1 f (a2 f a3)
f
is non-associative, then a1 f a2 f a3
is a syntax error.val left_associative : t
left_associative
is Left_associative
.
val right_associative : t
right_associative
is Right_associative
.
val non_associative : t
non_associative
is Non_associative
.
val is_left_associative : t -> bool
is_left_associative f
is true
if and only if f
is Left_associative
.
val is_right_associative : t -> bool
is_right_associative f
is true
if and only if f
is Right_associative
.
val is_non_associative : t -> bool
is_non_associative f
is true
if and only if f
is Non_associative
.
include Support.Eq.EQ with type t := t
equal a b
is true
if and only if a
and b
are equal. This should satisfy the following properties:
equal a a = true
equal a b
is equivalent to equal b a
equal a b = true
and equal b c = true
, then equal a c = true