On Tuesday 08 Nov 2011 16:35:40 Ralf Hemmecke wrote:
> > Monad(String,List)
>
> Can you give an argument why a compiler would accept your expression,
> but reject
>
>    Monad(String, Map)
>
> or
>
>    Monad(String, Fraction)
>
> ?
> In SPAD such things are decided at compile time, not runtime.
>
> Ralf

So what you are saying is that if we compiled:

Monad(A: Type, M: partialType): Category == with {
     unit: A ->  M o A
     mult: M o M o A ->  M o A
}

and then used:

Monad(String, Fraction)

It would not be detected as an error at that stage because it would
not do the substiutions inside Monad and see that 'Fraction String' is
not a valid type. Perhaps this is another difference between SPAD and
Haskell?

In that case I guess it would need some extra syntax to enforce this
better, perhaps a symbol that means 'can-be-applied-to' like this:

Monad(M: partialType can-be-applied-to A or M): Category == with {
      unit: A ->  M o A
      mult: M o M o A ->  M o A
}

Martin

-- 
You received this message because you are subscribed to the Google Groups 
"FriCAS - computer algebra system" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/fricas-devel?hl=en.

Reply via email to