License | BSD-3 |
---|---|
Maintainer | autotaker@gmail.com |
Stability | experimental |
Safe Haskell | None |
Language | Haskell2010 |
Synopsis
- class Environment env where
- newtype Extends env = Extends env
- data Root = Root
- class Field a env where
- class Trans s (l :: [Type]) where
- 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
- rootL :: Lens' x Root
- extendsL :: Lens' (Extends x) x
Documentation
class Environment env where Source #
Nothing
Super env
represents the inheritance relation between environments.
type Fields1 env :: [Type -> Type] Source #
interfaces that are fields of the environment
type Fields env :: [Type] Source #
fields of the environment
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 env (Addr 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 env (Addr env)) |
ifaceL :: forall f env. Has1 f env => SomeInterface f env Source #