
7 Feb
2006
7 Feb
'06
7:38 p.m.
On 2/5/06, Jim Apple
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