main :: IO ()
main = do
  args <- getArgs

  (from,to) <- case map (readCharSeq . bsUnEsc) args of
    [Just as]          -> return (as, "")
    [Just as, Just bs] -> return (as, bs)
    otherwise          -> argError

  let
    remove   = filter (not . (`elem` from))
    translit = map (applyListMap $ zip from (padLast to))

  case to of
    ""        -> charFilter remove
    otherwise -> charFilter translit

  exitSuccess
main :: IO ()
main = do
  args <- getArgs

  (from,to) <- case map (readCharSeq . bsUnEsc) args of
    [Just as]          -> return (as, "")
    [Just as, Just bs] -> return (as, bs)
    otherwise          -> argError

  let
    remove   = filter (not . (`elem` from))
    translit = map (applyListMap $ zip from (padLast to))

  case to of
    ""        -> charFilter remove
    otherwise -> charFilter translit

  exitSuccess
main = do
  args <- getArgs

  (from,to) <- case map (readCharSeq . bsUnEsc) args of
    [Just as]          -> return (as, "")
    [Just as, Just bs] -> return (as, bs)
    otherwise          -> argError

  let
    remove   = filter (not . (`elem` from))
    translit = map (applyListMap $ zip from (padLast to))

  case to of
    ""        -> charFilter remove
    otherwise -> charFilter translit

  exitSuccess