@hackage / constraint-tuples

Partially applicable constraint tuples

Latest0.2

About

Metadata

  • Last updated , by ryanglscott
  • License BSD-3-Clause
  • Maintained by: ryan.gl.scott@gmail.com

  • Lottery factor: 0

Links

Installation

Tested Compilers

  1. 9.10.1
  2. 9.8.2
  3. 9.6.5
  4. 9.4.8
  5. 9.2.8
  6. 9.0.2
  7. 8.10.7
  8. 8.8.4
  9. 8.6.5
  10. 8.4.4
  11. 8.2.2
  12. 8.0.2

Readme

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.