RE: kind inference question

2001-02-12 Thread Mark P Jones
Hi Bernie, You ask why Haskell infers kinds for datatypes in dependency order. As you point out, if Haskell tried instead to infer kinds for all of the datatypes in a program at the same time, then it would sometimes accept programs that are currently rejected. For example: |data C x = Foo

kind inference question

2001-02-06 Thread Bernard James POPE
Hi all, I'm in the middle of writing kind inference for haskell, as part of a type checker/inferer. After reading the section in the haskell report about kind inference (section 4.6), I began to wonder why kind inference must be done in dependency order. Some friends and I came up with the foll

Re: inference question

2000-09-01 Thread Fergus Henderson
On 31-Aug-2000, William Lee Irwin III <[EMAIL PROTECTED]> wrote: > {hugs} Example> :type cmethod . fromNat $ 1 > {hugs} cmethod . fromNat $ 1 :: (C a, Q a) => a > > This is the expected typing, which I expect to be valid. > > But the inferencer chokes on an actual binding like the following: > x

Re: inference question

2000-08-31 Thread Brian Boutel
William Lee Irwin III wrote: Example> let x = cmethod . fromNat $ 1 in 0 ERROR: Unresolved overloading *** Type : (Q a, P a) => Integer *** Expression : let {...} in 0 The type of x is t ( for some t in Num) OK. What is t? It's unspecified. You don't actually need it. Too bad. Type infe

inference question

2000-08-31 Thread William Lee Irwin III
> module Example where I'm in a small quandary regarding some properties of instances I don't fully understand. What we have are three interrelated classes: > class P t where > pmethod :: t -> t > class Q t where > qmethod :: t -> t > fromNat :: Integer -> t > class C t where >