constrained-0.1: Generalization of standard Functor, Foldable, and Traversable classes

Copyright(c) Sergey Vinokurov 2019
LicenseBSD-2 (see LICENSE)
Maintainersergey@debian
Safe HaskellSafe
LanguageHaskell2010

Data.Constrained

Description

 
Synopsis

Documentation

class Constrained (f :: k2 -> k1) Source #

Specification of constrains that a functor might impose on its elements. For example, sets typically require that their elements are ordered and unboxed vectors require elements to have an instance of special class that allows them to be packed in memory.

NB The Constraints type family is associated with a typeclass in order to improve type inference. Whenever a typeclass constraint will be present, instance is guaranteed to exist and typechecker is going to take advantage of that.

Associated Types

type Constraints (f :: k2 -> k1) :: k2 -> Constraint Source #

Instances
Constrained f => Constrained (Alt f :: k2 -> Type) Source # 
Instance details

Defined in Data.Constrained

Associated Types

type Constraints (Alt f) :: k2 -> Constraint Source #

Constrained f => Constrained (Ap f :: k2 -> Type) Source # 
Instance details

Defined in Data.Constrained

Associated Types

type Constraints (Ap f) :: k2 -> Constraint Source #

Constrained (Const a :: k2 -> Type) Source # 
Instance details

Defined in Data.Constrained

Associated Types

type Constraints (Const a) :: k2 -> Constraint Source #

(Constrained f, Constrained g) => Constrained (Sum f g :: k2 -> Type) Source # 
Instance details

Defined in Data.Constrained

Associated Types

type Constraints (Sum f g) :: k2 -> Constraint Source #

(Constrained f, Constrained g) => Constrained (Product f g :: k2 -> Type) Source # 
Instance details

Defined in Data.Constrained

Associated Types

type Constraints (Product f g) :: k2 -> Constraint Source #

(Constrained f, Constrained g) => Constrained (Compose f g :: k2 -> Type) Source # 
Instance details

Defined in Data.Constrained

Associated Types

type Constraints (Compose f g) :: k2 -> Constraint Source #

Constrained [] Source # 
Instance details

Defined in Data.Constrained

Associated Types

type Constraints [] :: k2 -> Constraint Source #

Constrained Maybe Source # 
Instance details

Defined in Data.Constrained

Associated Types

type Constraints Maybe :: k2 -> Constraint Source #

Constrained Min Source # 
Instance details

Defined in Data.Constrained

Associated Types

type Constraints Min :: k2 -> Constraint Source #

Constrained Max Source # 
Instance details

Defined in Data.Constrained

Associated Types

type Constraints Max :: k2 -> Constraint Source #

Constrained First Source # 
Instance details

Defined in Data.Constrained

Associated Types

type Constraints First :: k2 -> Constraint Source #

Constrained Last Source # 
Instance details

Defined in Data.Constrained

Associated Types

type Constraints Last :: k2 -> Constraint Source #

Constrained ZipList Source # 
Instance details

Defined in Data.Constrained

Associated Types

type Constraints ZipList :: k2 -> Constraint Source #

Constrained Identity Source # 
Instance details

Defined in Data.Constrained

Associated Types

type Constraints Identity :: k2 -> Constraint Source #

Constrained Dual Source # 
Instance details

Defined in Data.Constrained

Associated Types

type Constraints Dual :: k2 -> Constraint Source #

Constrained Sum Source # 
Instance details

Defined in Data.Constrained

Associated Types

type Constraints Sum :: k2 -> Constraint Source #

Constrained Product Source # 
Instance details

Defined in Data.Constrained

Associated Types

type Constraints Product :: k2 -> Constraint Source #

Constrained NonEmpty Source # 
Instance details

Defined in Data.Constrained

Associated Types

type Constraints NonEmpty :: k2 -> Constraint Source #

Constrained (Either a :: Type -> Type) Source # 
Instance details

Defined in Data.Constrained

Associated Types

type Constraints (Either a) :: k2 -> Constraint Source #

Constrained ((,) a :: Type -> Type) Source # 
Instance details

Defined in Data.Constrained

Associated Types

type Constraints ((,) a) :: k2 -> Constraint Source #

class NoConstraints (a :: k) Source #

Used to specify values for Constraints type family to indicate absence of any constraints (i.e. empty Constraint).

Instances
NoConstraints (a :: k) Source # 
Instance details

Defined in Data.Constrained

class (Constraints f a, Constraints g a) => UnionConstraints (f :: k1 -> k2) (g :: k1 -> k2) (a :: k1) Source #

Combine constraints of two functors together to form a bigger set of constraints.

Instances
(Constraints f a, Constraints g a) => UnionConstraints (f :: k1 -> k2) (g :: k1 -> k2) (a :: k1) Source # 
Instance details

Defined in Data.Constrained

class (Constraints f (g a), Constraints g a) => ComposeConstraints (f :: k2 -> k1) (g :: k3 -> k2) (a :: k3) Source #

Combine constraints for a case when one functors contains the other one.

Instances
(Constraints f (g a), Constraints g a) => ComposeConstraints (f :: k2 -> k1) (g :: k3 -> k2) (a :: k3) Source # 
Instance details

Defined in Data.Constrained