Funcional.Types 2025.11.2

Suggested Alternatives

Functional.Types

dotnet add package Funcional.Types --version 2025.11.2
                    
NuGet\Install-Package Funcional.Types -Version 2025.11.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="Funcional.Types" Version="2025.11.2" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Funcional.Types" Version="2025.11.2" />
                    
Directory.Packages.props
<PackageReference Include="Funcional.Types" />
                    
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 Funcional.Types --version 2025.11.2
                    
#r "nuget: Funcional.Types, 2025.11.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 Funcional.Types@2025.11.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=Funcional.Types&version=2025.11.2
                    
Install as a Cake Addin
#tool nuget:?package=Funcional.Types&version=2025.11.2
                    
Install as a Cake Tool

Funcional.Types

Functional primitives and extensions for C#.

License: MIT Build Code Quality

Funcional.Types (NuGet: Funcional.Types) is a lightweight library of functional primitives and helpers for .NET:

  • Option<T> — optional values and combinators.
  • Result<T, E> — explicit success/failure flow.
  • Unit — a single value type representing absence of data.
  • Error and Validator — small validation helpers.

In addition to the core library, this repository contains a separate package for Entity Framework Core integration: Funcional.Types.EntityFrameworkCore.

Contents

Overview

Funcional.Types aims to provide a small, well-tested set of types and extensions to make functional-style code straightforward in C#, while keeping the core package free of heavier dependencies. Integrations (for example EF Core) are distributed as optional, separate packages to avoid unnecessary transitive dependencies.

Principles:

  • Small dependency-free core.
  • Composable primitives with clear semantics.
  • Opt-in integration packages.

Packages

  • Funcional.Types — core primitives and helpers.
  • Funcional.Types.EntityFrameworkCore — EF Core IQueryable extensions and async/sync helpers (for example FirstOrNoneAsync, SingleOrNoneAsync), which depends on Funcional.Types.

Package IDs published to NuGet follow the project names under /src.

Installation

Install the core package using dotnet:

dotnet add package Funcional.Types

For EF Core integration:

dotnet add package Funcional.Types.EntityFrameworkCore

Both packages target .NET 10 (net10.0).

Quick examples

Option handling:

using Funcional.Types;

Option<int> maybe = Option.Some(3);

int doubled = maybe.Match(
  some: v => v * 2,
  none: () => 0
);

Result usage:

using Funcional.Types;

Result<int, string> r = Result.Ok<int, string>(42);

r.Match(
  ok: v => Console.WriteLine($"Value: {v}"),
  err: e => Console.WriteLine($"Error: {e}")
);

EF Core example (async):

using Funcional.Types.EntityFrameworkCore.Option.Extensions.IQueryable;

var maybeUser = await dbContext.Users.Where(u => u.Id == id).FirstOrNoneAsync();

Migration notes

  • EF Core extensions were extracted from the core package. If you previously relied on EF extensions being present in the main package, add a dependency on Funcional.Types.EntityFrameworkCore.

Build & tests

Requirements: .NET 10 SDK

From the repository root:

dotnet build
dotnet test

The repository includes GitHub Actions workflows for CI and automated publishing.

Versioning & releases

This project uses GitVersion (ContinuousDeployment) along with a calendar-tag release process (YYYY.MM.PATCH). The nuget.yml workflow generates release notes from Conventional Commit messages when an annotated tag is pushed.

To create packages locally:

dotnet pack src/Functional/Functional.csproj -c Release
dotnet pack src/Functional.EntityFrameworkCore/Functional.EntityFrameworkCore.csproj -c Release

To publish to NuGet, set NUGET_API_KEY in your CI environment and push an annotated tag to trigger the workflow.

Contributing

Contributions are welcome. Quick guidelines:

  • Use Conventional Commits for commit messages.
  • Add tests for new behaviour.
  • Keep the core package dependency-free; add integrations as separate projects.

Suggested PR title format: feat: ... / fix: ... / chore: .... Use ! to denote breaking changes.

Licence

This project is licensed under MIT. See the LICENSE file for details.

Product Compatible and additional computed target framework versions.
.NET net10.0 is compatible.  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.
  • net10.0

    • No dependencies.

NuGet packages (1)

Showing the top 1 NuGet packages that depend on Funcional.Types:

Package Downloads
Funcional.Types.EntityFrameworkCore

Entity Framework Core Option/Result extensions for Funcional.Types

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
2025.11.2 370 11/16/2025 2025.11.2 is deprecated because it has critical bugs.
2025.11.1 361 11/16/2025 2025.11.1 is deprecated because it has critical bugs.