git.iko.soy/typeable/servant
on master help sign in
Remove redundant comments
commit984a76f0f877002af2ff765b3e91afe6f9ee0ec9 authorArian van Putten <aeroboy94@gmail.com> dateSun 4 Oct 2015, 23:27 (11 years ago) parent5769822
2 files changed−29
servant-js/src/Servant/JS.hs−2 servant-js/src/Servant/JS/Internal.hs−27
servant-js/src/Servant/JS.hs−2
@@ -145,8 +145,6 @@ writeJSForAPI :: (HasForeign api, GenerateList (Foreign api))
145145 -> JavaScriptGenerator -- ^ js code generator to use (angular, vanilla js, jquery, others)
146146 -> FilePath -- ^ path to the file you want to write the resulting javascript code into
147147 -> IO ()
148−
149−-- TODO Data.Text
150148writeJSForAPI p gen fp = writeFile fp (jsForAPI p gen)
151149
152150-- | Utility class used by 'jsForAPI' which computes
servant-js/src/Servant/JS/Internal.hs−27
@@ -89,9 +89,6 @@ defCommonGeneratorOptions = CommonGeneratorOptions
8989--
9090-- @TODO: specify better default function name, or throw error?
9191toValidFunctionName :: Text -> Text
92−-- @TODO: Cons text
93−--
94−
9592toValidFunctionName t =
9693 case T.uncons t of
9794 Just (x,xs) ->
@@ -101,29 +98,7 @@ toValidFunctionName t =
10198 setFirstChar c = if firstChar c then c else '_'
10299 firstChar c = prefixOK c || any (Set.member c) firstLetterOK
103100 remainder c = prefixOK c || any (Set.member c) remainderOK
104− -- Valid prefixes
105− prefixOK c = c `elem` ['$','_']
106− -- Unicode character sets
107− firstLetterOK = [ Set.lowercaseLetter
108− , Set.uppercaseLetter
109− , Set.titlecaseLetter
110− , Set.modifierLetter
111− , Set.otherLetter
112− , Set.letterNumber ]
113− remainderOK = firstLetterOK
114− <> [ Set.nonSpacingMark
115− , Set.spacingCombiningMark
116− , Set.decimalNumber
117− , Set.connectorPunctuation ]
118−{-
119−toValidFunctionName (x:xs) = [setFirstChar x] <> filter remainder xs
120− where
121− setFirstChar c = if firstChar c then c else '_'
122− firstChar c = prefixOK c || any (Set.member c) firstLetterOK
123− remainder c = prefixOK c || any (Set.member c) remainderOK
124− -- Valid prefixes
125101 prefixOK c = c `elem` ['$','_']
126− -- Unicode character sets
127102 firstLetterOK = [ Set.lowercaseLetter
128103 , Set.uppercaseLetter
129104 , Set.titlecaseLetter
@@ -135,8 +110,6 @@ toValidFunctionName (x:xs) = [setFirstChar x] <> filter remainder xs
135110 , Set.spacingCombiningMark
136111 , Set.decimalNumber
137112 , Set.connectorPunctuation ]
138−toValidFunctionName [] = "_"
139−-}
140113
141114toJSHeader :: HeaderArg -> Text
142115toJSHeader (HeaderArg n) = toValidFunctionName ("header" <> n)