git.iko.soy/typeable/http-api-data
on master help sign in
Add annotations to emphasize lower casing and case insensitivity
commitafcb5078e122f10834f1d7fb33ac647d4b73c6b8 authorNickolay Kudasov <nickolay.kudasov@gmail.com> dateSun 11 Oct 2015, 00:10 (11 years ago) parent46b2df7
1 file changed+15−5
Web/HttpApiData/Internal.hs+15−5
Web/HttpApiData/Internal.hs+15−5
@@ -104,7 +104,9 @@ parseMaybeTextData parse input =
104104 Just val -> Right val
105105
106106#if USE_TEXT_SHOW
107−-- | Convert to URL piece using @'TextShow'@ instance.
107+-- | /Lower case/.
108+--
109+-- Convert to URL piece using @'TextShow'@ instance.
108110-- The result is always lower cased.
109111--
110112-- >>> showTextData True
@@ -124,7 +126,9 @@ parseMaybeTextData parse input =
124126showTextData :: TextShow a => a -> Text
125127showTextData = T.toLower . showt
126128#else
127−-- | Convert to URL piece using @'Show'@ instance.
129+-- | /Lower case/.
130+--
131+-- Convert to URL piece using @'Show'@ instance.
128132-- The result is always lower cased.
129133--
130134-- >>> showTextData True
@@ -144,7 +148,9 @@ showt :: Show a => a -> Text
144148showt = T.pack . show
145149#endif
146150
147−-- | Parse given text case insensitive and return the rest of the input.
151+-- | /Case insensitive/.
152+--
153+-- Parse given text case insensitive and return the rest of the input.
148154--
149155-- >>> parseUrlPieceWithPrefix "Just " "just 10" :: Either Text Int
150156-- Right 10
@@ -165,7 +171,9 @@ parseUrlPieceWithPrefix pattern input
165171 (prefix, rest) = T.splitAt (T.length pattern) input
166172
167173#if USE_TEXT_SHOW
168−-- | Parse values case insensitively based on @'TextShow'@ instance.
174+-- | /Case insensitive/.
175+--
176+-- Parse values case insensitively based on @'TextShow'@ instance.
169177--
170178-- >>> parseBoundedTextData "true" :: Either Text Bool
171179-- Right True
@@ -185,7 +193,9 @@ parseUrlPieceWithPrefix pattern input
185193-- @
186194parseBoundedTextData :: forall a. (TextShow a, Bounded a, Enum a) => Text -> Either Text a
187195#else
188−-- | Parse values case insensitively based on @'Show'@ instance.
196+-- | /Case insensitive/.
197+--
198+-- Parse values case insensitively based on @'Show'@ instance.
189199--
190200-- >>> parseBoundedTextData "true" :: Either Text Bool
191201-- Right True