all tasks

This commit is contained in:
Ingy döt Net 2013-04-11 01:07:29 -07:00
parent b83f433714
commit 68f8f3e56b
14735 changed files with 178959 additions and 0 deletions

View file

@ -0,0 +1,18 @@
-- We define the functions to return an empty string if the argument is too
-- short for the particular operation.
remFirst, remLast, remBoth :: String -> String
remFirst "" = ""
remFirst cs = tail cs
remLast "" = ""
remLast cs = init cs
remBoth (c:cs) = remLast cs
remBoth _ = ""
main :: IO ()
main = do
let s = "Some string."
mapM_ (\f -> putStrLn . f $ s) [remFirst, remLast, remBoth]