I can has(kell) cheezburger? Edit 13 June:
I have made a new and improved version here.
Original Question
This is a very rudimentary lolcats translator (it only works on the phrase &quot;Can I have a cheeseburger&quot;) in Haskell. This is my first ever attempt at Haskell (or any functional programming language). I am sure that my code is absolutely atrocious (the documentation was dismal) but it works.
Teh Codez
import Data.Strings
main = do
    putStrLn &quot;Enter your text to translate&quot;
    inputText &lt;- getLine
    let capsText = strToUpper inputText
    let a = strReplace &quot;HAVE&quot; &quot;HAS&quot; capsText
    let b = strReplace &quot;CAN I&quot; &quot;I CAN&quot; a
    let c = strReplace &quot;CHEESEBURGER&quot; &quot;CHEEZBURGER&quot; b
    let d = strReplace &quot; A &quot; &quot; &quot; c
    putStrLn (d)
    getLine
It is good practice in Haskell to separate the functional code from the IO. In this case, you could (and therefore should) define a lolcat :: String -&gt; String function.  Be sure to put a type declaration on all functions — you didn't write one for your main.

Defining variables a, b, c, and d is overkill. I would write this as a composition of functions.

lolcat :: String -&gt; String
lolcat = strReplace " A " " " .
         strReplace "CHEESEBURGER" "CHEEZBURGER" .
         strReplace "CAN I" "I CAN" .
         strReplace "HAVE" "HAS" .
         strToUpper