| Safe Haskell | None |
|---|---|
| Language | Haskell2010 |
Web.Twitter.Conduit.Lens
Synopsis
- data Response responseType
- responseStatus :: forall responseType. Lens' (Response responseType) Status
- responseBody :: forall a b. Lens (Response a) (Response b) a b
- responseHeaders :: forall responseType. Lens' (Response responseType) ResponseHeaders
- data TwitterErrorMessage
- twitterErrorMessage :: Lens' TwitterErrorMessage Text
- twitterErrorCode :: Lens' TwitterErrorMessage Int
- data WithCursor cursorKey wrapped
- previousCursor :: forall cursorKey wrapped. Lens' (WithCursor cursorKey wrapped) Integer
- nextCursor :: forall cursorKey wrapped. Lens' (WithCursor cursorKey wrapped) Integer
- contents :: forall cursorKey a b. Lens (WithCursor cursorKey a) (WithCursor cursorKey b) [a] [b]
- data TwitterError
- class CursorKey a where
- data IdsCursorKey
- data UsersCursorKey
- data ListsCursorKey
Response
data Response responseType Source #
Instances
| Functor Response Source # | |
| Foldable Response Source # | |
Defined in Web.Twitter.Conduit.Response Methods fold :: Monoid m => Response m -> m Source # foldMap :: Monoid m => (a -> m) -> Response a -> m Source # foldr :: (a -> b -> b) -> b -> Response a -> b Source # foldr' :: (a -> b -> b) -> b -> Response a -> b Source # foldl :: (b -> a -> b) -> b -> Response a -> b Source # foldl' :: (b -> a -> b) -> b -> Response a -> b Source # foldr1 :: (a -> a -> a) -> Response a -> a Source # foldl1 :: (a -> a -> a) -> Response a -> a Source # toList :: Response a -> [a] Source # null :: Response a -> Bool Source # length :: Response a -> Int Source # elem :: Eq a => a -> Response a -> Bool Source # maximum :: Ord a => Response a -> a Source # minimum :: Ord a => Response a -> a Source # | |
| Traversable Response Source # | |
Defined in Web.Twitter.Conduit.Response | |
| Eq responseType => Eq (Response responseType) Source # | |
| Show responseType => Show (Response responseType) Source # | |
responseHeaders :: forall responseType. Lens' (Response responseType) ResponseHeaders Source #
TwitterErrorMessage
data TwitterErrorMessage Source #
Twitter Error Messages
see detail: https://dev.twitter.com/docs/error-codes-responses
Instances
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 res1234567890>>>contents res[1111111111]
>>>let Just res = decode "{\"previous_cursor\": 0, \"next_cursor\": 0, \"users\": [1000]}" :: Maybe (WithCursor UsersCursorKey UserId)>>>nextCursor res0>>>contents res[1000]
Instances
| Show wrapped => Show (WithCursor cursorKey wrapped) Source # | |
Defined in Web.Twitter.Conduit.Cursor | |
| (FromJSON wrapped, CursorKey c) => FromJSON (WithCursor c wrapped) Source # | |
Defined in Web.Twitter.Conduit.Cursor Methods parseJSON :: Value -> Parser (WithCursor c wrapped) Source # parseJSONList :: Value -> Parser [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 TwitterError Source #
Constructors
| FromJSONError String | |
| TwitterErrorResponse Status ResponseHeaders [TwitterErrorMessage] | |
| TwitterUnknownErrorResponse Status ResponseHeaders Value | |
| TwitterStatusError Status ResponseHeaders Value |
Instances
| Eq TwitterError Source # | |
Defined in Web.Twitter.Conduit.Response Methods (==) :: TwitterError -> TwitterError -> Bool Source # (/=) :: TwitterError -> TwitterError -> Bool Source # | |
| Show TwitterError Source # | |
Defined in Web.Twitter.Conduit.Response | |
| Exception TwitterError Source # | |
Defined in Web.Twitter.Conduit.Response Methods toException :: TwitterError -> SomeException Source # fromException :: SomeException -> Maybe TwitterError Source # | |
class CursorKey a where Source #
Instances
| CursorKey ListsCursorKey Source # | |
Defined in Web.Twitter.Conduit.Cursor Methods cursorKey :: ListsCursorKey -> Text Source # | |
| CursorKey UsersCursorKey Source # | |
Defined in Web.Twitter.Conduit.Cursor Methods cursorKey :: UsersCursorKey -> Text Source # | |
| CursorKey IdsCursorKey Source # | |
Defined in Web.Twitter.Conduit.Cursor Methods cursorKey :: IdsCursorKey -> Text Source # | |
data IdsCursorKey Source #
Phantom type to specify the key which point out the content in the response.
Instances
| CursorKey IdsCursorKey Source # | |
Defined in Web.Twitter.Conduit.Cursor Methods cursorKey :: IdsCursorKey -> Text Source # | |
data UsersCursorKey Source #
Phantom type to specify the key which point out the content in the response.
Instances
| CursorKey UsersCursorKey Source # | |
Defined in Web.Twitter.Conduit.Cursor Methods cursorKey :: UsersCursorKey -> Text Source # | |
data ListsCursorKey Source #
Phantom type to specify the key which point out the content in the response.
Instances
| CursorKey ListsCursorKey Source # | |
Defined in Web.Twitter.Conduit.Cursor Methods cursorKey :: ListsCursorKey -> Text Source # | |