projects
/
yorgey.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
981151b
)
write prod in a more compositional style.
author
Ramakrishnan Muthukrishnan
<ram@rkrishnan.org>
Wed, 24 Dec 2014 14:23:41 +0000
(19:53 +0530)
committer
Ramakrishnan Muthukrishnan
<ram@rkrishnan.org>
Wed, 24 Dec 2014 14:23:47 +0000
(19:53 +0530)
misc/monoids.hs
patch
|
blob
|
history
diff --git
a/misc/monoids.hs
b/misc/monoids.hs
index f15c89fad2ed419f848e16937ec99aa338774181..dd82cadd036d5dd4754230c8e05197690f906af3 100644
(file)
--- a/
misc/monoids.hs
+++ b/
misc/monoids.hs
@@
-6,7
+6,7
@@
import Data.Monoid
data Tree a = Empty
| Node (Tree a) a (Tree a)
deriving (Eq, Show)
-
+
leaf :: a -> Tree a
leaf x = Node Empty x Empty
@@
-72,4
+72,4
@@
lst :: [Integer]
lst = [1,5,8,23,423,99]
prod :: Integer
-prod = getProd
$ mconcat $ map Prod'
lst
+prod = getProd
. mconcat . map Prod' $
lst