No longer require largeword < 1.2 to compile on GHC 7.4.1
[rootstock.git] / Util / Foldable.hs
blob4e2bd815b9be0d2324bb14a8a7924bb5333f704c
1 module Util.Foldable where
2 import Data.Foldable (Foldable, foldMap)
3 import Data.Monoid (Sum(Sum, getSum))
5 sumWith :: (Foldable t, Num b) => (a -> b) -> t a -> b
6 sumWith f = getSum . foldMap (Sum . f)