summaryrefslogtreecommitdiff
path: root/p11.hs
diff options
context:
space:
mode:
authorJoe Zhao <ztuowen@gmail.com>2015-03-17 11:05:29 +0800
committerJoe Zhao <ztuowen@gmail.com>2015-03-17 11:05:29 +0800
commita9ee47b61558efe09aee23f5671aabd0c3747e8a (patch)
tree52426053545a54514d39300e2117bdda14a9b1ef /p11.hs
parent11a5fd38018498a7b7feb0e392ac36003b0440ac (diff)
downloadh99-a9ee47b61558efe09aee23f5671aabd0c3747e8a.tar.gz
h99-a9ee47b61558efe09aee23f5671aabd0c3747e8a.tar.bz2
h99-a9ee47b61558efe09aee23f5671aabd0c3747e8a.zip
p -> h
Diffstat (limited to 'p11.hs')
-rw-r--r--p11.hs15
1 files changed, 0 insertions, 15 deletions
diff --git a/p11.hs b/p11.hs
deleted file mode 100644
index 77b7295..0000000
--- a/p11.hs
+++ /dev/null
@@ -1,15 +0,0 @@
-import Control.Arrow
-import Data.List
-
-data ListItem a = Single a | Multiple a Int
- deriving (Show)
-
-encode :: Eq a => [a] -> [(a,Int)]
-encode xs = map (head &&& length) $ group xs
-
-encodeModified :: Eq a => [a] -> [ListItem a]
-encodeModified = map helper . encode
- where
- helper (a,1) = Single a
- helper (a,c) = Multiple a c
-