Re: Recursive type synonyms

1993-10-19 Thread Chris M P Reade
> > 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

Re: Recursive type synonyms

1993-10-19 Thread wadler
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

Recursive type synonyms

1993-10-12 Thread Varol Akman
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 = (

Re: Recursive type synonyms

1993-10-11 Thread John Hughes
errors are discovered. For example, consider iterate 0 f x = x iterate (n+1) f x = f (iterate n x) At present this produces an occurrence type error. With recursive type synonyms, it would be well-typed with the type iterate :: Num a => a -> b -> b where b = (b->b) -> b

Re: Recursive type synonyms

1993-10-07 Thread smk
Phil Wadler wrote: > Mark suggests that Mu types might be better that recursive type > synonyms. I think of them as pretty much equivalent, and it's > simply a question of whether one makes the `mu' syntax accessible > to the user. One certainly needs `mu'

Re: Recursive type synonyms

1993-10-07 Thread kh
[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

Re: Recursive type synonyms

1993-10-07 Thread wadler
Mark suggests that Mu types might be better that recursive type synonyms. I think of them as pretty much equivalent, and it's simply a question of whether one makes the `mu' syntax accessible to the user. One certainly needs `mu' or an equivalent internally for doing the typ

Re: Recursive type synonyms

1993-10-06 Thread Alastair Reid
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 ->

Recursive type synonyms

1993-10-05 Thread wadler
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 decl

Re: Recursive type synonyms

1993-10-05 Thread jones-mark
To illustrate a need for recursive type synonyms, Joe suggests the example: | nil f g = f | cons x xs f g = g x xs | | fold f z xs = xs z (\x xs -> f x (fold f z xs)) Indeed, this doesn't type check in Haskell, and recursive type synonyms woul

Re: Recursive type synonyms

1993-10-05 Thread jones-mark
rated just for the purpose. Dropping the restriction on recursive type synonyms gives a poor man's version of recursive types. Maybe we could find a way to support full recursive types instead, using explicit mu's in type expressions? For example, the stream type might become: type

Re: Recursive type synonyms

1993-10-05 Thread Joe Fasel
Phil writes, | 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