From afae39a832fbdf0f5bf67e20cac7bdf224b0a290 Mon Sep 17 00:00:00 2001 From: Determinant Date: Sun, 28 May 2017 18:19:31 -0400 Subject: init --- 1-10/9.hs | 5 +++++ 1 file changed, 5 insertions(+) create mode 100644 1-10/9.hs (limited to '1-10/9.hs') diff --git a/1-10/9.hs b/1-10/9.hs new file mode 100644 index 0000000..e9630f4 --- /dev/null +++ b/1-10/9.hs @@ -0,0 +1,5 @@ +pack :: Eq a => [a] -> [[a]] + +pack [] = [] +pack [x] = [[x]] +pack (x:xs) = if x == head y then (x:y):ys else [x]:(y:ys) where (y:ys) = pack xs -- cgit v1.2.3