Translate a tree of type
s to a tree of type
If translation fails then
translate s = Left s, otherwise
translate s = Right t where
t is the translated tree.
Parse a string to a tree of type
t, via intermediate representation
as a tree of type
s. Requires a witness of the intermediate type
to be passed as the first argument.
If parsing fails then
parseToTarget s = Left s, otherwise
parseToTarget s = Right t where
t is the parsed tree.