Skip to content

Instantly share code, notes, and snippets.

@afternoon
Created February 26, 2014 23:21
Show Gist options
  • Save afternoon/9240927 to your computer and use it in GitHub Desktop.
Save afternoon/9240927 to your computer and use it in GitHub Desktop.
Task 1 from West London Hack Night Feb 26 2014
import List
import String (toList, words, lines, length)
text = """Four loko cred dreamcatcher, blog cliche umami Cosby sweater before
they sold out bitters drinking vinegar. Keytar four loko occupy, gastropub
keffiyeh Pitchfork paleo. Small batch ennui irony pop-up narwhal tousled
sustainable meh Thundercats gastropub, bicycle rights Echo Park sartorial.
Next level hoodie seitan, scenester Portland 3 wolf moon Neutra master
cleanse art party. Pour-over yr distillery, McSweeney's chambray pickled
brunch salvia. Dreamcatcher Bushwick polaroid viral asymmetrical chia. Ennui
forage skateboard Shoreditch, umami master cleanse Thundercats 90's
scenester Cosby sweater keytar YOLO."""
charCount = length
wordCount s = List.length (words s)
lineCount s = List.length (lines s)
main = plainText
("chars: " ++ (show (charCount text)) ++ "\n" ++
"words: " ++ (show (wordCount text)) ++ "\n" ++
"lines: " ++ (show (lineCount text)))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment