Case

Case :: # (opaque)

Unicode 17 complete-string case mapping and folding.

Every successful result owns both its transformed text and one source fact for every input scalar. Case conversion never normalizes the source or the result. Context-sensitive rules inspect the original source only.

unicode_default : MappingProfile

Explicit profile selectors for consumers of this sealed module. These semantic values intentionally do not expose generated data IDs.

full : FoldProfile
limits : U64, U64, U64, U64, U64 -> Limits

Construct mandatory resource limits without exposing the sealed record representation. Every Case operation requires this explicit budget.

result_text : Result -> Str

Inspect opaque result and fact values through stable semantic tags. The return tags are structural, so callers can pattern-match them without gaining access to the generated lookup representation.

result_profile : Result -> [MappingUnicodeDefault, MappingTurkic, MappingLithuanian, FoldFull, FoldSimple, FoldTurkicFull, FoldTurkicSimple]
result_profile_revision : Result -> [NoProfileRevision, MappingTurkicV1, MappingLithuanianV1, FoldSimpleV1, FoldTurkicV1]
fact_shape : Fact -> [Unchanged, Simple, Expanded, Removed]
error_limit_resource : Error -> [NoLimitResource, InputBytes, InputScalars, OutputBytes, OutputScalars, Facts]
error_kind : Error -> [LimitExceeded, CoordinateOverflow, InternalEncodingFault]
error_position : Error -> [NoErrorPosition, ErrorPosition(TextPosition)]

CoordinateOverflow carries the absolute scalar-aligned position at which checked coordinate arithmetic failed. Other errors have none.

to_lower : Str, MappingProfile, Limits -> Try(Result, Error)

Apply Unicode 17 full lowercase mappings under an explicit profile.

to_upper : Str, MappingProfile, Limits -> Try(Result, Error)

Apply Unicode 17 full uppercase mappings under an explicit profile.

to_title : Str, MappingProfile, Limits -> Try(Result, Error)

Apply Unicode R3 titlecasing with the package's exact default Word core. Scalars before a word segment's first cased scalar remain unchanged; that scalar title-maps, and every later scalar lower-maps through the boundary.

fold : Str, FoldProfile, Limits -> Try(Result, Error)

Apply Unicode 17 case folding. Full uses C+F, simple uses C+S, and an explicit Turkic profile lets a T mapping override that normal selection.

FoldProfile : [Full, Simple, TurkicFull, TurkicSimple]
Shape : [Unchanged, Simple, Expanded, Removed]
Fact : {
    input : TextRange,
    output : TextRange,
    shape : Shape,
    contextual : Bool,
}
Limits : {
    max_input_bytes : U64,
    max_input_scalars : U64,
    max_output_bytes : U64,
    max_output_scalars : U64,
    max_mapping_facts : U64,
}
Error : [
    LimitExceeded({ resource : [InputBytes, InputScalars, OutputBytes, OutputScalars, Facts], limit : U64, required : U64 }),
    CoordinateOverflow({ at : TextPosition }),
    InternalEncodingFault,
]
Result : {
    text : Str,
    facts : List(Fact),
    unicode_version : UnicodeVersion,
    operation : [Lower, Upper, Title, Fold],
    profile : [Mapping(MappingProfile), Folding(FoldProfile)],
    profile_revision : [None, Some([Mapping(MappingProfileRevision), Folding(FoldProfileRevision)])],
}