License | BSD-3 |
---|---|
Maintainer | autotaker@gmail.com |
Stability | experimental |
Safe Haskell | None |
Language | Haskell2010 |
Synopsis
- class Environment env where
- type family Super env
- data Root = Root
- class Field a env where
- class Trans a (l :: [Type]) s | a l -> s where
- type (<:) env env' = Trans env' (Addr env env') env
- data SomeInterface f env where
- SomeInterface :: Lens' env' (f env') -> Lens' env env' -> SomeInterface f env
- type family Has a env where ...
- type family Has1 f env where ...
- getL :: forall a env. Has a env => Lens' env a
- ifaceL :: forall f env. Has1 f env => SomeInterface f env
- runIF :: forall f env a. Has1 f env => (forall env'. f env' -> RIO env' a) -> RIO env a
Documentation
class Environment env Source #
type family Super env Source #
Super env
represents the inheritance relation between environments.
Every environment must be a descendant of Root
.
Root environment that does not have any fields.
data SomeInterface f env where Source #
SomeInterface :: Lens' env' (f env') -> Lens' env env' -> SomeInterface f env |
type family Has a env where ... Source #
Type constraint meaning env
contains a
as a (including ancestors') field.
An environment env
contains unique value for each type T
that satisfies
Has T env
. If you want to depends on multiple values of the same type,
please distinguish them by using newtype.
Has a env = HasAux a env (FindEnv a (Ancestors env)) |
type family Has1 f env where ... Source #
Type constraint meaning env
contains f env'
for some ancestor env'
Has1 f env = Has1Aux f env (FindEnv1 f (Ancestors env)) |
ifaceL :: forall f env. Has1 f env => SomeInterface f env Source #