jon.recoil.org

Module Ocaml_typing.AllowanceSource

Sourcetype allowed = private
  1. | Allowed
Sourcetype disallowed = private
  1. | Disallowed
Sourcetype left_only = allowed * disallowed
Sourcetype right_only = disallowed * allowed
Sourcetype both = allowed * allowed
Sourcetype 'a pos = 'b * 'c constraint 'a = 'b * 'c

Arrange the permissions appropriately for a positive lattice, by doing nothing.

Sourcetype 'a neg = 'c * 'b constraint 'a = 'b * 'c

Arrange the permissions appropriately for a negative lattice, by swapping left and right.

Sourcemodule type Allow_disallow = sig ... end
Sourcemodule Magic_allow_disallow (X : Allow_disallow) : Allow_disallow with type ('a, 'b, 'd) sided = ('a, 'b, 'd) X.sided

Takes a slow but type-correct Allow_disallow module and returns the magic version, which is faster. NOTE: for this to be sound, the functions in the original module must be identity functions (up to runtime representation).