LanguageExt.Core

LanguageExt.Core Traits Has

Contents

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.

Parameters

type M

Structure. Usually a monad

type Env

The environment type to get the trait interface from

type VALUE

Type of the trait interface

Fields

field K<M, VALUE> ask = Env.Ask Source #

Cached trait interface accessor

interface Has <in M, TRAIT> Source #

Makes a value accessible via a property

Parameters

type M
type TRAIT

Properties

property K<M, TRAIT> Ask Source #