AdvancedModule
PackageReified.Constraint
Building specifications for a catalogue of your own.
Summary
| Name | Signature | Synopsis |
|---|---|---|
| Operations | ||
| tryCreate | Advanced.tryCreate fallback pluralArgument descriptor | Builds a specification, returning the validation failure rather than raising. |
| create | Advanced.create fallback pluralArgument descriptor | Builds a specification, raising when the plural operand names no argument. |
Operations
kind:member
Builds a specification, returning the validation failure rather than raising.
Parameters
| Name | Type | Description |
|---|---|---|
| fallback | string | |
| pluralArgument | string option | |
| descriptor | MessageDescriptor |
Returns
Result<MessageFormatSpec, MessageFormatSpecError>
Verification Examples
let descriptor = MessageDescriptor.Advanced.create "constraint.presence.present" Map.empty in MessageFormatSpec.Advanced.tryCreate "must be present" None descriptorkind:member
Builds a specification, raising when the plural operand names no argument.
Parameters
| Name | Type | Description |
|---|---|---|
| fallback | string | |
| pluralArgument | string option | |
| descriptor | MessageDescriptor |
Returns
MessageFormatSpec
Verification Examples
let descriptor = MessageDescriptor.Advanced.create "constraint.relation.atLeast" Map.empty in MessageFormatSpec.Advanced.create "must be at least {expected}" None descriptor