HORIZON HASKELLDocslts/ghc-9.10.xc74966e2026-09-27Search names, modules, packages, or :: a typeCtrl K

GHC 9.10.3 · lts/ghc-9.10.x · c74966e · 2026-09-27

Modulebarbies-2.1.1.0Haskell2010

Barbies.Constraints

Support for operating on Barbie-types with constrained functions.

  • 2 types
  • 3 classes
  • 1 value
  • Packagebarbies-2.1.1.0
  • Exports6
  • LanguageHaskell2010
  • LicenceBSD-3-Clause
  • SourceConstraints.hs

Instance dictionaries

2 declarations
datadata Dict (c :: k -> Constraint) (a :: k) where
#

Dict c a is evidence that there exists an instance of c a.

It is essentially equivalent to Dict (c a) from the constraints package, but because of its kind, it allows us to define things like Dict Show.

Constructors

Instances8GConstraints, Show1, Eq, Show, …
valuerequiringDict :: (c a => r) -> Dict c a -> r
#

Turn a constrained-function into an unconstrained one that uses the packed instance dictionary instead.

Getting constraints

3 declarations
classclass c (f a) => ClassF (c :: k -> Constraint) (f :: k1 -> k) (a :: k1)
#

ClassF has one universal instance that makes ClassF c f a equivalent to c (f a). However, we have

'ClassF c f :: k -> Constraint

This is useful since it allows to define constraint-constructors like ClassF Monoid Maybe

Instances1ClassF
  • c (f a) => ClassF c f aDefined in barbies-2.1.1.0 · Barbies.Internal.Dicts
classclass c (f a) (g a) => ClassFG (c :: k -> k1 -> Constraint) (f :: k2 -> k) (g :: k2 -> k1) (a :: k2)
#

Like ClassF but for binary relations.

Instances1ClassFG
  • c (f a) (g a) => ClassFG c f g aDefined in barbies-2.1.1.0 · Barbies.Internal.Dicts

Helpers

1 declaration
classclass (c a, d a) => (&) (c :: k -> Constraint) (d :: k -> Constraint) (a :: k)
#
Instances1&
  • (c a, d a) => (&) c d aDefined in barbies-2.1.1.0 · Barbies.Internal.ConstraintsB