> This occurs because in the absense of type declarations, > Haskell assumes that any recursion will be monomorphic, > which is in general not necessarily the case. As I'm sure you know, type inference is in general impossible for polymorphic recursion, and since Haskell insists on decidable type checking this was an easy solution. Besides, Haskell had polymorphic recursion even before the rule about a type signature making it possible to make functions polymorphically recursive. It was just more tedious to write it before. > Interestingly, the Mercury typechecker behaves differently > for the equivalent example: it infers the more general type. Are you sure Mercury doesn't suffer from the same problem if you just complicate the example? -- Lennart
- Re: Haskell 2 -- Dependent types? Keith Wansbrough
- Re: Haskell 2 -- Dependent types? Carl R. Witty
- Re: Haskell 2 -- Dependent types? Carl R. Witty
- Re: Haskell 2 -- Dependent types? Carl R. Witty
- Re: Haskell 2 -- Dependent types? Fergus Henderson
- Re: Haskell 2 -- Dependent types? Lennart Augustsson
- Re: Haskell 2 -- Dependent types? Carl R. Witty
- RE: Haskell 2 -- Dependent types? Nick Kallen
- Re: Haskell 2 -- Dependent types? Lennart Augustsson
- Re: Haskell 2 -- Dependent types? Fergus Henderson
- Re: Haskell 2 -- Dependent types? Lennart Augustsson
- Re: Haskell 2 -- Dependent types? Lennart Augustsson
- Re: Haskell 2 -- Dependent types? Fergus Henderson
- Re: Haskell 2 -- Dependent types? Fergus Henderson
- Re: Haskell 2 -- Dependent types? Lennart Augustsson
- Re: Haskell 2 -- Dependent types? Carl R. Witty
- Re: Haskell 2 -- Dependent types? Carl R. Witty
- Re: Haskell 2 -- Dependent types? Fergus Henderson