constraint-tuples: Partially applicable constraint tuples

[ bsd3, data, library ] [ Propose Tags ]

This library provides classes and type aliases that emulate the behavior of GHC's constraint tuple syntax. Unlike GHC's built-in constraint tuples, the types in this library can be partially applied.

This library exposes four different modules that provide essentially the same API with slight differences in their implementation:

  • Data.Tuple.Constraint: A CTupleN class compiles to a dictionary data type with N fields. (When building with GHC 9.10 or later, this will simply re-export the constraint tuples offered by GHC.Classes.)

  • Data.Tuple.Constraint.ClassNewtype: A CTupleN class compiles to a newtype around the corresponding built-in constraint tuple type with N arguments.

  • Data.Tuple.Constraint.TypeFamily: A CTupleN type alias is a constraint tuple type constructor with N arguments obtained by way of a type family. This will compile to a built-in constraint tuple, but casted with a type family axiom.

  • Data.Tuple.Constraint.TypeSynonym: A CTupleN type alias is a constraint tuple type constructor with N arguments obtained by way of a type synonym. This will compile directly to a built-in constraint tuple.


[Skip to Readme]

Downloads

Maintainer's Corner

Package maintainers

For package maintainers and hackage trustees

Candidates

  • No Candidates
Versions [RSS] 0.1, 0.1.1, 0.1.2, 0.2
Change log CHANGELOG.md
Dependencies base (>=4.9 && <5), ghc-prim [details]
License BSD-3-Clause
Copyright (C) 2018-2019 Ryan Scott
Author Ryan Scott
Maintainer ryan.gl.scott@gmail.com
Category Data
Home page https://github.com/RyanGlScott/constraint-tuples
Bug tracker https://github.com/RyanGlScott/constraint-tuples/issues
Source repo head: git clone https://github.com/RyanGlScott/constraint-tuples
Uploaded by ryanglscott at 2024-05-03T23:06:43Z
Distributions LTSHaskell:0.1.2, NixOS:0.1.2, Stackage:0.2
Downloads 1523 total (32 in the last 30 days)
Rating (no votes yet) [estimated by Bayesian average]
Your Rating
  • λ
  • λ
  • λ
Status Docs available [build log]
Last success reported on 2024-05-03 [all 1 reports]

Readme for constraint-tuples-0.2

[back to package description]

constraint-tuples

Hackage Hackage Dependencies Haskell Programming Language BSD3 License Build Status

This library provides classes and type aliases that emulate the behavior of GHC's constraint tuple syntax. Unlike GHC's built-in constraint tuples, the types in this library can be partially applied.

This library exposes four different modules that provide essentially the same API with slight differences in their implementation:

  • Data.Tuple.Constraint: A CTupleN class compiles to a dictionary data type with N fields. (When building with GHC 9.10 or later, this will simply re-export the constraint tuples offered by GHC.Classes.)
  • Data.Tuple.Constraint.ClassNewtype: A CTupleN class compiles to a newtype around the corresponding built-in constraint tuple type with N arguments.
  • Data.Tuple.Constraint.TypeFamily: A CTupleN type alias is a constraint tuple type constructor with N arguments obtained by way of a type family. This will compile to a built-in constraint tuple, but casted with a type family axiom.
  • Data.Tuple.Constraint.TypeSynonym: A CTupleN type alias is a constraint tuple type constructor with N arguments obtained by way of a type synonym. This will compile directly to a built-in constraint tuple.