614⟨dom: Partial614⟩≡ (613) Partial(S:Type): with { ⟨exports: Partial615⟩ } == add { Rep == Record(failed?: Boolean, val: S); import from Rep, Boolean; ⟨implementation: Partial616⟩ } Defines: Partial, used in chunks428band617.
Exports of Partial
bracket: S -> %
failed: %
failed?: % -> Boolean
retract: % -> S
if S has PrimitiveType then PrimitiveType;
if S has OutputType then OutputType;
if S has SetCategory then SetCategory;
615⟨exports: Partial615⟩≡ (614) bracket: S -> %; failed: %; failed?: % -> Boolean; retract: % -> S; if S has PrimitiveType then PrimitiveType; if S hasOutputType thenOutputType; if S has SetCategory then SetCategory; UsesOutputType570.
retract(x:%): S == { import from Boolean; assert(~failed? x); rep(x).val; }
if S has PrimitiveType or S has SetCategory then { (x:%) = (y:%):Boolean == { import from S; fy? := failed? y; failed? x => fy?; ~fy? and retract x = retract y; } }
if S hasOutputType then { (tw: TextWriter) << (x: %): TextWriter == { import fromString; failed? x => tw << "failed"; tw << "[" << retract x << "]"; } } UsesOutputType570andString65.