LanguageExt.Core

LanguageExt.Core Traits Has

Contents

class Has <M, Env, VALUE> Source #

where Env : Has<M, VALUE>

Strongly typed way of accessing a Has 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

Higher-kind

type Env

The environment type from which to get the trait-interface value

type VALUE

Trait interface type

Fields

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

Cached trait interface accessor

interface Has <in M, VALUE> Source #

Makes a value accessible via a property. This allows for structural property access.

Parameters

type M

Higher-kind that supports access to the trait

type VALUE

Type to return as the bound-value

Properties

property K<M, VALUE> Ask Source #