RetractableTo SΒΆ

coerce.spad line 53

A is retractable to B means that some elementsif A can be converted into elements of B and any element of B can be converted into an element of A.

coerce: S -> %
coerce(a) transforms a into an element of %.
retract: % -> S
retract(a) transforms a into an element of S if possible. Error: if a cannot be made into an element of S.
retractIfCan: % -> Union(S, failed)
retractIfCan(a) transforms a into an element of S if possible. Returns “failed” if a cannot be made into an element of S.