| Safe Haskell | None |
|---|---|
| Language | GHC2021 |
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
- runS :: forall {k} m (n :: Type -> Type) (ins :: [Type]) (out :: [Type]) (a :: k). (MFunctor m, Monad n) => Registry ins out -> m (StateT (Registry ins out) n) a -> m n a
- addFunTo :: forall (m :: Type -> Type) a b (ins :: [Type]) (out :: [Type]). (ApplyVariadic m a b, Typeable a, Typeable b, IsSubset (Inputs b) out b) => a -> Registry ins out -> Registry ins out
- addFunToUnsafe :: forall (m :: Type -> Type) a b (ins :: [Type]) (out :: [Type]). (ApplyVariadic m a b, Typeable a, Typeable b) => a -> Registry ins out -> Registry ins out
- addFunS :: forall a (out :: [Type]) (ins :: [Type]) m. (Typeable a, IsSubset (Inputs a) out a, MonadState (Registry ins out) m) => a -> m ()
- addFunUnsafeS :: forall a (ins :: [Type]) (out :: [Type]) m. (Typeable a, MonadState (Registry ins out) m) => a -> m ()
- addToS :: forall (n :: Type -> Type) a b m (ins :: [Type]) (out :: [Type]). (ApplyVariadic n a b, Typeable a, Typeable b, Typeable a, IsSubset (Inputs b) out b, MonadState (Registry ins out) m) => a -> m ()
- addToUnsafeS :: forall (n :: Type -> Type) a b m (ins :: [Type]) (out :: [Type]). (ApplyVariadic n a b, Typeable a, Typeable b, Typeable a, MonadState (Registry ins out) m) => a -> m ()
- addFun :: forall a (out :: [Type]) (ins :: [Type]). (Typeable a, IsSubset (Inputs a) out a) => a -> Registry ins out -> Registry ins out
- addFunUnsafe :: forall a (ins :: [Type]) (out :: [Type]). Typeable a => a -> Registry ins out -> Registry ins out
- addToRegistry :: forall a (out :: [Type]) (ins :: [Type]). (Typeable a, IsSubset (Inputs a) out a) => Typed a -> Registry ins out -> Registry ins out
- concatUnsafeS :: forall (ins :: [Type]) (out :: [Type]) m (ins' :: [Type]) (out' :: [Type]). MonadState (Registry ins out) m => Registry ins' out' -> m ()
- addToRegistryUnsafe :: forall {k} (a :: k) (ins :: [Type]) (out :: [Type]). Typeable a => Typed a -> Registry ins out -> Registry ins out
- concatRegistryUnsafe :: forall (ins :: [Type]) (out :: [Type]) (ins' :: [Type]) (out' :: [Type]). Registry ins out -> Registry ins' out' -> Registry ins' out'
Documentation
runS :: forall {k} m (n :: Type -> Type) (ins :: [Type]) (out :: [Type]) (a :: k). (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 :: Type -> Type) a b (ins :: [Type]) (out :: [Type]). (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 :: Type -> Type) a b (ins :: [Type]) (out :: [Type]). (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 :: forall a (out :: [Type]) (ins :: [Type]) m. (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 :: forall a (ins :: [Type]) (out :: [Type]) m. (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 :: Type -> Type) a b m (ins :: [Type]) (out :: [Type]). (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 :: Type -> Type) a b m (ins :: [Type]) (out :: [Type]). (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 :: forall a (out :: [Type]) (ins :: [Type]). (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 :: forall a (ins :: [Type]) (out :: [Type]). 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 :: forall a (out :: [Type]) (ins :: [Type]). (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 :: forall (ins :: [Type]) (out :: [Type]) m (ins' :: [Type]) (out' :: [Type]). MonadState (Registry ins out) m => Registry ins' out' -> m () Source #
Concatenate a registry to another statefully (to be used with $(makeGenerators ''MyType))