Re: [Haskell-cafe] Type inference problem with division (/)

2007-10-31 Thread Tim Chevalier
On 10/30/07, Felipe Lessa [EMAIL PROTECTED] wrote: On 10/30/07, Tim Chevalier [EMAIL PROTECTED] wrote: ppos = pi/len2; pi and len2 are both Ints, so dividing them gives you an Int. To convert to a Double, write ppos = fromIntegral (pi/len2). (Type :t fromIntegral in ghci to see what else

Re: [Haskell-cafe] Type inference problem with division (/)

2007-10-31 Thread Henning Thielemann
On Tue, 30 Oct 2007, noa wrote: I have the following function: theRemainder :: [String] - [String] - Double theRemainder xs xt = sum( map additional (unique xs) ) where additional x = poccur * (inf [ppos,pneg]) --inf takes [Double] where xsxt = zip

Re: [Haskell-cafe] Type inference problem with division (/)

2007-10-30 Thread Tim Chevalier
On 10/30/07, noa [EMAIL PROTECTED] wrote: Hi! I have the following function: theRemainder :: [String] - [String] - Double theRemainder xs xt = sum( map additional (unique xs) ) where additional x = poccur * (inf [ppos,pneg]) --inf takes [Double] where

Re: [Haskell-cafe] Type inference problem with division (/)

2007-10-30 Thread Felipe Lessa
On 10/30/07, Tim Chevalier [EMAIL PROTECTED] wrote: ppos = pi/len2; pi and len2 are both Ints, so dividing them gives you an Int. To convert to a Double, write ppos = fromIntegral (pi/len2). (Type :t fromIntegral in ghci to see what else fromIntegral can be used for.) You mean pi /

[Haskell-cafe] Type inference problem with division (/)

2007-10-30 Thread noa
Hi! I have the following function: theRemainder :: [String] - [String] - Double theRemainder xs xt = sum( map additional (unique xs) ) where additional x = poccur * (inf [ppos,pneg]) --inf takes [Double] where xsxt = zip xs xt pi =

Re: [Haskell-cafe] Type inference problem with division (/)

2007-10-30 Thread Shachaf Ben-Kiki
On 10/30/07, Tim Chevalier [EMAIL PROTECTED] wrote: On 10/30/07, noa [EMAIL PROTECTED] wrote: Hi! I have the following function: theRemainder :: [String] - [String] - Double theRemainder xs xt = sum( map additional (unique xs) ) where additional x = poccur * (inf