Skip to main content
net9.0

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

Published
Apr 6, 2026
7mo ago
Total Downloads
197
197

Install

dotnet add package Effect.Platform --version 0.1.0-alpha.2
ProductVersions
.NET
net9.0

README

Effect.Platform

Platform services for Effect with typed errors and testable interfaces.

HTTP client, file system, and console — all returning Effect with typed errors instead of throwing exceptions.

Install

dotnet add package Effect.Platform --prerelease

Requires the Effect package.

HttpClient

open Eff
open Eff.Platform

let client = Http.fromHttpClient (new HttpClient())

let fetchUser =
    effect {
        let! response = client.Get "https://api.example.com/users/1"
        let! body = Http.getText response
        return body
    }
// Errors are HttpError: RequestFailed | Timeout | ConnectionError

FileSystem

let fs = FileSystem.live

let processFile =
    effect {
        let! content = FileSystem.readAllText "/data/input.txt" fs
        let processed = content.ToUpper()
        do! FileSystem.writeAllText "/data/output.txt" processed fs
    }
// Errors are FileSystemError: FileNotFound | AccessDenied | IOError | ...

Console

Testable console I/O with a built-in test double.

// Production
let console = Console.live

// Testing
let tc = Console.testConsole ()
tc.Input.Enqueue("Alice")

let greet =
    effect {
        do! Console.writeLine "Name?" tc.Console
        let! name = Console.readLine tc.Console
        do! Console.writeLine $"Hello, {name.Value}!" tc.Console
    }

let! _ = Effect.run () greet
// tc.Output = ["Name?"; "Hello, Alice!"]

Changes from Previous Version

No structural changes between v0.1.0-alpha.1 and v0.1.0-alpha.2.

Adoption Assessment

Assess this package against its supported frameworks, license, maintenance signals and dependency graph before making it a project standard.

This version is marked prerelease. Validate its API and upgrade path before production use.Compatibility metadata lists 1 target framework; confirm the exact target used by your application.

Related Guides & Workflows

Learn how to evaluate, integrate, or audit this package in your .NET project.