Another problem with typing RULES

Simon Peyton-Jones simonpj@microsoft.com
Thu, 1 Mar 2001 07:09:14 -0800


Good point.  Now fixed

| -----Original Message-----
| From: Manuel M. T. Chakravarty [mailto:chak@cse.unsw.edu.au]
| Sent: 01 March 2001 13:11
| To: cvs-ghc@haskell.org
| Subject: Another problem with typing RULES
| 
| 
| Given 
| 
|   "fst over sndSnd" forall v. fst (sndSnd v) = fst v
| 
|   sndSnd :: (a, (b, c)) -> (a, c)
|   sndSnd (x, (y, z)) = (x, z)
| 
| the rule gets a type, which is too specialised, namely
| 
|   {-## __R "fst over sndSnd" __forall {@ a1 v :: (a1, ((), 
| ()))} fst @ a1 @ () (sndSnd @ a1 @ () @ () v) = fst @ a1 @ 
| ((), ()) v ;
| 
| I guess, it is the "all unknown types are assigned () after
| type checking" rule, which leads to this instantiation.  But
| here this is clearly not what is wanted.
| 
| Cheers,
| Manuel
| 
| _______________________________________________
| Cvs-ghc mailing list
| Cvs-ghc@haskell.org
| http://www.haskell.org/mailman/listinfo/cvs-ghc
|