liblastfm-0.1.1.2: Lastfm API interface

Safe HaskellNone

Network.Lastfm.Internal

Contents

Description

liblastfm internals

You shouldn't need to import this module unless you are doing something interesting.

Synopsis

Documentation

newtype Request f a t Source

Lastfm API request data type

a is authentication state. Might be Send which indicates that you may send this request already or Sign, when request signature isn't computed yet

f is response format. liblastfm currently supports JSON or XML

Constructors

Request 

Fields

unRequest :: Dual (Endo (R f a t))
 

Instances

data Format Source

Response format: either JSON or XML

Constructors

JSON 
XML 

data Auth Source

Authentication method

Constructors

Send

Public API. Doesn't require anything special besides API key

Sign

Private API. Requires Session key and Secret as well as API key

data Ready Source

Indicates that request is ready for sending

data R f a t Source

Lastfm API request data type

low-level representation

Constructors

R 

Fields

_host :: !Text
 
_method :: !ByteString
 
_query :: !(Map Text Text)
 

Instances

Coercing (R f) 
Serialize (R f a t) 

wrap :: (R f a t -> R f a t) -> Request f a tSource

Wrapping to interesting Monoid (R -> R) instance

unwrap :: Request f a t -> R f a t -> R f a tSource

Unwrapping from interesting Monoid (R -> R) instance

class Coercing t whereSource

Coerce requests changing their phantom parameters. Used to ensure right flow of working with liblastfm. If you use it on your worn, then you will break abstraction

Methods

coerce :: t (a :: Auth) b -> t c dSource

Instances

render :: R f a t -> StringSource

Construct String from request for networking

Lenses

host :: Functor f => (Text -> f Text) -> R h a t -> f (R h a t)Source

Request _host lens

method :: Functor f => (ByteString -> f ByteString) -> R h a t -> f (R h a t)Source

Request http _method lens

query :: Functor f => (Map Text Text -> f (Map Text Text)) -> R h a t -> f (R h a t)Source

Request _query string lens