RetractableFrom S¶
coerce.spad line 73 [edit on github]
S: Type
B
is retractable from A means that some elements in A can be converted into elements of B
and any element of B
can be converted into an element of A.
- coerce: % -> S
from CoercibleTo S
- retract: S -> %
retract(a)
transforms a into an element of % if possible. Error: if a cannot be made into an element of %.
- retractIfCan: S -> Union(%, failed)
retractIfCan(a)
transforms a into an element of % if possible. Returns “failed” if a cannot be made into an element of %.