Hiya everyone!

I figured out what was causing my problem from before: I'm not
sure whether this is still reckoned as a bug or not, but I
believe GHC is dying trying to infer the function (<=) on the
Cost datatype defined below...

Does that make sense?

[cut here]

-- Cost can be either infinite, or an integer

data Cost = Val Integer | Infinity deriving Show

-- Type class instances for required numerical operations on Cost types

instance Eq Cost where
  Val x == Val y = x==y
  Val _ == Infinity = False
  Infinity == Val _ = False
  Infinity == Infinity = True

instance Ord Cost where
  Val x < Val y = x<y
  Infinity < Val _ = False
  Val _ < Infinity = True
  Infinity < Infinity = False

[cut here]

Cheers,

Nick.

-- 

[ Nick Williams                                                          ]
[ MSc Computation                                  Mobile - 07957-138179 ]
[ New College, Oxford                     http://www.new.ox.ac.uk/~nick/ ]
[ [EMAIL PROTECTED]                Finger for PGP public key ]


Reply via email to