Effect 0.1.0-alpha.2

This is a prerelease version of Effect.
dotnet add package Effect --version 0.1.0-alpha.2
                    
NuGet\Install-Package Effect -Version 0.1.0-alpha.2
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="Effect" Version="0.1.0-alpha.2" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Effect" Version="0.1.0-alpha.2" />
                    
Directory.Packages.props
<PackageReference Include="Effect" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add Effect --version 0.1.0-alpha.2
                    
#r "nuget: Effect, 0.1.0-alpha.2"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package Effect@0.1.0-alpha.2
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=Effect&version=0.1.0-alpha.2&prerelease
                    
Install as a Cake Addin
#tool nuget:?package=Effect&version=0.1.0-alpha.2&prerelease
                    
Install as a Cake Tool

Effect

Typed, composable effects for F#.

An Effect<'R, 'E, 'A> is a lazy description of a program that requires an environment 'R, can fail with a typed error 'E, and produces a value 'A.

Install

dotnet add package Effect --prerelease

Quick start

open Eff

type AppError = NotFound | Unauthorized

let program =
    effect {
        let! x = Effect.succeed 10
        let! y = Effect.succeed 20
        return x + y
    }

let result = program |> Effect.run () |> fun t -> t.Result
// Ok 30

Error handling

let safe =
    riskyOperation ()
    |> Effect.catchAll (fun err ->
        match err with
        | NotFound -> Effect.succeed "default"
        | other -> Effect.fail other)

Environment / dependency injection

type IAppEnv =
    abstract Db: IDatabase
    abstract Logger: ILogger

let getUser id : Effect<IAppEnv, AppError, User> =
    effect {
        let! env = Effect.env<IAppEnv, AppError>
        let! user = env.Db.FindById id |> Effect.fromTaskResult
        return user
    }

let result = getUser 1 |> Effect.run myEnv

Retry with schedules

let resilient =
    fetchFromApi ()
    |> EffectSchedule.retry (
        Schedule.exponentialN (TimeSpan.FromMilliseconds 100.0) 3)

Cooperative cancellation

CancellationToken flows through the entire effect chain.

let cts = new CancellationTokenSource()
cts.CancelAfter(1000)
let! result = Effect.runWithCancellation myEnv cts.Token myEffect
  • Effect.DI — composable dependency injection layers
  • Effect.Concurrency — fibers, streams, concurrent data structures
  • Effect.Platform — HTTP, file system, console with typed errors
Product Compatible and additional computed target framework versions.
.NET net9.0 is compatible.  net9.0-android was computed.  net9.0-browser was computed.  net9.0-ios was computed.  net9.0-maccatalyst was computed.  net9.0-macos was computed.  net9.0-tvos was computed.  net9.0-windows was computed.  net10.0 was computed.  net10.0-android was computed.  net10.0-browser was computed.  net10.0-ios was computed.  net10.0-maccatalyst was computed.  net10.0-macos was computed.  net10.0-tvos was computed.  net10.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages (3)

Showing the top 3 NuGet packages that depend on Effect:

Package Downloads
Effect.DI

Composable dependency injection layers for Effect. Build, compose, and manage service lifetimes with typed errors and resource safety.

Effect.Concurrency

Structured concurrency primitives for Effect. Fibers, Ref, Deferred, Queue, parallel/race combinators, timeouts, and supervision.

Effect.Platform

Platform services for Effect. HttpClient, FileSystem, and Console with typed errors and dependency injection.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
0.1.0-alpha.2 88 4/6/2026
0.1.0-alpha.1 72 4/6/2026