Type-annotate vs convert

This is a bit of a stretch…

In the following old thread:

I proposed a solution (untested!) to the original poster’s problem. The solution involved a constructor for a type S that returned a non-S. I believe that this is permitted by the language. Meanwhile, there is a close relationship between constructors and convert. So I can imagine that there are situations for constructing complex types in which defining convert(T,x) to return a non-T might be useful.

1 Like