A good model for the semantics of Maybe is a box that can contain at most
one thing or otherwise is empty. A box that contains another box is not
empty even if that box itself is empty.

Therefore I agree with Waldek.  It seems to me that each instantiation of
Maybe should generate its own "failed" symbol rather than using a global
value.

On Oct 4, 2017 12:59 PM, "Waldek Hebisch" <[email protected]> wrote:

oldk1331 wrote:
>
> A small problem to think about:
>
> Maybe Maybe Integer
>
> Should 't1 := wrap(failed()$Maybe Integer)' equal to
> 't2 := failed()$Maybe Maybe Integer'
>
> Logically speaking, 'failed?(t1)' is false because t1 is
> a Maybe(Integer) valued being wrapped. And 'failed?(t2)'
> is true so they are not equal.
>
> Current implementation of Maybe and Union("failed",...)
> both think 't1=t2' is true.
>
> Again, I think this is a small problem, because
> 1. there's no point of using Maybe(Maybe(XXX)).
> 2. thinking "failed" as a universal thing is understandable.

There is a big problem:
1) Union(X, "failed") may be used as representation for type
   that from outside does not look like Union.  Such type
   may be used in another Union.  ...
2) For correctness we need to distinguish between inner domain
   and outer domain.

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