Source

phone2word / phone2word.hs

Diff from to

phone2word.hs

 import qualified Data.Map as Map
 
 --
--- Definitions
+-- Definition of digits <-> letters
 --
 
 letters = [ ('0', "")
           , ('9', "WXYZ")
           ]
 
---
--- General utilities
---
-
-lettersMap :: Map.Map Char [Char]
-lettersMap = Map.fromList letters
-
 numbersMap :: Map.Map Char Char
 numbersMap = Map.fromList [ (l,c)  | (c,word) <- letters, l <- word]
 
-getLetters :: Char -> [Char]
-getLetters digit = fromJust $ Map.lookup digit lettersMap
-
 getNumber :: Char -> Maybe Char
 getNumber char =
     if isDigit char