[Haskell-cafe] More newbie typeclass confusion...

2007-12-29 Thread alex
Hi there. If someone can tell me why I am getting type ambiguity in the following code: class (Ord s, Num s) = Scalar s where zero :: s class Metric m where delta :: Scalar s = m - m - s (=~):: m - m - Bool (/~):: m - m - Bool (=~) a b

Re: [Haskell-cafe] More newbie typeclass confusion...

2007-12-29 Thread Jonathan Cast
On 29 Dec 2007, at 9:31 PM, alex wrote: Hi there. If someone can tell me why I am getting type ambiguity in the following code: class (Ord s, Num s) = Scalar s where zero :: s class Metric m where delta :: Scalar s = m - m - s (=~):: m - m - Bool

Re: [Haskell-cafe] More newbie typeclass confusion...

2007-12-29 Thread Luke Palmer
On Dec 30, 2007 3:43 AM, Jonathan Cast [EMAIL PROTECTED] wrote: On 29 Dec 2007, at 9:31 PM, alex wrote: Hi there. If someone can tell me why I am getting type ambiguity in the following code: class (Ord s, Num s) = Scalar s where zero :: s class Metric m where