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

Safe HaskellNone
LanguageHaskell98

Web.Twitter.Conduit.Lens

Contents

Synopsis

Response

data Response responseType Source

Instances

Functor Response Source 
Foldable Response Source 
Traversable Response Source 
Eq responseType => Eq (Response responseType) Source 
Show responseType => Show (Response responseType) Source 

responseStatus :: forall responseType. Lens' (Response responseType) Status Source

responseBody :: forall a b. Lens (Response a) (Response b) a b Source

responseHeaders :: forall responseType. Lens' (Response responseType) ResponseHeaders Source

TwitterErrorMessage

WithCursor

data WithCursor cursorKey wrapped Source

A wrapper for API responses which have "next_cursor" field.

The first type parameter of WithCursor specifies the field name of contents.

>>> let Just res = decode "{\"previous_cursor\": 0, \"next_cursor\": 1234567890, \"ids\": [1111111111]}" :: Maybe (WithCursor IdsCursorKey UserId)
>>> nextCursor res
1234567890
>>> contents res
[1111111111]
>>> let Just res = decode "{\"previous_cursor\": 0, \"next_cursor\": 0, \"users\": [1000]}" :: Maybe (WithCursor UsersCursorKey UserId)
>>> nextCursor res
0
>>> contents res
[1000]

Instances

Show wrapped => Show (WithCursor cursorKey wrapped) Source 
(FromJSON wrapped, CursorKey c) => FromJSON (WithCursor c wrapped) Source 

previousCursor :: forall cursorKey wrapped. Lens' (WithCursor cursorKey wrapped) Integer Source

nextCursor :: forall cursorKey wrapped. Lens' (WithCursor cursorKey wrapped) Integer Source

contents :: forall cursorKey a b. Lens (WithCursor cursorKey a) (WithCursor cursorKey b) [a] [b] Source

Re-exports

data IdsCursorKey Source

Phantom type to specify the key which point out the content in the response.

data UsersCursorKey Source

Phantom type to specify the key which point out the content in the response.

data ListsCursorKey Source

Phantom type to specify the key which point out the content in the response.