RetractableTo(S)

coerce.spad line 53 [edit on github]

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

coerce : S -> %
from CoercibleFrom(S)
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.

CoercibleFrom(S)