Re: Dividing Floats

2001-05-31 Thread Daniel Russell
> Can anyone please help me. > How can you divide two floats? (and return a float, even if they divide > equally) > Ie (something like...) div 2.4 1.2 ---> 2.0 The above doesn't work since div can only be applied to integral numbers: div :: Integral a => a -> a -> a What you n

Re: import List(..) ?

2000-05-21 Thread Daniel Russell
> > Sun, 21 May 2000 17:26:13 +1000, Fergus Henderson <[EMAIL PROTECTED]> pisze: > On a related note, Hugs and ghc both allow the following module > > module Bar(List(..)) where > type List = [] > > without complaint, but according to the Haskell report (5.2) the > syntax `(..)' should only be u

Re: instance overlapping

1999-07-18 Thread Daniel Russell
>Hi, >If I have the folowwing declaration: >class Soup where >... > >instance Soup String where >... > >instance Soup t => Soup [t] where >... > >This will lead to an error: "instance overlapping". > >Is there anyway to solve this? Yes -- if you are using Hugs98 then you need to use the comman

Re: Bulk types in Context

1999-05-01 Thread Daniel Russell
Kevin Atkinson wrote: >Could someone tell me why this is not allowed and if there is a possible >workaround. (I know this example seems pointless however it is a real >concern as having bulk types in the context is something I would really >like to do.) Here's the not allowed bit: >class Listab

Re: Still confused

1999-03-14 Thread Daniel Russell
>>Steve Frampton <[EMAIL PROTECTED]> wrote: >>> foo x = ['1'] ++ foo(x div 10) >>> *** term : foo >>> *** type : ((a -> a -> a) -> b -> Int) -> [Char] >>> *** does not match : Int -> [Char] >Can someone please explain how to decipher the type line in this error >messa

Re: Standard Haskell and Monad Comprehensions

1997-09-02 Thread Daniel Russell
On Tue, 2 Sep 1997, Martin Nor{ick wrote, > Regarding comprehensions: hugs gives me an error for: > [a | a <- [10], b <- getLine ] > and says that getLine must be of type [a], but why? b is not used! Since [10] is a list, this comprehension is used to generate a list, and therefore b must take i