substRules :: [Rule] -> String -> String
substRules rules input =
    T.unpack $ foldl' subst inputT rules
  where
    inputT = T.pack input
    subst text (pattern,replacement) = T.replace (T.pack pattern) (T.pack replacement) text
substRules :: [Rule] -> String -> String
substRules rules input =
    T.unpack $ foldl' subst inputT rules
  where
    inputT = T.pack input
    subst text (pattern,replacement) = T.replace (T.pack pattern) (T.pack replacement) text
substRules rules input =
    T.unpack $ foldl' subst inputT rules
  where
    inputT = T.pack input
    subst text (pattern,replacement) = T.replace (T.pack pattern) (T.pack replacement) text