Safe Haskell | None |
---|---|
Language | Haskell2010 |
Control.Monad.HReader.Class
Synopsis
- class (Monad m, Applicative m) => MonadHReader (m :: Type -> Type) where
- type MHRElements (m :: Type -> Type) :: [Type]
- askHSet :: m (HSet (MHRElements m))
- hlocal :: (HSet (MHRElements m) -> HSet (MHRElements m)) -> m a -> m a
- type family MHRElemsConstraint (m :: Type -> Type) (els :: [Type]) where ...
- hask :: (MonadHReader m, HGettable (MHRElements m) e) => m e
- haskTagged :: (MonadHReader m, HGettable (MHRElements m) (Tagged tag e)) => proxy tag -> m e
Documentation
class (Monad m, Applicative m) => MonadHReader (m :: Type -> Type) where Source #
Monad which is a reader of HSet (or just can construct it).
Methods
askHSet :: m (HSet (MHRElements m)) Source #
hlocal :: (HSet (MHRElements m) -> HSet (MHRElements m)) -> m a -> m a Source #
Instances
type family MHRElemsConstraint (m :: Type -> Type) (els :: [Type]) where ... Source #
Easy generate constraint like (HGettable (MHRElements m) Int, HGettable (MHRElements m) Bool) from type list [Int, Bool]. Usable to reuse type lists for constraints and concrete HSet.
Equations
MHRElemsConstraint m ('[] :: [Type]) = MonadHReader m | |
MHRElemsConstraint m (e ': els) = (HGettable (MHRElements m) e, MHRElemsConstraint m els) |
hask :: (MonadHReader m, HGettable (MHRElements m) e) => m e Source #
Ask arbitrary element of hset inside HReader
haskTagged :: (MonadHReader m, HGettable (MHRElements m) (Tagged tag e)) => proxy tag -> m e Source #
Ask arbitrary labeled element of hset in HReader