The reason that 2.02+ complain where earlier versions don't is that I must
have implemented polymorphic recursion in 2.02.  Under polymorphic recursion
it is indeed ambiguous at what type to call "g" in the recursive call.

We have yet to see whether this bites in real programs rather than
mega-terse ones.

Simon

| From: Alex Ferguson <[EMAIL PROTECTED]>
| Date: Mon, 23 Jun 1997 19:55:14 +0100 (BST)
| 
| SPJ, quoting Marc:
| > | Could somebody tell me how to disambiguate the following program
| > | 
| > | > module Tmp( g ) where
| > | > data A p q = A
| > | > g :: (Num p,Ord q) => (A p q) -> Bool
| > | > g A = g A
| > 
| > I don't understand this.  "g" always returns bottom.
| 
| If only!  The above example looks pathological mainly because Marc was
| in Mega-terse mode when producing a canonical example of this bug/feature,
| I think; one could expand it back to a more meaningful program, with
| the same disambiguation problem.
| 
| The trouble here is that compiling this, under 2.02, gives:
| 
| tmp.lhs:1: tmp.lhs:4: Ambiguous overloading:
|                at a use of an overloaded identifier: `g' PrelBase.Ord q{-av0-}
|     When checking signature(s) for: Tmp.g
| 
| 
| 2.01 (and earlier) thinks it's OK.  I'm not sure which of these is
| correct behaviour (or if some tweak in the standard means both are
| (or were)).
| 
| Alex.

Reply via email to