Last active
August 29, 2015 13:56
-
-
Save shoooe/9093216 to your computer and use it in GitHub Desktop.
A simple program in Haskell written while reading "Programming in Haskell". It prints a diagonal line of +es.
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 characters
makeString :: Char -> Int -> String | |
makeString _ 0 = [] | |
makeString c i = c : (makeString c (i - 1)) | |
putStringsLn :: [String] -> IO () | |
putStringsLn [] = return () | |
putStringsLn (s : ss) = do | |
putStrLn s | |
putStringsLn ss | |
main = do | |
putStringsLn ss | |
where | |
ss = [(makeString ' ' i) ++ "+" | i <- [1..10]] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment