Install-Package TypeEquality -Version 0.3.0
dotnet add package TypeEquality --version 0.3.0
<PackageReference Include="TypeEquality" Version="0.3.0" />
paket add TypeEquality --version 0.3.0
#r "nuget: TypeEquality, 0.3.0"
// Install TypeEquality as a Cake Addin #addin nuget:?package=TypeEquality&version=0.3.0 // Install TypeEquality as a Cake Tool #tool nuget:?package=TypeEquality&version=0.3.0
Type equalities for F#
This library contains type equalities (Teqs) for F#. These equalities allow us to create type-safe abstractions by allowing us to encode Generalised Algebraic Data Types (GADTs), as found in languages like Haskell.
To use Teqs in your projects, you'll want to reference the main TypeEquality
project. The project is available as a nuget package - https://www.nuget.org/packages/TypeEquality.
This project provides a type
Teq<'a,'b> of proofs that
'b are the same type. By including these in the declaration of a
generic discriminated union, you can constrain the types each case
applies to, encoding a GADT.
An example of this may be found in the Example folder.
For more advanced usage, TypeEquality also allows you to reason about Teqs using the functions in the Teq and Teq.Cong (congruence) modules.
The library has some unit tests in the Test/TypeEquality.Test.fsproj project.
We welcome new contributors! We'll happily receive PRs for bug fixes or small changes. If you're contemplating something larger please get in touch first by opening a GitHub Issue describing the problem and how you propose to solve it.
Copyright 2018 G-Research
Licensed under the Apache License, Version 2.0 (the "License"); you may not use these files except in compliance with the License. You may obtain a copy of the License at
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
|.NET||net5.0 net5.0-windows net6.0 net6.0-android net6.0-ios net6.0-maccatalyst net6.0-macos net6.0-tvos net6.0-windows|
|.NET Core||netcoreapp2.0 netcoreapp2.1 netcoreapp2.2 netcoreapp3.0 netcoreapp3.1|
|.NET Standard||netstandard2.0 netstandard2.1|
|.NET Framework||net461 net462 net463 net47 net471 net472 net48|
NuGet packages (2)
Showing the top 2 NuGet packages that depend on TypeEquality:
Heterogeneous collections for F#. Using heterogeneous collections, it's possible to act on arbitrary sum and product types in a generic way.
A lightweight parser combinator library for F#.
This package is not used by any popular GitHub repositories.