Safe Haskell | None |
---|---|
Language | Haskell2010 |
liblastfm internals
You shouldn't need to import this module unless you are doing something interesting.
- newtype Request f a = Request {}
- data Format
- data Ready
- data Sign
- data R f = R {}
- wrap :: (R f -> R f) -> Request f a
- unwrap :: Request f a -> R f -> R f
- render :: R f -> String
- coerce :: (Contravariant f, Functor f) => f a -> f b
- absorbQuery :: Foldable t => t (Request f b) -> Request f a
- indexedWith :: Int -> Request f a -> Request f a
- host :: Functor f => (Text -> f Text) -> R h -> f (R h)
- method :: Functor f => (ByteString -> f ByteString) -> R h -> f (R h)
- query :: Functor f => (Map Text Text -> f (Map Text Text)) -> R h -> f (R h)
Documentation
Lastfm API request data type
a
is the authentication state. Can be Ready
, which means this Request
is
ready to be sent, or Sign
, if the request signature hasn't been computed yet
f
is the response format (liblastfm supports both JSON
and XML
)
Functor (Request f) | |
Applicative (Request f) | |
Foldable (Request f) | |
Traversable (Request f) | |
Contravariant (Request f) | |
Typeable (Format -> * -> *) Request |
Response format: either JSON or XML
Request that is ready to be sent
Lastfm API request data type
low-level representation
coerce :: (Contravariant f, Functor f) => f a -> f b Source
Copypaste from Control.Lens.Internal.Getter
absorbQuery :: Foldable t => t (Request f b) -> Request f a Source
Absorbing a bunch of queries, useful in batch operations
indexedWith :: Int -> Request f a -> Request f a Source
Transforming Request to the "array notation"
Lenses
method :: Functor f => (ByteString -> f ByteString) -> R h -> f (R h) Source