hypertypes-0.1.0.2: Typed ASTs
Safe HaskellNone
LanguageHaskell2010

Hyper.Class.Apply

Description

A variant of Apply for HyperTypes

Synopsis

Documentation

class HFunctor h => HApply h where Source #

A variant of Apply for HyperTypes.

A type which has HApply and HPointed instances also has HApplicative, which is the equivalent to the Applicative class.

Methods

hzip :: (h # p) -> (h # q) -> h # (p :*: q) Source #

Combine child values

>>> hzip (Person name0 age0) (Person name1 age1)
Person (Pair name0 name1) (Pair age0 age1)

Instances

Instances details
HApply Pure Source # 
Instance details

Defined in Hyper.Type.Pure

Methods

hzip :: forall (p :: HyperType) (q :: HyperType). (Pure # p) -> (Pure # q) -> Pure # (p :*: q) Source #

HApply Prune Source # 
Instance details

Defined in Hyper.Type.Prune

Methods

hzip :: forall (p :: HyperType) (q :: HyperType). (Prune # p) -> (Prune # q) -> Prune # (p :*: q) Source #

HApply a => HApply (Ann a) Source # 
Instance details

Defined in Hyper.Combinator.Ann

Methods

hzip :: forall (p :: HyperType) (q :: HyperType). (Ann a # p) -> (Ann a # q) -> Ann a # (p :*: q) Source #

HApply (ANode c) Source # 
Instance details

Defined in Hyper.Combinator.ANode

Methods

hzip :: forall (p :: HyperType) (q :: HyperType). (ANode c # p) -> (ANode c # q) -> ANode c # (p :*: q) Source #

Applicative f => HApply (F f) Source # 
Instance details

Defined in Hyper.Type.Functor

Methods

hzip :: forall (p :: HyperType) (q :: HyperType). (F f # p) -> (F f # q) -> F f # (p :*: q) Source #

HApply (FuncType typ) Source # 
Instance details

Defined in Hyper.Type.AST.FuncType

Methods

hzip :: forall (p :: HyperType) (q :: HyperType). (FuncType typ # p) -> (FuncType typ # q) -> FuncType typ # (p :*: q) Source #

HApply (App expr) Source # 
Instance details

Defined in Hyper.Type.AST.App

Methods

hzip :: forall (p :: HyperType) (q :: HyperType). (App expr # p) -> (App expr # q) -> App expr # (p :*: q) Source #

Semigroup a => HApply (Const a :: AHyperType -> Type) Source # 
Instance details

Defined in Hyper.Class.Apply

Methods

hzip :: forall (p :: HyperType) (q :: HyperType). (Const a # p) -> (Const a # q) -> Const a # (p :*: q) Source #

(HApply a, HApply b) => HApply (HCompose a b) Source # 
Instance details

Defined in Hyper.Combinator.Compose

Methods

hzip :: forall (p :: HyperType) (q :: HyperType). (HCompose a b # p) -> (HCompose a b # q) -> HCompose a b # (p :*: q) Source #

Applicative (Map h) => HApply (TermMap h expr) Source # 
Instance details

Defined in Hyper.Type.AST.Map

Methods

hzip :: forall (p :: HyperType) (q :: HyperType). (TermMap h expr # p) -> (TermMap h expr # q) -> TermMap h expr # (p :*: q) Source #

Semigroup v => HApply (Var v expr) Source # 
Instance details

Defined in Hyper.Type.AST.Var

Methods

hzip :: forall (p :: HyperType) (q :: HyperType). (Var v expr # p) -> (Var v expr # q) -> Var v expr # (p :*: q) Source #

Semigroup (varTypes # QVars) => HApply (Scheme varTypes typ) Source # 
Instance details

Defined in Hyper.Type.AST.Scheme

Methods

hzip :: forall (p :: HyperType) (q :: HyperType). (Scheme varTypes typ # p) -> (Scheme varTypes typ # q) -> Scheme varTypes typ # (p :*: q) Source #

HApply (TypeSig vars term) Source # 
Instance details

Defined in Hyper.Type.AST.TypeSig

Methods

hzip :: forall (p :: HyperType) (q :: HyperType). (TypeSig vars term # p) -> (TypeSig vars term # q) -> TypeSig vars term # (p :*: q) Source #

Semigroup nomId => HApply (FromNom nomId term) Source # 
Instance details

Defined in Hyper.Type.AST.Nominal

Methods

hzip :: forall (p :: HyperType) (q :: HyperType). (FromNom nomId term # p) -> (FromNom nomId term # q) -> FromNom nomId term # (p :*: q) Source #

Semigroup nomId => HApply (ToNom nomId term) Source # 
Instance details

Defined in Hyper.Type.AST.Nominal

Methods

hzip :: forall (p :: HyperType) (q :: HyperType). (ToNom nomId term # p) -> (ToNom nomId term # q) -> ToNom nomId term # (p :*: q) Source #

Semigroup v => HApply (Let v expr) Source # 
Instance details

Defined in Hyper.Type.AST.Let

Methods

hzip :: forall (p :: HyperType) (q :: HyperType). (Let v expr # p) -> (Let v expr # q) -> Let v expr # (p :*: q) Source #

Semigroup v => HApply (Lam v expr) Source # 
Instance details

Defined in Hyper.Type.AST.Lam

Methods

hzip :: forall (p :: HyperType) (q :: HyperType). (Lam v expr # p) -> (Lam v expr # q) -> Lam v expr # (p :*: q) Source #

(HApply a, HApply b) => HApply (a :*: b) Source # 
Instance details

Defined in Hyper.Class.Apply

Methods

hzip :: forall (p :: HyperType) (q :: HyperType). ((a :*: b) # p) -> ((a :*: b) # q) -> (a :*: b) # (p :*: q) Source #

Applicative (Map key) => HApply (FlatRowExtends key val rest) Source # 
Instance details

Defined in Hyper.Type.AST.Row

Methods

hzip :: forall (p :: HyperType) (q :: HyperType). (FlatRowExtends key val rest # p) -> (FlatRowExtends key val rest # q) -> FlatRowExtends key val rest # (p :*: q) Source #

Semigroup key => HApply (RowExtend key val rest) Source # 
Instance details

Defined in Hyper.Type.AST.Row

Methods

hzip :: forall (p :: HyperType) (q :: HyperType). (RowExtend key val rest # p) -> (RowExtend key val rest # q) -> RowExtend key val rest # (p :*: q) Source #

Semigroup var => HApply (TypedLam var typ expr) Source # 
Instance details

Defined in Hyper.Type.AST.TypedLam

Methods

hzip :: forall (p :: HyperType) (q :: HyperType). (TypedLam var typ expr # p) -> (TypedLam var typ expr # q) -> TypedLam var typ expr # (p :*: q) Source #

type HApplicative h = (HPointed h, HApply h) Source #

A variant of Applicative for HyperTypes.

liftH2 :: HApply h => (forall n. HWitness h n -> (p # n) -> (q # n) -> r # n) -> (h # p) -> (h # q) -> h # r Source #

HApply variant of liftA2