registry-0.6.1.0: data structure for assembling components
Safe HaskellSafe-Inferred
LanguageGHC2021

Data.Registry.State

Description

This module is experimental and is not added to the top level module Data.Registry. It is not quite sure if we can / should support a useful state monad for passing a registry around

Synopsis

Documentation

runS :: (MFunctor m, Monad n) => Registry ins out -> m (StateT (Registry ins out) n) a -> m n a Source #

Run some registry modifications in the StateT monad

addFunTo :: forall m a b ins out. (ApplyVariadic m a b, Typeable a, Typeable b, IsSubset (Inputs b) out b) => a -> Registry ins out -> Registry ins out Source #

Add an element to the registry without changing its type

addFunToUnsafe :: forall m a b ins out. (ApplyVariadic m a b, Typeable a, Typeable b) => a -> Registry ins out -> Registry ins out Source #

Add an element to the registry without changing its type *** This possibly adds untracked input types / output type! ***

addFunS :: (Typeable a, IsSubset (Inputs a) out a, MonadState (Registry ins out) m) => a -> m () Source #

Add an element to the registry without changing its type, in the State monad

addFunUnsafeS :: (Typeable a, MonadState (Registry ins out) m) => a -> m () Source #

Add an element to the registry without changing its type, in the State monad *** This possibly adds untracked input types / output type! ***

addToS :: forall n a b m ins out. (ApplyVariadic n a b, Typeable a, Typeable b, Typeable a, IsSubset (Inputs b) out b, MonadState (Registry ins out) m) => a -> m () Source #

Add an element to the registry without changing its type, in the State monad

addToUnsafeS :: forall n a b m ins out. (ApplyVariadic n a b, Typeable a, Typeable b, Typeable a, MonadState (Registry ins out) m) => a -> m () Source #

Add an element to the registry without changing its type, in the State monad *** This possibly adds untracked input types / output type! ***

addFun :: (Typeable a, IsSubset (Inputs a) out a) => a -> Registry ins out -> Registry ins out Source #

Add an element to the registry without changing its type

addFunUnsafe :: Typeable a => a -> Registry ins out -> Registry ins out Source #

Add an element to the registry without changing its type *** This possibly adds untracked input types / output type! ***

addToRegistry :: (Typeable a, IsSubset (Inputs a) out a) => Typed a -> Registry ins out -> Registry ins out Source #

Register modifications of elements which types are already in the registry

concatUnsafeS :: MonadState (Registry ins out) m => Registry ins' out' -> m () Source #

Concatenate a registry to another statefully (to be used with $(makeGenerators ''MyType))

addToRegistryUnsafe :: Typeable a => Typed a -> Registry ins out -> Registry ins out Source #

Register modifications of the registry without changing its type

concatRegistryUnsafe :: Registry ins out -> Registry ins' out' -> Registry ins' out' Source #

Concatenate 2 registries