RetractableTo S¶
coerce.spad line 53 [edit on github]
S: Type
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 ofS
if possible. Error: if a cannot be made into an element ofS
.
- retractIfCan: % -> Union(S, failed)
retractIfCan(a)
transforms a into an element ofS
if possible. Returns “failed” if a cannot be made into an element ofS
.