Skip to content

Instantly share code, notes, and snippets.

@bennofs
Created August 14, 2014 15:43
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save bennofs/d77a2e96bd1a4ee66bdb to your computer and use it in GitHub Desktop.
Save bennofs/d77a2e96bd1a4ee66bdb to your computer and use it in GitHub Desktop.
import Control.Exception
import Control.Monad
import Control.DeepSeq
main = forM_ (permute "laeioslaeioslaeios") putStrLn
leet :: Char -> String
leet 'e' = "e3"
leet 'a' = "a4"
leet 'A' = "A4"
leet 'o' = "o0"
leet 's' = "s5"
leet 'S' = "S5"
leet 'i' = "i1"
leet 'I' = "I1"
leet 'l' = "l1"
leet 'B' = "B8"
leet x = [x]
permute :: String -> [String]
permute [] = return []
permute (c:cs) = [ c':cs' | cs' <- permute cs, c' <- leet c ]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment