twitter-conduit-0.0.5.7: Twitter API package with conduit interface and Streaming API support.

Safe HaskellNone

Web.Twitter.Conduit.Parameters.Internal

Synopsis

Documentation

class Parameters a whereSource

Instances

Parameters (APIRequest apiName responseType) 

readShow :: (Read a, Show a) => Prism' ByteString aSource

This Prism convert from a ByteString to some value based on Read and Show

>>> readShow # 2
"2"
>>> "1024" ^? readShow :: Maybe Integer
Just 1024

booleanQuery :: Prism' ByteString BoolSource

This Prism convert from a ByteString to Bool value.

>>> booleanQuery # True
"true"
>>> booleanQuery # False
"false"
>>> "true" ^? booleanQuery
Just True
>>> "1" ^? booleanQuery
Just True
>>> "t" ^? booleanQuery
Just True
>>> "test" ^? booleanQuery
Just False

integerArrayQuery :: Prism' ByteString [Integer]Source

This Prism convert from a ByteString to the array of Integer value.

This is not a valid Prism, for example:

 1, 2 ^? integerArrayQuery == Just [1,2]
 integerArrayQuery # [1,2] != 1, 2
>>> integerArrayQuery # [1]
"1"
>>> integerArrayQuery # [1,2234,3]
"1,2234,3"
>>> "1,2234,3" ^? integerArrayQuery
Just [1,2234,3]
>>> "" ^? integerArrayQuery
Just []
>>> "hoge,2" ^? integerArrayQuery
Nothing