On 2/5/06, Jim Apple <[EMAIL PROTECTED]> wrote:
> Have we considered Restricted Data Types?
>
> http://www.cs.chalmers.se/~rjmh/Papers/restricted-datatypes.ps
>
> Or even absracting over contexts, as described in section 7.5 (p.
> 14/15) of the above?

I've discovered an extra problem with RDT: Context can "appear" from nowhere:

In module Heap:
data Ord a => Heap a = ...

In another module:
sort :: [a] -> [a]
sort = <some code using Heap>

You wanted to mask the constraint, but it will leak into the type
signature of "sort", and there's nothing you can do about it, short of
some kind of context alias.

--
Taral <[EMAIL PROTECTED]>
"Computer science is no more about computers than astronomy is about
telescopes."
    -- Edsger Dijkstra
_______________________________________________
Haskell-prime mailing list
Haskell-prime@haskell.org
http://haskell.org/mailman/listinfo/haskell-prime

Reply via email to