Hegel 0.1.3

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

hegel-dotnet

Property-based testing for F#, powered by the native Hegel engine. Write properties; the engine generates inputs and shrinks failures to a minimal counterexample — you never write a shrinker.

Early (v0.1): primitives, core combinators, collections, and the [<Property>] xUnit attribute. Not yet full Hypothesis parity.

Install

dotnet add package Hegel.Xunit   # pulls in Hegel transitively

Quickstart

module Example

open Xunit
open Hegel
open Hegel.Xunit

[<Property>]
let ``reversing a list twice is the identity`` (tc: TestCase) =
    let xs = tc.Draw(Gen.lists (Gen.integers ()))
    Assert.Equal<int list>(xs, xs |> List.rev |> List.rev)

dotnet test runs it as one node over many generated cases; a failure prints the shrunk counterexample (e.g. Falsifying example: 100).

Generators

Draw with tc.Draw(gen):

Primitives integers longs booleans floats text bytes — ints take .Min(..).Max(..)
Combinators map bind filter optional oneOf sampledFrom just
Collections lists set maps tuple2 tuple3

gen { } sequences dependent draws:

gen {
    let! lo = Gen.integers().Min(0).Max(100)
    let! hi = Gen.integers().Min(lo).Max(200)
    return (lo, hi)
}

How it works

A thin client over the native libhegel (Rust) — P/Invoke + CBOR, no Python or subprocess. Generators are deterministic functions of the engine's choice sequence, so shrinking runs engine-side. The native ships per-RID in the package (osx-arm64, linux-x64/arm64, win-x64/arm64); override it with HEGEL_LIBHEGEL_PATH.

Develop

nix develop   # pinned .NET 10 SDK (+ just, python3)
just build
just test
just pack     # fetch all natives + build the packages

License

MIT. The bundled libhegel is MIT (© Antithesis, LLC) — see THIRD-PARTY-NOTICES.txt.

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.

NuGet packages (1)

Showing the top 1 NuGet packages that depend on Hegel:

Package Downloads
Hegel.Xunit

xUnit integration for hegel-dotnet: the [Property] attribute.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
0.1.3 44 7/4/2026
0.1.1 56 7/3/2026
0.1.0 44 7/3/2026