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 xs xt
>               pi = countPos xr -- countPos returns an Int
>               ni = (length xr) - pi
>               len = length xs

-> genericLength

>               len2 = length xr
>               ppos = pi/len2 -- THESE ARE THE PROBLEM
>               pneg = ni/len2 -- THESE ARE THE PROBLEM
>               poccur = (pi+ni)/len
>               xr = (filter ((\y -> (fst y)==x)) (xsxt))
_______________________________________________
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe

Reply via email to