[Haskell-cafe] generic sum for an UArr

Manlio Perillo manlio_perillo at libero.it
Wed Mar 11 18:55:50 EDT 2009


Daniel Fischer ha scritto:
> [...]
>>    genericSumU :: (UA e, Integral e) => UArr e -> Int
>>    genericSumU = foldU add 0
> 
> That would have to be foldlU, the type of foldU is
> foldU :: UA a => (a -> a -> a) -> a -> UArr a -> a
> 
> while 
> foldlU :: UA a => (b -> a -> b) -> b -> UArr a -> b
> 

Damn...

I was reading the source code of uvector, where
foldU = foldlU

and I totally forgot to check types.


Thanks  Manlio


More information about the Haskell-Cafe mailing list