on master help sign in
Switched again to Text because it made more sense given the dependency structure
8aa5ce5Geoffrey Roberts
servant-jquery.cabal+1−1
@@ -35,7 +35,7 @@ library
35 , charset
35 , charset
36 , lens >= 4
36 , lens >= 4
37 , servant >= 0.2.1
37 , servant >= 0.2.1
38− , split
38+ , text
39 hs-source-dirs: src
39 hs-source-dirs: src
40 default-language: Haskell2010
40 default-language: Haskell2010
41 ghc-options: -Wall
41 ghc-options: -Wall
src/Servant/JQuery/Internal.hs+5−3
@@ -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
20
20
@@ -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+ T.pack
82
84
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