Skip to content

Commit

Permalink
Lowercase, bros, lowercase.
Browse files Browse the repository at this point in the history
  • Loading branch information
itkovian committed Jul 5, 2013
1 parent deb4bf4 commit 540af71
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/NumberSix/Handlers/AlfaPapaTango.hs
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ module NumberSix.Handlers.AlfaPapaTango
) where

import qualified Data.ByteString.Char8 as BC
import qualified Data.Char as DC (toLower)
import qualified Data.Map as M

import NumberSix.Bang
Expand Down Expand Up @@ -51,6 +52,6 @@ letterMap = M.fromList $ zip ['a'..'z'] $ map BC.pack
]

translate :: BC.ByteString -> BC.ByteString
translate letters = BC.tail $ BC.concatMap (\c -> case M.lookup c letterMap of
translate letters = BC.tail $ BC.concatMap (\c -> case M.lookup (DC.toLower c) letterMap of
Just s -> s
Nothing -> BC.pack [' ',c]) letters

0 comments on commit 540af71

Please sign in to comment.