ConstraintValueModule

PackageReified.Constraint
Builds and renders portable constraint values.

Summary

NameSignatureSynopsis
ofFloatConstraintValue.ofFloat valueWraps an IEEE double.
ofFloat32ConstraintValue.ofFloat32 valueWraps an IEEE single.
tryCreateConstraintValue.tryCreate valueProjects a runtime value to its portable representation, or None when the type is outside the closed set.
ofOperandConstraintValue.ofOperand valueProjects an operand to its portable representation, resolving ambiguous types at the call site.
renderConstraintValue.render valueRenders a portable value for a default English message.

ofFloat

ConstraintValue.ofFloat value
Member
Wraps an IEEE double.

Parameters

NameTypeDescription
valuefloat

Returns

ConstraintValue

ofFloat32

ConstraintValue.ofFloat32 value
Member
Wraps an IEEE single.

Parameters

NameTypeDescription
valuefloat32

Returns

ConstraintValue

tryCreate

ConstraintValue.tryCreate value
Member
Projects a runtime value to its portable representation, or None when the type is outside the closed set. This never throws, including for NaN, infinities, and values no numeric case can hold.

Parameters

NameTypeDescription
value'value

Returns

ConstraintValue option

Verification Examples

ConstraintValue.tryCreate 3 = Some (ConstraintValue.Integer 3L)

ofOperand

ConstraintValue.ofOperand value
Member
Projects an operand to its portable representation, resolving ambiguous types at the call site.

Parameters

NameTypeDescription
value'value

Returns

ConstraintValue option

Verification Examples

let instant = System.DateTimeOffset.UtcNow in ConstraintValue.ofOperand instant // Some (ConstraintValue.DateTimeOffset instant)

render

ConstraintValue.render value
Member
Renders a portable value for a default English message. Not a wire format.

Parameters

NameTypeDescription
valueConstraintValue

Returns

string