hreq-core-0.1.1.0: Core functionality for Hreq Http client library

Safe HaskellNone
LanguageHaskell2010

Hreq.Core.API.Internal

Contents

Description

Specification for an API endpoint as a composition of Request and Response components at the Type level.

Synopsis

API type

data Api a Source #

Constructors

Req [ReqContent a] 
Res [ResContent a] 
Instances
SingI content => SingI (Req content :: Api Type) Source # 
Instance details

Defined in Hreq.Core.API.Internal

Methods

sing :: Sing (Req content) Source #

SingI content => SingI (Res content :: Api Type) Source # 
Instance details

Defined in Hreq.Core.API.Internal

Methods

sing :: Sing (Res content) Source #

type Sing Source # 
Instance details

Defined in Hreq.Core.API.Internal

type Sing = SApi

API GADT as a singleton.

data SApi (a :: Api Type) Source #

Constructors

a ~ Req b => SReq (Sing b) 
a ~ Res b => SRes (Sing b) 

SingI instance for API types

API Type combinators

data (a :: k1) :> (b :: k2) infixr 7 Source #

type (:=) (a :: Symbol) (b :: k2) = '(a, b) infixr 1 Source #

For representing type level tuples where first value is a Symbol

>>> import Hreq.Core.API
>>> import GHC.Generics
>>> import Data.Aeson
>>> data User = User deriving (Show)
>>> instance ToJSON User where toJSON = undefined
>>> instance FromJSON User where parseJSON = undefined