provide-0.1.0.0: Lightweight dependency injection / namespaced+typed implicit-ish arguments
Safe HaskellNone
LanguageHaskell2010

Control.Provide

Synopsis

Documentation

type family ProviderTypeContext provider Source #

The "type context" of a provider. Think of this as an open record of types, whose members can influence the types of values in the provider.

Instances

Instances details
type ProviderTypeContext (ARecProvider tctx recVal) Source # 
Instance details

Defined in Control.Provide.ARec

type ProviderTypeContext (ARecProvider tctx recVal) = tctx

type family ValueType t a Source #

class Provides provider key where infix 4 Source #

A class indicating that the given provider type provides a value for a given key. The key is typically an empty datatype declared inside the library which receives values using this key.

Methods

provided :: ValueType (ProviderTypeContext provider) key Source #

Instances

Instances details
(Reifies recVal (ARec (ProviderField tctx) items), RecElem (ARec :: (Type -> Type) -> [Type] -> Type) key key items items (RIndex key items)) => Provides (ARecProvider tctx recVal) key Source # 
Instance details

Defined in Control.Provide.ARec

providedP :: forall key provider. Provides provider key => Proxy provider -> ValueType (ProviderTypeContext provider) key Source #