Skip to content

Instantly share code, notes, and snippets.

@bucketsize
Created February 14, 2019 18:46
Show Gist options
  • Save bucketsize/beead12c4428825ea8ddd568d895184d to your computer and use it in GitHub Desktop.
Save bucketsize/beead12c4428825ea8ddd568d895184d to your computer and use it in GitHub Desktop.
fbuddy created by bucketsize - https://repl.it/@bucketsize/fbuddy
import Data.Char
fact :: Int -> Int
fact 0 = 1
fact n = n*fact (n-1)
caps :: IO ()
caps = do
contents <- getContents
putStr (map toUpper contents)
shortLinesOnly :: String -> String
shortLinesOnly input =
let allLines = lines input
shortLines = filter (\line -> length line < 10) allLines
result = unlines shortLines
in result
shLnOnly :: String -> String
shLnOnly = unlines . filter (\l -> length l < 10) . lines
sLns :: String -> String
sLns = unlines . filter ((<10) . length) . lines
main = do
print("hllo")
print(fact 4)
interact sLns
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment