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

Safe HaskellNone
LanguageHaskell2010

Data.Singletons

Contents

Description

A small singleton core module

A trimmed down core version of the singletons library made for my use case or more specifically Hreq but still general enough for similar use cases.

Motivation

The singleton library has pretty long compile times which can be hard to justify when you are using only a small portion of it. It is also not backward compatible with previous GHC releases. So if you want to support earlier GHC releases in a library that depends on singletons, you are pretty much left to the mercy of CPP hacks and careful Cabal dependency configurations.

Attribution

Some of the code in this module was directly borrowed from the Singletons library

Synopsis

Sing Type family

type family Sing :: k -> Type Source #

Instances
type Sing Source # 
Instance details

Defined in Data.Singletons

type Sing = STypeRep
type Sing Source # 
Instance details

Defined in Data.Singletons

type Sing = SNat
type Sing Source # 
Instance details

Defined in Data.Singletons

type Sing = SSymbol
type Sing Source # 
Instance details

Defined in Data.Singletons

type Sing = (SList :: [k] -> Type)
type Sing Source # 
Instance details

Defined in Hreq.Core.API.Request

type Sing Source # 
Instance details

Defined in Hreq.Core.API.Response

type Sing Source # 
Instance details

Defined in Hreq.Core.API.Internal

type Sing = SApi
type Sing Source # 
Instance details

Defined in Data.Singletons

type Sing = (STuple2 :: (k1, k2) -> Type)

class SingI a where Source #

Methods

sing :: Sing a Source #

Instances
Typeable a => SingI (a :: Type) Source # 
Instance details

Defined in Data.Singletons

Methods

sing :: Sing a Source #

KnownNat a => SingI (a :: Nat) Source # 
Instance details

Defined in Data.Singletons

Methods

sing :: Sing a Source #

KnownSymbol a => SingI (a :: Symbol) Source # 
Instance details

Defined in Data.Singletons

Methods

sing :: Sing a Source #

SingI ([] :: [k]) Source # 
Instance details

Defined in Data.Singletons

Methods

sing :: Sing [] Source #

SingI ts => SingI (Params ts :: ReqContent Type) Source # 
Instance details

Defined in Hreq.Core.API.Request

Methods

sing :: Sing (Params ts) Source #

SingI ts => SingI (Captures ts :: ReqContent Type) Source # 
Instance details

Defined in Hreq.Core.API.Request

Methods

sing :: Sing (Captures ts) Source #

SingI a => SingI (CaptureAll a :: ReqContent Type) Source # 
Instance details

Defined in Hreq.Core.API.Request

Methods

sing :: Sing (CaptureAll a) Source #

SingI a => SingI (ReqHeaders a :: ReqContent Type) Source # 
Instance details

Defined in Hreq.Core.API.Request

Methods

sing :: Sing (ReqHeaders a) Source #

SingI ts => SingI (ResHeaders ts :: ResContent Type) Source # 
Instance details

Defined in Hreq.Core.API.Response

Methods

sing :: Sing (ResHeaders ts) Source #

SingI a => SingI (Raw a :: ResContent Type) Source # 
Instance details

Defined in Hreq.Core.API.Response

Methods

sing :: Sing (Raw a) Source #

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 #

(SingI x, SingI xs) => SingI (x ': xs :: [k]) Source # 
Instance details

Defined in Data.Singletons

Methods

sing :: Sing (x ': xs) Source #

(SingI a, SingI s) => SingI (Path a s :: ReqContent Type) Source # 
Instance details

Defined in Hreq.Core.API.Request

Methods

sing :: Sing (Path a s) Source #

(SingI a, SingI ts) => SingI (QueryFlags a ts :: ReqContent Type) Source # 
Instance details

Defined in Hreq.Core.API.Request

Methods

sing :: Sing (QueryFlags a ts) Source #

(SingI a, SingI s) => SingI (BasicAuth a s :: ReqContent Type) Source # 
Instance details

Defined in Hreq.Core.API.Request

Methods

sing :: Sing (BasicAuth a s) Source #

(SingI a, SingI ctyp) => SingI (ReqBody ctyp a :: ReqContent Type) Source # 
Instance details

Defined in Hreq.Core.API.Request

Methods

sing :: Sing (ReqBody ctyp a) Source #

(SingI a, SingI ctyp) => SingI (StreamBody ctyp a :: ReqContent Type) Source # 
Instance details

Defined in Hreq.Core.API.Request

Methods

sing :: Sing (StreamBody ctyp a) Source #

(SingI ctyp, SingI a) => SingI (ResBody ctyp a :: ResContent Type) Source # 
Instance details

Defined in Hreq.Core.API.Response

Methods

sing :: Sing (ResBody ctyp a) Source #

(SingI a, SingI ctyp) => SingI (ResStream ctyp a :: ResContent Type) Source # 
Instance details

Defined in Hreq.Core.API.Response

Methods

sing :: Sing (ResStream ctyp a) Source #

(SingI x, SingI y) => SingI ((,) x y :: (k1, k2)) Source # 
Instance details

Defined in Data.Singletons

Methods

sing :: Sing (x, y) Source #

Type-lits

data SNat (n :: Nat) Source #

Constructors

KnownNat n => SNat 

data SSymbol (n :: Symbol) Source #

Constructors

KnownSymbol n => SSym 

withKnownNat :: Sing n -> (KnownNat n => r) -> r Source #

Given a singleton for Nat, call something requiring a KnownNat instance.

withKnownSymbol :: Sing n -> (KnownSymbol n => r) -> r Source #

Given a singleton for Symbol, call something requiring a KnownSymbol instance.

Lists

data SList :: [k] -> Type where Source #

Constructors

SNil :: SList '[] 
SCons :: forall k (h :: k) (t :: [k]). Sing h -> SList t -> SList (h ': t) 

Tuples

data STuple2 (a :: (k1, k2)) where Source #

Constructors

STuple2 :: Sing x -> Sing y -> STuple2 '(x, y) 

TypeRep

data STypeRep :: Type -> Type where Source #

Constructors

STypeRep :: forall (t :: Type). Typeable t => STypeRep t