> | Can we have extensional products and functions (or at least the means
> | to define them) please?

> Language issues
> ~~~~~~~~~~~~~~~
> A significant difficulty is that seq is essentially un-implementable
> for unlifted products (requires parallelism). 

Well, all you need is an evaluation with a limited time resource (a counter)
which returns a thunk when the time resource was insufficient to perform the
computation.  One could implement it as a monad :-).

seq would just keep evaluating both components using this method
as long as it only gets thunks back (for both).  With this method available
one can implement 'parallel or' and also a proper equality, i.e. one
that treats (1,[4..])==(2,[4..]) and ([4..],1)==([4..],2) equally.

> Implementation issues
> ~~~~~~~~~~~~~~~~~~~~~
> If your program has no seqs then unlifted products effectively
> means 'add a twiddle to every pattern match'.  This is rather
> easy to implement.

That's essentially the way Miranda does it.
In Miranda, undef and (undef,undef) are indistinguishable - except
when you use seq:

        seq (hd [undef,(5,4)]) 3

is undefined while:

        seq (hd [(undef,undef),(5,4)]) 3

is 3.

Stefan Kahrs


Reply via email to