John notes that recursive type synonyms may lead to less comprehensible
error messages. Good point!
As John says, experimentation would be a good idea. Any takers?
Cheers, -- P
John notes that recursive type synonyms may lead to less comprehensible
error messages. Good point!
As John says, experimentation would be a good idea. Any takers?
Cheers, -- P
A simple suggestion (for experimentation): All recursive types needed to
typecheck a program must
In view of the recent suggestion of Philip Wadler re: Recursive type synonyms
The suggestion is:
Remove the restriction that type synonym
declarations must not be recursive.
In other words, one could write things like
type Stream a = (a, Stream a)
which is equivalent
[I hear cries of Haskell 2]
Phil Wadler writes:
The suggestion is:
Remove the restriction that type synonym
declarations must not be recursive.
[...]
The obvious way to go is for someone to implement it first, to
make sure it's not difficult. Mark Jones, have you tried
Mark Jones gives the following alternative definitions for Lists:
type List a b = b - (a - b - b) - b
nil :: List a b
nil f g= f
cons :: a - List a b - List a b
cons x xs f g = g x (xs f g)
fold :: b - (a - b - b) - List a b
While we are proposing things, here's a further suggestion.
The great thing about this suggestion is that it only *removes*
a restriction, and makes the language definition simpler.
It is fully backward compatible.
The suggestion is:
Remove the restriction that type synonym