Re: [Haskell-cafe] Re: Equirecursive types?

2006-03-28 Thread ihope
On 3/27/06, lee marks [EMAIL PROTECTED] wrote: So this is legal: type Fix s a = s a (Fix s a) fold :: Functor (s a) = (s a b - b) - Fix s a - b fold f = f . fmap (fold f) but this is not: fold f = f . fmap (fold f) data Fix s a = Fix {runFix :: s a (Fix s a)} fold :: Functor (s

[Haskell-cafe] Re: Equirecursive types?

2006-03-27 Thread lee marks
John Hughes wrote: ... Indeed, error messages in common cases would be worsened significantly, because as Ross says, common errors (such as forgetting a parameter in a recursive call) would lead to legal definitions that cause a type error when applied. Partly for this reason, OCaml