Here is the first version of my rewrite of function 'recip' using my
proposal to make 'Maybe(R)' satisfy 'RetractableTo(R)' and using
'coerce/retract' insteal of 'warp/unwrap':

https://github.com/billpage/my-fricas/compare/maybe...billpage:maybe-retract

Contrary to the claim below, I did not find using 'coerce/retract'
verbose and unreadable. To me it seems clear and consistent. In fact
there were no cases in any of the 70 different files where 'recip' is
defined and used where I needed to add any additional type
information. In some cases there is  slightly less since calling
retract (alias unwrap) instead of writing :: does not require
specifying a type.

I am quite sure that the situation must be the same for the rewrite of
'subtractIfCan' and that 'wrap/unwrap' can simply be replaced with
'coerce/retract' without any ambiguity.

I am sorry that this took me some time but it turned out that 'recip'
is quite deeply buried in FriCAS and the changes affected a lot of
code. I am still reviewing the changes and there may be a few places
where they can be polished a little.

Comments and criticism greatly appreciated.

Bill Page.

On 29 September 2017 at 10:45, Bill Page <[email protected]> wrote:
> OK, I will try what you suggest and then present the result.
>
> On 29 September 2017 at 09:40, oldk1331 <[email protected]> wrote:
>> Bill, since we can't persuade each other, I suggest you to convert
>> some Union("failed"..) to Maybe using 'coerce/retract', for example
>> rewrite function 'recip'.
>>
>> Then you will find using 'coerce/retract' is verbose and unreadable.
>>

-- 
You received this message because you are subscribed to the Google Groups 
"FriCAS - computer algebra system" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/fricas-devel.
For more options, visit https://groups.google.com/d/optout.

Reply via email to