Logo Orsak

GenEnvironmentAttribute Type

Generates a create function for an interface that only inherits provider interfaces, implementing every provider from an anonymous record of effects, and run and runOrFail functions that run an effect in the created environment.

Example

 [<GenEnvironment>]
 type IAppEnvironment =
     inherit IButtonPusherProvider
     inherit IGuidGenProvider

 // using the generated module
 let env = AppEnvironment.create {| ButtonPusher = pusher; GuidGenerator = GuidGenerator.defaultGen () |}
 let! result = AppEnvironment.run {| ButtonPusher = pusher; GuidGenerator = GuidGenerator.defaultGen () |} (work ())
type IAppEnvironment = inherit obj inherit obj
val env: obj
val result: obj

Constructors

Constructor Description

GenEnvironmentAttribute()

Full Usage: GenEnvironmentAttribute()

Returns: GenEnvironmentAttribute

Instance members

Instance member Description

this.Inline

Full Usage: this.Inline

Returns: bool

Only needed with Myriad 1.0: set when the file uses MyriadInlineGeneration, so the code is generated without namespace or opens, to be appended to the end of the file. Myriad 1.1 and later say whether a file is inline themselves, which then takes precedence.

Returns: bool

Type something to start searching.