Copyright | This file is part of the package themoviedb. It is subject to the license terms in the LICENSE file found in the top-level directory of this distribution and at: https://github.com/pjones/themoviedb No part of this package including this file may be copied modified propagated or distributed except according to the terms contained in the LICENSE file. |
---|---|
License | MIT |
Safe Haskell | None |
Language | Haskell2010 |
Synopsis
- data TheMovieDB a
- type RequestFunction = Path -> QueryText -> IO (Either Error Body)
- getAndParse :: FromJSON a => Path -> QueryText -> TheMovieDB a
- tmdbError :: Error -> TheMovieDB a
- runTheMovieDB :: Settings -> TheMovieDB a -> IO (Either Error a)
- runTheMovieDBWithManager :: Manager -> Settings -> TheMovieDB a -> IO (Either Error a)
- runTheMovieDBWithRequestFunction :: RequestFunction -> TheMovieDB a -> IO (Either Error a)
Documentation
data TheMovieDB a Source #
Result type for operations involving TheMovieDB API.
Instances
Monad TheMovieDB Source # | |
Defined in Network.API.TheMovieDB.Internal.TheMovieDB (>>=) :: TheMovieDB a -> (a -> TheMovieDB b) -> TheMovieDB b # (>>) :: TheMovieDB a -> TheMovieDB b -> TheMovieDB b # return :: a -> TheMovieDB a # fail :: String -> TheMovieDB a # | |
Functor TheMovieDB Source # | |
Defined in Network.API.TheMovieDB.Internal.TheMovieDB fmap :: (a -> b) -> TheMovieDB a -> TheMovieDB b # (<$) :: a -> TheMovieDB b -> TheMovieDB a # | |
Applicative TheMovieDB Source # | |
Defined in Network.API.TheMovieDB.Internal.TheMovieDB pure :: a -> TheMovieDB a # (<*>) :: TheMovieDB (a -> b) -> TheMovieDB a -> TheMovieDB b # liftA2 :: (a -> b -> c) -> TheMovieDB a -> TheMovieDB b -> TheMovieDB c # (*>) :: TheMovieDB a -> TheMovieDB b -> TheMovieDB b # (<*) :: TheMovieDB a -> TheMovieDB b -> TheMovieDB a # | |
MonadIO TheMovieDB Source # | |
Defined in Network.API.TheMovieDB.Internal.TheMovieDB liftIO :: IO a -> TheMovieDB a # |
type RequestFunction = Path -> QueryText -> IO (Either Error Body) Source #
The type for functions that make requests to the API (or pretend to make a request for testing purposes).
getAndParse :: FromJSON a => Path -> QueryText -> TheMovieDB a Source #
Helper function to preform an HTTP GET and decode the JSON result.
tmdbError :: Error -> TheMovieDB a Source #
Create a TheMovieDB
value representing an error.
:: Settings | Library settings. |
-> TheMovieDB a | The API calls to make. |
-> IO (Either Error a) | Response or error. |
Execute requests for TheMovieDB with the given API key and produce either an error or a result.
This version creates a temporary Manager
using
tlsManagerSettings
. If you want to use an existing Manager
you
should use runTheMovieDBWithManager
instead.
runTheMovieDBWithManager Source #
:: Manager | The |
-> Settings | Library settings. |
-> TheMovieDB a | The API calls to make. |
-> IO (Either Error a) | Response or error. |
Execute requests for TheMovieDB with the given API key and produce either an error or a result.
This version allows you to provide a Manager
value which should
have been created to allow TLS requests (e.g., with tlsManagerSettings
).
runTheMovieDBWithRequestFunction Source #
:: RequestFunction | The request function to use. |
-> TheMovieDB a | The API calls to make. |
-> IO (Either Error a) | Response. |
Low-level interface for executing a TheMovieDB
using the given
request function.