@@ -12,9 +12,9 @@ import Data.Char (toLower)
12import qualified Data.CharSet as Set
12import qualified Data.CharSet as Set
13import qualified Data.CharSet.Unicode.Category as Set
13import qualified Data.CharSet.Unicode.Category as Set
14import Data.List
14import Data.List
15−import Data.List.Split
16import Data.Monoid
15import Data.Monoid
17import Data.Proxy
16import Data.Proxy
17+import qualified Data.Text as T
18import GHC.TypeLits
18import GHC.TypeLits
19import Servant.API
19import Servant.API
@@ -77,8 +77,10 @@ instance Show HeaderArg where
77 pv = toValidFunctionName ("header" <> n)
77 pv = toValidFunctionName ("header" <> n)
78 pn = "{" <> n <> "}"
78 pn = "{" <> n <> "}"
79 rp = replace pn "" p
79 rp = replace pn "" p
80− -- Nicked from Data.String.Utils, works on lists
80+ -- Use replace method from Data.Text
81− replace old new l = intercalate new . splitOn old $ l
81+ replace old new = T.unpack .
82+ T.replace (T.pack old) (T.pack new) .
83-- | Attempts to reduce the function name provided to that allowed by JS.
85-- | Attempts to reduce the function name provided to that allowed by JS.
84-- https://mathiasbynens.be/notes/javascript-identifiers
86-- https://mathiasbynens.be/notes/javascript-identifiers