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

Safe Haskell | None
Language | Haskell2010

Web.Twitter.Conduit.Cursor

Synopsis

- class CursorKey a where
- data IdsCursorKey
- data UsersCursorKey
- data ListsCursorKey
- data WithCursor cursorKey wrapped = WithCursor {
  - previousCursor :: Integer
  - nextCursor :: Integer
  - contents :: [wrapped]
  }

# Documentation

class CursorKey a where Source #

Minimal complete definition

cursorKey

Methods

cursorKey :: a -> Text Source #

Instances

CursorKey ListsCursorKey Source # |
Methods cursorKey :: ListsCursorKey -> Text Source #
CursorKey UsersCursorKey Source # |
Methods cursorKey :: UsersCursorKey -> Text Source #
CursorKey IdsCursorKey Source # |
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 # |
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 # |
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 # |
Methods cursorKey :: ListsCursorKey -> Text Source #

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]

Constructors

WithCursor |

Fields

- previousCursor :: Integer
- nextCursor :: Integer
- contents :: [wrapped]

Instances

Show wrapped => Show (WithCursor cursorKey wrapped) Source # |
Methods showsPrec :: Int -> WithCursor cursorKey wrapped -> ShowS # show :: WithCursor cursorKey wrapped -> String # showList :: [WithCursor cursorKey wrapped] -> ShowS #
(FromJSON wrapped, CursorKey c) => FromJSON (WithCursor c wrapped) Source # |
Methods parseJSON :: Value -> Parser (WithCursor c wrapped) # parseJSONList :: Value -> Parser [WithCursor c wrapped] #