FsFlow.Env

Request token for projecting a value from a dependency.

Remarks

Builders read the dependency from the environment, apply the projection, and then reuse the existing lift/bind behavior for the projected value. If the projection returns a Result, Async, Task, ValueTask, ColdTask, option, or voption, the existing workflow rules still apply.

Examples

type IClock =
     abstract UtcNow : unit -> DateTimeOffset

 type ClockCaps =
     inherit Needs<IClock>
     abstract Clock : IClock

 let readClockNow : Flow<#ClockCaps, unit, DateTimeOffset> =
     flow {
         let! now = Env<IClock> _.UtcNow
         return now
     }