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

Safe Haskell | Safe-Inferred
Language | Haskell2010

Web.Twitter.Conduit.Cursor

Synopsis

- type IdsCursorKey = "ids"
- type UsersCursorKey = "users"
- type ListsCursorKey = "lists"
- type EventsCursorKey = "events"
- data WithCursor cursorType (cursorKey :: Symbol) wrapped = WithCursor {
  - previousCursor :: Maybe cursorType
  - nextCursor :: Maybe cursorType
  - contents :: [wrapped]
  }

# Documentation

type IdsCursorKey = "ids" Source #

type UsersCursorKey = "users" Source #

type ListsCursorKey = "lists" Source #

type EventsCursorKey = "events" Source #

data WithCursor cursorType (cursorKey :: Symbol) 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 "ids" UserId)
    >>> nextCursor res
    Just 1234567890
    >>> contents res
    [1111111111]

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

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

Constructors

WithCursor |

Fields

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

#### Instances

Instances details

Generic1 (WithCursor cursorType cursorKey :: Type -> Type) Source # |
Instance details Defined in Web.Twitter.Conduit.Cursor Associated Types type Rep1 (WithCursor cursorType cursorKey) :: k -> Type Source # Methods from1 :: forall (a :: k). WithCursor cursorType cursorKey a -> Rep1 (WithCursor cursorType cursorKey) a Source # to1 :: forall (a :: k). Rep1 (WithCursor cursorType cursorKey) a -> WithCursor cursorType cursorKey a Source #
(KnownSymbol cursorKey, FromJSON cursorType) => FromJSON1 (WithCursor cursorType cursorKey) Source # |
Instance details Defined in Web.Twitter.Conduit.Cursor Methods liftParseJSON :: (Value -> Parser a) -> (Value -> Parser [a]) -> Value -> Parser (WithCursor cursorType cursorKey a) Source # liftParseJSONList :: (Value -> Parser a) -> (Value -> Parser [a]) -> Value -> Parser [WithCursor cursorType cursorKey a] Source #
Foldable (WithCursor cursorType cursorKey) Source # |

Instance details

Defined in Web.Twitter.Conduit.Cursor

Methods

fold :: Monoid m => WithCursor cursorType cursorKey m -> m Source #

foldMap :: Monoid m => (a -> m) -> WithCursor cursorType cursorKey a -> m Source #

foldMap' :: Monoid m => (a -> m) -> WithCursor cursorType cursorKey a -> m Source #

foldr :: (a -> b -> b) -> b -> WithCursor cursorType cursorKey a -> b Source #

foldr' :: (a -> b -> b) -> b -> WithCursor cursorType cursorKey a -> b Source #

foldl :: (b -> a -> b) -> b -> WithCursor cursorType cursorKey a -> b Source #

foldl' :: (b -> a -> b) -> b -> WithCursor cursorType cursorKey a -> b Source #

foldr1 :: (a -> a -> a) -> WithCursor cursorType cursorKey a -> a Source #

foldl1 :: (a -> a -> a) -> WithCursor cursorType cursorKey a -> a Source #

toList :: WithCursor cursorType cursorKey a -> [a] Source #

null :: WithCursor cursorType cursorKey a -> Bool Source #

length :: WithCursor cursorType cursorKey a -> Int Source #

elem :: Eq a => a -> WithCursor cursorType cursorKey a -> Bool Source #

maximum :: Ord a => WithCursor cursorType cursorKey a -> a Source #

minimum :: Ord a => WithCursor cursorType cursorKey a -> a Source #

sum :: Num a => WithCursor cursorType cursorKey a -> a Source #

product :: Num a => WithCursor cursorType cursorKey a -> a Source #

Traversable (WithCursor cursorType cursorKey) Source # |

Instance details

Defined in Web.Twitter.Conduit.Cursor

Methods

traverse :: Applicative f => (a -> f b) -> WithCursor cursorType cursorKey a -> f (WithCursor cursorType cursorKey b) Source #

sequenceA :: Applicative f => WithCursor cursorType cursorKey (f a) -> f (WithCursor cursorType cursorKey a) Source #

mapM :: Monad m => (a -> m b) -> WithCursor cursorType cursorKey a -> m (WithCursor cursorType cursorKey b) Source #

sequence :: Monad m => WithCursor cursorType cursorKey (m a) -> m (WithCursor cursorType cursorKey a) Source #

Functor (WithCursor cursorType cursorKey) Source # |
Instance details Defined in Web.Twitter.Conduit.Cursor Methods fmap :: (a -> b) -> WithCursor cursorType cursorKey a -> WithCursor cursorType cursorKey b Source # (<$) :: a -> WithCursor cursorType cursorKey b -> WithCursor cursorType cursorKey a Source #
(KnownSymbol cursorKey, FromJSON cursorType, FromJSON wrapped) => FromJSON (WithCursor cursorType cursorKey wrapped) Source # |
Instance details Defined in Web.Twitter.Conduit.Cursor Methods parseJSON :: Value -> Parser (WithCursor cursorType cursorKey wrapped) Source # parseJSONList :: Value -> Parser [WithCursor cursorType cursorKey wrapped] Source #
Generic (WithCursor cursorType cursorKey wrapped) Source # |
Instance details Defined in Web.Twitter.Conduit.Cursor Associated Types type Rep (WithCursor cursorType cursorKey wrapped) :: Type -> Type Source # Methods from :: WithCursor cursorType cursorKey wrapped -> Rep (WithCursor cursorType cursorKey wrapped) x Source # to :: Rep (WithCursor cursorType cursorKey wrapped) x -> WithCursor cursorType cursorKey wrapped Source #
(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 Source # show :: WithCursor cursorType cursorKey wrapped -> String Source # showList :: [WithCursor cursorType cursorKey wrapped] -> ShowS Source #
(NFData cursorType, NFData wrapped) => NFData (WithCursor cursorType cursorKey wrapped) Source # |
Instance details Defined in Web.Twitter.Conduit.Cursor Methods rnf :: WithCursor cursorType cursorKey wrapped -> () Source #
(Eq cursorType, Eq wrapped) => Eq (WithCursor cursorType cursorKey wrapped) Source # |
Instance details Defined in Web.Twitter.Conduit.Cursor Methods (==) :: WithCursor cursorType cursorKey wrapped -> WithCursor cursorType cursorKey wrapped -> Bool Source # (/=) :: WithCursor cursorType cursorKey wrapped -> WithCursor cursorType cursorKey wrapped -> Bool Source #
type Rep1 (WithCursor cursorType cursorKey :: Type -> Type) Source # |

Instance details

Defined in Web.Twitter.Conduit.Cursor

type Rep1 (WithCursor cursorType cursorKey :: Type -> Type) = D1 ('MetaData "WithCursor" "Web.Twitter.Conduit.Cursor" "twitter-conduit-0.6.1-9sN30spntkxCsUJACstU7O" 'False) (C1 ('MetaCons "WithCursor" 'PrefixI 'True) (S1 ('MetaSel ('Just "previousCursor") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Maybe cursorType)) :*: (S1 ('MetaSel ('Just "nextCursor") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Maybe cursorType)) :*: S1 ('MetaSel ('Just "contents") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec1 []))))

type Rep (WithCursor cursorType cursorKey wrapped) Source # |

Instance details

Defined in Web.Twitter.Conduit.Cursor

type Rep (WithCursor cursorType cursorKey wrapped) = D1 ('MetaData "WithCursor" "Web.Twitter.Conduit.Cursor" "twitter-conduit-0.6.1-9sN30spntkxCsUJACstU7O" 'False) (C1 ('MetaCons "WithCursor" 'PrefixI 'True) (S1 ('MetaSel ('Just "previousCursor") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Maybe cursorType)) :*: (S1 ('MetaSel ('Just "nextCursor") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Maybe cursorType)) :*: S1 ('MetaSel ('Just "contents") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 [wrapped]))))