ConstraintValueModule
PackageReified.Constraint
Builds and renders portable constraint values.
Summary
| Name | Signature | Synopsis |
|---|---|---|
| ofFloat | ConstraintValue.ofFloat value | Wraps an IEEE double. |
| ofFloat32 | ConstraintValue.ofFloat32 value | Wraps an IEEE single. |
| tryCreate | ConstraintValue.tryCreate value | Projects a runtime value to its portable representation, or None when the type is outside the closed set. |
| ofOperand | ConstraintValue.ofOperand value | Projects an operand to its portable representation, resolving ambiguous types at the call site. |
| render | ConstraintValue.render value | Renders a portable value for a default English message. |
Wraps an IEEE double.
Parameters
| Name | Type | Description |
|---|---|---|
| value | float |
Returns
ConstraintValue
Wraps an IEEE single.
Parameters
| Name | Type | Description |
|---|---|---|
| value | float32 |
Returns
ConstraintValue
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
| Name | Type | Description |
|---|---|---|
| value | 'value |
Returns
ConstraintValue option
Verification Examples
ConstraintValue.tryCreate 3 = Some (ConstraintValue.Integer 3L)
Projects an operand to its portable representation, resolving ambiguous types at the call site.
Parameters
| Name | Type | Description |
|---|---|---|
| value | 'value |
Returns
ConstraintValue option
Verification Examples
let instant = System.DateTimeOffset.UtcNow in ConstraintValue.ofOperand instant // Some (ConstraintValue.DateTimeOffset instant)