current_check_if checked returns nothing in case checked is Some false and otherwise of_fiber (Fiber.current ()) and also calls Fiber.check on the fiber.
equal l r determines whether l and r are maybe equal. Specifically, if either l or r or both is nothing, then they are considered (maybe) equal. Otherwise l and r are compared for physical equality.
equal l r determines whether l and r are maybe unequal. Specifically, if either l or r or both is nothing, then they are considered (maybe) unequal. Otherwise l and r are compared for physical equality.
Design rationale
The fiber identity is often needed only for the purpose of dynamically checking against programming errors. Unfortunately it can be relative expensive to obtain the current fiber.
As a data point, in a benchmark that increments an int ref protected by a mutex, obtaining the fiber identity for the lock and unlock operations — that only need it for error checking purposes — roughly tripled the cost of an increment on a machine.
Using GADTs internally allows an optional fiber to be provided without adding overhead to operations on non-optional fibers and allows optional fibers to used without allocations at a very low cost.