AdvancedModule

PackageReified.Constraint
Building specifications for a catalogue of your own.

Summary

NameSignatureSynopsis
tryCreateAdvanced.tryCreate fallback pluralArgument descriptorBuilds a specification, returning the validation failure rather than raising.
createAdvanced.create fallback pluralArgument descriptorBuilds a specification, raising when the plural operand names no argument.

tryCreate

Advanced.tryCreate fallback pluralArgument descriptor
Member
Builds a specification, returning the validation failure rather than raising.

Parameters

NameTypeDescription
fallbackstring
pluralArgumentstring option
descriptorMessageDescriptor

Returns

Result<MessageFormatSpec, MessageFormatSpecError>

Verification Examples

let descriptor = MessageDescriptor.Advanced.create "constraint.presence.present" Map.empty in MessageFormatSpec.Advanced.tryCreate "must be present" None descriptor

create

Advanced.create fallback pluralArgument descriptor
Member
Builds a specification, raising when the plural operand names no argument.

Parameters

NameTypeDescription
fallbackstring
pluralArgumentstring option
descriptorMessageDescriptor

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