Deepstaging.Roslyn.LanguageExt
1.0.0-dev.209
This is a prerelease version of Deepstaging.Roslyn.LanguageExt.
dotnet add package Deepstaging.Roslyn.LanguageExt --version 1.0.0-dev.209
NuGet\Install-Package Deepstaging.Roslyn.LanguageExt -Version 1.0.0-dev.209
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="Deepstaging.Roslyn.LanguageExt" Version="1.0.0-dev.209" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Deepstaging.Roslyn.LanguageExt" Version="1.0.0-dev.209" />
<PackageReference Include="Deepstaging.Roslyn.LanguageExt" />
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 Deepstaging.Roslyn.LanguageExt --version 1.0.0-dev.209
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
#r "nuget: Deepstaging.Roslyn.LanguageExt, 1.0.0-dev.209"
#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 Deepstaging.Roslyn.LanguageExt@1.0.0-dev.209
#: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=Deepstaging.Roslyn.LanguageExt&version=1.0.0-dev.209&prerelease
#tool nuget:?package=Deepstaging.Roslyn.LanguageExt&version=1.0.0-dev.209&prerelease
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
Deepstaging.Roslyn.LanguageExt
LanguageExt type references and emit patterns for Roslyn source generators built with Deepstaging.Roslyn.
Usage
using Deepstaging.Roslyn.LanguageExt.Refs;
// Type references carry constituent types for compile-time introspection
var effType = LanguageExtRefs.Eff("RT", "int"); // EffTypeRef → global::LanguageExt.Eff<RT, int>
var optionType = LanguageExtRefs.Option("string"); // OptionTypeRef → global::LanguageExt.Option<string>
var eitherType = LanguageExtRefs.Either("Error", "int");// EitherTypeRef → global::LanguageExt.Either<Error, int>
var finType = LanguageExtRefs.Fin("int"); // FinTypeRef → global::LanguageExt.Fin<int>
var seqType = LanguageExtRefs.Seq("string"); // SeqTypeRef → global::LanguageExt.Seq<string>
var hashMapType = LanguageExtRefs.HashMap("string", "int"); // HashMapTypeRef
var unitType = LanguageExtRefs.Unit; // global::LanguageExt.Unit
// Namespaces and Prelude
var ns = LanguageExtRefs.Namespace; // LanguageExt
var prelude = LanguageExtRefs.PreludeStatic; // static LanguageExt.Prelude
Expressions
Prelude-style construction expressions that return ExpressionRef for composability:
using Deepstaging.Roslyn.LanguageExt.Expressions;
// Option
OptionExpression.Optional("value"); // Optional(value)
OptionExpression.Some("entity"); // Some(entity)
OptionExpression.None; // None
// Either
EitherExpression.Right("entity"); // Right(entity)
EitherExpression.Left("Error.New(ex)"); // Left(Error.New(ex))
// Fin
FinExpression.FinSucc("42"); // FinSucc(42)
FinExpression.FinFail("Error.New(ex)"); // FinFail(Error.New(ex))
// Seq
SeqExpression.Seq("a", "b", "c"); // Seq(a, b, c)
SeqExpression.toSeq("items"); // toSeq(items)
SeqExpression.Empty(LanguageExtRefs.Seq("string")); // global::LanguageExt.Seq<string>.Empty
// HashMap
HashMapExpression.toHashMap("pairs"); // toHashMap(pairs)
HashMapExpression.Empty(LanguageExtRefs.HashMap("string", "int"));
// All return ExpressionRef — chain with .Call(), .Await(), .Member(), etc.
OptionExpression.Optional("value").Call("Map", "x => x.Name");
Effect Expressions
Builders for liftEff and Eff.LiftIO patterns:
var lift = EffExpression.Lift("RT", "rt");
lift.Async("int", "rt.Service.GetCountAsync()");
// → liftEff<RT, int>(async rt => await rt.Service.GetCountAsync())
lift.AsyncOptional(LanguageExtRefs.Option("User"), "rt.Service.FindAsync(id)");
// → liftEff<RT, Option<User>>(async rt => Optional(await rt.Service.FindAsync(id)))
lift.SyncVoid("rt.Service.Reset()");
// → liftEff<RT, Unit>(rt => { rt.Service.Reset(); return unit; })
// LiftIO for terminal operations (type already known)
var io = EffExpression.LiftIO(LanguageExtRefs.Eff("RT", "int"), "rt");
io.Async("query(rt).CountAsync(token)");
// → global::LanguageExt.Eff<RT, int>.LiftIO(async rt => await query(rt).CountAsync(token))
Patterns
Lifting Strategy
Dispatch to the correct lift method based on the operation shape — eliminates manual switch statements:
using Deepstaging.Roslyn.LanguageExt.Expressions;
var lift = EffExpression.Lift("RT", "rt");
// Dispatch based on strategy
var expr = lift.Lift(LiftingStrategy.AsyncOptional, "User", "rt.Service.FindAsync(id)");
// → liftEff<RT, Option<User>>(async rt => Optional(await rt.Service.FindAsync(id)))
// Compute the Eff return type for the same strategy
var returnType = LiftingStrategy.AsyncOptional.EffReturnType("User");
// → global::LanguageExt.Option<User>
Eff Method Shape
Build the standard Eff<RT, A> method shape with a single call:
using Deepstaging.Roslyn.LanguageExt.Extensions;
MethodBuilder
.Parse("public void GetCount()")
.AsEffMethod("RT", "IHasDb", "int")
.WithExpressionBody(lift.Async("int", "rt.Db.Users.CountAsync()"));
// → public static Eff<RT, int> GetCount<RT>() where RT : IHasDb
// => liftEff<RT, int>(async rt => await rt.Db.Users.CountAsync())
// Combine both patterns for full automation:
var strategy = LiftingStrategy.AsyncOptional;
MethodBuilder
.Parse("public void FindUser(int id)")
.AsEffMethod("RT", "IHasDb", strategy.EffReturnType("User"))
.WithExpressionBody(lift.Lift(strategy, "User", "rt.Service.FindAsync(id)"));
Package Structure
This is a satellite package following the Deepstaging.Roslyn.{Library} convention:
- Refs/ — Type-safe wrappers for LanguageExt types (carry constituent types)
- Expressions/ — Expression builders for Prelude functions and Eff lifting
- Extensions/ — TypeBuilder/MethodBuilder extensions for common LanguageExt patterns
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net5.0 was computed. net5.0-windows was computed. net6.0 was computed. net6.0-android was computed. net6.0-ios was computed. net6.0-maccatalyst was computed. net6.0-macos was computed. net6.0-tvos was computed. net6.0-windows was computed. net7.0 was computed. net7.0-android was computed. net7.0-ios was computed. net7.0-maccatalyst was computed. net7.0-macos was computed. net7.0-tvos was computed. net7.0-windows was computed. net8.0 was computed. net8.0-android was computed. net8.0-browser was computed. net8.0-ios was computed. net8.0-maccatalyst was computed. net8.0-macos was computed. net8.0-tvos was computed. net8.0-windows was computed. net9.0 was computed. 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. |
| .NET Core | netcoreapp2.0 was computed. netcoreapp2.1 was computed. netcoreapp2.2 was computed. netcoreapp3.0 was computed. netcoreapp3.1 was computed. |
| .NET Standard | netstandard2.0 is compatible. netstandard2.1 was computed. |
| .NET Framework | net461 was computed. net462 was computed. net463 was computed. net47 was computed. net471 was computed. net472 was computed. net48 was computed. net481 was computed. |
| MonoAndroid | monoandroid was computed. |
| MonoMac | monomac was computed. |
| MonoTouch | monotouch was computed. |
| Tizen | tizen40 was computed. tizen60 was computed. |
| Xamarin.iOS | xamarinios was computed. |
| Xamarin.Mac | xamarinmac was computed. |
| Xamarin.TVOS | xamarintvos was computed. |
| Xamarin.WatchOS | xamarinwatchos was computed. |
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
-
.NETStandard 2.0
- Deepstaging.Roslyn (>= 1.0.0-dev.209)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated |
|---|---|---|
| 1.0.0-dev.209 | 38 | 2/19/2026 |
| 1.0.0-dev.200 | 44 | 2/18/2026 |
| 1.0.0-dev.174 | 35 | 2/17/2026 |
| 1.0.0-dev.170 | 46 | 2/17/2026 |