From 11a5fd38018498a7b7feb0e392ac36003b0440ac Mon Sep 17 00:00:00 2001 From: Joe Zhao Date: Mon, 16 Mar 2015 23:10:05 +0800 Subject: +12 +13 +14 +15 --- h14.hs | 10 ++++++++++ 1 file changed, 10 insertions(+) create mode 100644 h14.hs (limited to 'h14.hs') diff --git a/h14.hs b/h14.hs new file mode 100644 index 0000000..e7ad73d --- /dev/null +++ b/h14.hs @@ -0,0 +1,10 @@ +import Control.Applicative + +dupli :: [a] -> [a] +dupli = concatMap (replicate 2) + +dupli' xs = concat [ [x,x] | x <- xs ] + +dupli'' = (<**> [id,id]) + +dupli''' = foldr ((.) <$> (:) <*> (:)) [] -- cgit v1.2.3-70-g09d2