EDTF date intervals with independently described endpoints. Known dates use
EdtfDate's Gregorian 0000..9999 year/month/day profile and scoped qualifiers.
An empty side means Unknown; '..' means explicitly Open. Both sides may be
unknown or open, including '/' and '../..'. These are useful descriptions,
not materialized coverage. Equal or overlapping date domains remain valid.
The LOC examples 1964/2008 and 2004-02-01/2005-02 describe when endpoints
occurred within the supplied calendar units. They do not assert exact year
starts or half-open timestamp appointments. No source spelling, numerical
tolerance, timezone or general uncertainty solver is implied.
This is a declared subset, not full EDTF Level 0, 1 or 2 conformance.
Parsing visits at most 129 UTF-8 bytes; each known side retains EdtfDate's
64-byte limit. Partial known dates retain side-specific Incomplete errors.
parser_for : encoding -> (state -> Try({ value : EdtfInterval, rest : state }, [InvalidEdtfInterval(Error), Encoding(err)]))
where [
encoding.parse_str : encoding, state -> Try({ value : Str, rest : state }, err),
]
Decode one encoded string using this type's text parser.
Encoding failures remain distinct from this profile's validation errors.
The encoding owns framing and its work limits; parse bounds the decoded text.
encoder_for : encoding -> (EdtfInterval, state -> Try(state, err))
where [
encoding.encode_str : Str, state -> Try(state, err),
]
Encodes the canonical standard text as a string in the selected encoding; encoding failures pass through.