From: Ramakrishnan Muthukrishnan Date: Wed, 24 Dec 2014 14:23:41 +0000 (+0530) Subject: write prod in a more compositional style. X-Git-Url: https://git.rkrishnan.org/?a=commitdiff_plain;h=fb0bcf79e2ef591bb4165a1bfeeae7a41b4b559a;p=yorgey.git write prod in a more compositional style. --- diff --git a/misc/monoids.hs b/misc/monoids.hs index f15c89f..dd82cad 100644 --- 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