repo.or.cz
/
rootstock.git
/
blob
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
log
|
graphiclog1
|
graphiclog2
|
commit
|
commitdiff
|
tree
|
refs
|
edit
|
fork
blame
|
history
|
raw
|
HEAD
Split maybeOfferCreate from makeTransactions
[rootstock.git]
/
Util
/
Foldable.hs
blob
4e2bd815b9be0d2324bb14a8a7924bb5333f704c
1
module
Util
.
Foldable
where
2
import
Data
.
Foldable
(
Foldable
,
foldMap
)
3
import
Data
.
Monoid
(
Sum
(
Sum
,
getSum
))
4
5
sumWith
:: (
Foldable t
,
Num b
) => (
a
->
b
) ->
t a
->
b
6
sumWith f
=
getSum
.
foldMap
(
Sum
.
f
)
7