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

Safe Haskell | None
Language | Haskell2010

Web.Twitter.Conduit.Cursor

Synopsis

- class CursorKey a where
  - cursorKey :: a -> Text
- data IdsCursorKey
- data UsersCursorKey
- data ListsCursorKey
- data EventsCursorKey
- data WithCursor cursorType cursorKey wrapped = WithCursor {
  - previousCursor :: Maybe cursorType
  - nextCursor :: Maybe cursorType
  - contents :: [wrapped]
  }

# Documentation

class CursorKey a where Source #

Methods

cursorKey :: a -> Text Source #

#### Instances

Instances details

CursorKey EventsCursorKey Source # |
Instance details Defined in Web.Twitter.Conduit.Cursor Methods cursorKey :: EventsCursorKey -> Text Source #
CursorKey ListsCursorKey Source # |
Instance details Defined in Web.Twitter.Conduit.Cursor Methods cursorKey :: ListsCursorKey -> Text Source #
CursorKey UsersCursorKey Source # |
Instance details Defined in Web.Twitter.Conduit.Cursor Methods cursorKey :: UsersCursorKey -> Text Source #
CursorKey IdsCursorKey Source # |
Instance details 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

Instances details

CursorKey IdsCursorKey Source # |
Instance details 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

Instances details

CursorKey UsersCursorKey Source # |
Instance details 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

Instances details

CursorKey ListsCursorKey Source # |
Instance details Defined in Web.Twitter.Conduit.Cursor Methods cursorKey :: ListsCursorKey -> Text Source #

data EventsCursorKey Source #

#### Instances

Instances details

CursorKey EventsCursorKey Source # |
Instance details Defined in Web.Twitter.Conduit.Cursor Methods cursorKey :: EventsCursorKey -> Text Source #

data WithCursor cursorType 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 Integer IdsCursorKey UserId)
    >>> nextCursor res
    Just 1234567890
    >>> contents res
    [1111111111]

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

    >>> let Just res = decode "{\"next_cursor\": \"hogehoge\", \"events\": [1000]}" :: Maybe (WithCursor Text EventsCursorKey UserId)
    >>> nextCursor res
    Just "hogehoge"
    >>> contents res
    [1000]

Constructors

WithCursor |

Fields

- previousCursor :: Maybe cursorType
- nextCursor :: Maybe cursorType
- contents :: [wrapped]

#### Instances

Instances details

(Show cursorType, Show wrapped) => Show (WithCursor cursorType cursorKey wrapped) Source # |
Instance details Defined in Web.Twitter.Conduit.Cursor Methods showsPrec :: Int -> WithCursor cursorType cursorKey wrapped -> ShowS show :: WithCursor cursorType cursorKey wrapped -> String showList :: [WithCursor cursorType cursorKey wrapped] -> ShowS
(FromJSON wrapped, FromJSON ct, CursorKey c) => FromJSON (WithCursor ct c wrapped) Source # |
Instance details Defined in Web.Twitter.Conduit.Cursor Methods parseJSON :: Value -> Parser (WithCursor ct c wrapped) Source # parseJSONList :: Value -> Parser [WithCursor ct c wrapped] Source #