free-foil-0.2.0: Efficient Type-Safe Capture-Avoiding Substitution for Free (Scoped Monads)
Safe HaskellNone
LanguageHaskell2010

Data.ZipMatchK.Mappings

Synopsis

Documentation

type family ZipLoT (as :: LoT k) (bs :: LoT k) :: LoT k where ... Source #

Zip to lists of types into a single list of pair types.

Equations

ZipLoT 'LoT0 'LoT0 = 'LoT0 
ZipLoT (a ':&&: as :: LoT (Type -> ks)) (b ':&&: bs :: LoT (Type -> ks)) = (a, b) ':&&: ZipLoT as bs 

data Mappings (as :: LoT k) (bs :: LoT k) (cs :: LoT k) where Source #

A collection of zipping functions for zipMatchWithK.

Constructors

M0 :: Mappings 'LoT0 'LoT0 'LoT0

An empty collection (when there no (more) type parameters).

(:^:) infixr 5

A non-empty collection (when there is at least one type parameter).

Fields

  • :: forall {k1} a b c (as1 :: LoT k1) (bs1 :: LoT k1) (cs1 :: LoT k1). (a -> b -> Maybe c)

    Zipping for the first type parameter.

  • -> Mappings as1 bs1 cs1

    Zipping for other type parameters.

  • -> Mappings (a ':&&: as1) (b ':&&: bs1) (c ':&&: cs1)
     

class PairMappings (as :: LoT k) (bs :: LoT k) where Source #

Methods

pairMappings :: Mappings as bs (ZipLoT as bs) Source #

A collection of pairing functions (\x y -> Just (x, y)) for zipMatchK.

Instances

Instances details
PairMappings 'LoT0 'LoT0 Source # 
Instance details

Defined in Data.ZipMatchK.Mappings

PairMappings as bs => PairMappings (a ':&&: as :: LoT (Type -> ks)) (b ':&&: bs :: LoT (Type -> ks)) Source # 
Instance details

Defined in Data.ZipMatchK.Mappings

Methods

pairMappings :: Mappings (a ':&&: as) (b ':&&: bs) (ZipLoT (a ':&&: as) (b ':&&: bs)) Source #

class ApplyMappings (v :: TyVar d Type) where Source #

Methods

applyMappings Source #

Arguments

:: forall (as :: LoT d) (bs :: LoT d) (cs :: LoT d). Mappings as bs cs

A collection of zipping functions.

-> Interpret ('Var v) as

First collection of values (one per type parameter).

-> Interpret ('Var v) bs

Second collection of values (one per type parameter).

-> Maybe (Interpret ('Var v) cs) 

Apply a collection of zipping functions to collections of values.

Instances

Instances details
ApplyMappings ('VZ :: TyVar (Type -> tys) Type) Source # 
Instance details

Defined in Data.ZipMatchK.Mappings

Methods

applyMappings :: forall (as :: LoT (Type -> tys)) (bs :: LoT (Type -> tys)) (cs :: LoT (Type -> tys)). Mappings as bs cs -> Interpret ('Var ('VZ :: TyVar (Type -> tys) Type)) as -> Interpret ('Var ('VZ :: TyVar (Type -> tys) Type)) bs -> Maybe (Interpret ('Var ('VZ :: TyVar (Type -> tys) Type)) cs) Source #

ApplyMappings v => ApplyMappings ('VS v :: TyVar (ty -> tys) Type) Source # 
Instance details

Defined in Data.ZipMatchK.Mappings

Methods

applyMappings :: forall (as :: LoT (ty -> tys)) (bs :: LoT (ty -> tys)) (cs :: LoT (ty -> tys)). Mappings as bs cs -> Interpret ('Var ('VS v :: TyVar (ty -> tys) Type)) as -> Interpret ('Var ('VS v :: TyVar (ty -> tys) Type)) bs -> Maybe (Interpret ('Var ('VS v :: TyVar (ty -> tys) Type)) cs) Source #

pairA :: Applicative f => a -> b -> f (a, b) Source #

Pair two values in a context.