On 5 October 2017 at 01:09, Ralf Hemmecke <[email protected]> wrote:
> On 10/05/2017 02:32 AM, Bill Page wrote:
>>> I think current situation is a good compromise. We can
>>> say in documentation that all instances of Maybe share
>>> a common value of failed(), and nested usage of Maybe
>>> is not recommended, Maybe should not be used as Rep
>>> itself but can be part of Rep.  Do you agree?
>
>> I value correctness much more than performance except in
>> the most extreme and special cases.
>
> There is no general "correctness". Code only behaves correctly
>  with respect to a certain specification.
>

OK perhaps some word other than "correctness" would be better. Anyone
can write some arbitrary specification after the fact in order to
claim that a given piece of code is "correct". What I am concerned
about is consistency of FriCAS as a whole.

> As Qian said, the specification would claim Maybe to a very
> special case. There is a fixed value "failed()" and that is global
> over all domains and not element of any other domain than
> Maybe(X).

I do not want 'Maybe' to be a special case, like not other domain in
FriCAS. It would be completely against the design philosophy of the
original Axiom system to introduce a "fixed value that is global over
all domains".

> Then Maybe(X) represensts
>
>   X \cup \{failed()\}
>
> With that, of course, Maybe(Maybe(X)) must behave like Maybe(X).

You did not define what you mean by \cup . Types are not sets. \cup
could be take to be disjoint union in which case

  X \cup \{failed()\}

is not equal to

  \cup \{failed()\}  \cup \{failed()\}

> I don't see any (big) problem with that, just that Maybe(X) is not the
> same as extending the domain by some new element, but it stands
> for "adding failed() to the domain". I don't see any problem with
> "correctness".

failed() is not a value, it is the absence of a value.

> However, then I would really opt for another name. Otherwise one might
> think that Maybe behaves according to the type equation
>
>   FX = 1 + X
>
> (see https://wiki.haskell.org/Maybe). Actually, I don't know whether
> "Nothing" in Haskell is a global value, but I guess, it it not.
>

In Haskell Maybe is a functor.

-- 
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