@@ -12,9 +12,9 @@ import Data.Char (toLower)
1212import qualified Data.CharSet as Set
1313import qualified Data.CharSet.Unicode.Category as Set
1414import Data.List
15−import Data.List.Split
1615import Data.Monoid
1716import Data.Proxy
17+import qualified Data.Text as T
1818import GHC.TypeLits
1919import Servant.API
2020
@@ -77,8 +77,10 @@ instance Show HeaderArg where
7777 pv = toValidFunctionName ("header" <> n)
7878 pn = "{" <> n <> "}"
7979 rp = replace pn "" p
80− -- Nicked from Data.String.Utils, works on lists
81− replace old new l = intercalate new . splitOn old $ l
80+ -- Use replace method from Data.Text
81+ replace old new = T.unpack .
82+ T.replace (T.pack old) (T.pack new) .
83+ T.pack
8284
8385-- | Attempts to reduce the function name provided to that allowed by JS.
8486-- https://mathiasbynens.be/notes/javascript-identifiers