Created
March 24, 2020 14:10
-
-
Save crclark96/6a8e90a3e997e5fa3a180f1324ebdb40 to your computer and use it in GitHub Desktop.
Revisions
-
crclark96 created this gist
Mar 24, 2020 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,7 @@ l = ['a','a','b','b','b','c','c'] compress :: [Char] -> [String] compress l = group l >>= (\x -> [take 1 x, show $ length x]) main = do putStrLn . show $ compress l This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,3 @@ /tmp ➜ runhaskell compress.hs ["a","2","b","3","c","2"]