class Has <M, Env, VALUE> Source #
where
Env : Has<M, VALUE>
Strongly typed way of accessing a trait interface from an environment
When using multiple Has
traits, the accessor (Env.Trait
) will cause ambiguity errors.
This type resolves that by forcing qualification via the type parameters. It also has
the benefit that we cache the trait interface in a readonly static, saving on allocations.
type | M | Structure. Usually a monad |
type | Env | The environment type to get the trait interface from |
type | VALUE | Type of the trait interface |
field K<M, VALUE> ask = Env.Ask Source #
Cached trait interface accessor