hypertypes-0.2.2: Typed ASTs
Safe HaskellSafe-Inferred
LanguageHaskell2010

Hyper.Class.Morph

Description

An extension of HFunctor for parameterized HyperTypes

Synopsis

Documentation

class HMorph s t where Source #

A type-varying variant of HFunctor which can modify type parameters of the mapped HyperType

Associated Types

type MorphConstraint s t (c :: HyperType -> HyperType -> Constraint) :: Constraint Source #

data MorphWitness s t :: HyperType -> HyperType -> Type Source #

Methods

morphMap :: (forall a b. MorphWitness s t a b -> (p # a) -> q # b) -> (s # p) -> t # q Source #

morphLiftConstraint :: MorphConstraint s t c => MorphWitness s t a b -> Proxy c -> (c a b => r) -> r Source #

Instances

Instances details
HMorph (ANode a) (ANode b) Source # 
Instance details

Defined in Hyper.Combinator.ANode

Associated Types

type MorphConstraint (ANode a) (ANode b) c Source #

data MorphWitness (ANode a) (ANode b) :: HyperType -> HyperType -> Type Source #

Methods

morphMap :: (forall (a0 :: HyperType) (b0 :: HyperType). MorphWitness (ANode a) (ANode b) a0 b0 -> (p # a0) -> q # b0) -> (ANode a # p) -> ANode b # q Source #

morphLiftConstraint :: forall c (a0 :: HyperType) (b0 :: HyperType) r. MorphConstraint (ANode a) (ANode b) c => MorphWitness (ANode a) (ANode b) a0 b0 -> Proxy c -> (c a0 b0 => r) -> r Source #

HMorph (App expr0) (App expr1) Source # 
Instance details

Defined in Hyper.Syntax.App

Associated Types

type MorphConstraint (App expr0) (App expr1) c Source #

data MorphWitness (App expr0) (App expr1) :: HyperType -> HyperType -> Type Source #

Methods

morphMap :: (forall (a :: HyperType) (b :: HyperType). MorphWitness (App expr0) (App expr1) a b -> (p # a) -> q # b) -> (App expr0 # p) -> App expr1 # q Source #

morphLiftConstraint :: forall c (a :: HyperType) (b :: HyperType) r. MorphConstraint (App expr0) (App expr1) c => MorphWitness (App expr0) (App expr1) a b -> Proxy c -> (c a b => r) -> r Source #

HMorph (FuncType typ0) (FuncType typ1) Source # 
Instance details

Defined in Hyper.Syntax.FuncType

Associated Types

type MorphConstraint (FuncType typ0) (FuncType typ1) c Source #

data MorphWitness (FuncType typ0) (FuncType typ1) :: HyperType -> HyperType -> Type Source #

Methods

morphMap :: (forall (a :: HyperType) (b :: HyperType). MorphWitness (FuncType typ0) (FuncType typ1) a b -> (p # a) -> q # b) -> (FuncType typ0 # p) -> FuncType typ1 # q Source #

morphLiftConstraint :: forall c (a :: HyperType) (b :: HyperType) r. MorphConstraint (FuncType typ0) (FuncType typ1) c => MorphWitness (FuncType typ0) (FuncType typ1) a b -> Proxy c -> (c a b => r) -> r Source #

HMorph (Lam v expr0) (Lam v expr1) Source # 
Instance details

Defined in Hyper.Syntax.Lam

Associated Types

type MorphConstraint (Lam v expr0) (Lam v expr1) c Source #

data MorphWitness (Lam v expr0) (Lam v expr1) :: HyperType -> HyperType -> Type Source #

Methods

morphMap :: (forall (a :: HyperType) (b :: HyperType). MorphWitness (Lam v expr0) (Lam v expr1) a b -> (p # a) -> q # b) -> (Lam v expr0 # p) -> Lam v expr1 # q Source #

morphLiftConstraint :: forall c (a :: HyperType) (b :: HyperType) r. MorphConstraint (Lam v expr0) (Lam v expr1) c => MorphWitness (Lam v expr0) (Lam v expr1) a b -> Proxy c -> (c a b => r) -> r Source #

HMorph (Let v expr0) (Let v expr1) Source # 
Instance details

Defined in Hyper.Syntax.Let

Associated Types

type MorphConstraint (Let v expr0) (Let v expr1) c Source #

data MorphWitness (Let v expr0) (Let v expr1) :: HyperType -> HyperType -> Type Source #

Methods

morphMap :: (forall (a :: HyperType) (b :: HyperType). MorphWitness (Let v expr0) (Let v expr1) a b -> (p # a) -> q # b) -> (Let v expr0 # p) -> Let v expr1 # q Source #

morphLiftConstraint :: forall c (a :: HyperType) (b :: HyperType) r. MorphConstraint (Let v expr0) (Let v expr1) c => MorphWitness (Let v expr0) (Let v expr1) a b -> Proxy c -> (c a b => r) -> r Source #

HMorph (TermMap h expr0) (TermMap h expr1) Source # 
Instance details

Defined in Hyper.Syntax.Map

Associated Types

type MorphConstraint (TermMap h expr0) (TermMap h expr1) c Source #

data MorphWitness (TermMap h expr0) (TermMap h expr1) :: HyperType -> HyperType -> Type Source #

Methods

morphMap :: (forall (a :: HyperType) (b :: HyperType). MorphWitness (TermMap h expr0) (TermMap h expr1) a b -> (p # a) -> q # b) -> (TermMap h expr0 # p) -> TermMap h expr1 # q Source #

morphLiftConstraint :: forall c (a :: HyperType) (b :: HyperType) r. MorphConstraint (TermMap h expr0) (TermMap h expr1) c => MorphWitness (TermMap h expr0) (TermMap h expr1) a b -> Proxy c -> (c a b => r) -> r Source #

HMorph (ToNom nomId term0) (ToNom nomId term1) Source # 
Instance details

Defined in Hyper.Syntax.Nominal

Associated Types

type MorphConstraint (ToNom nomId term0) (ToNom nomId term1) c Source #

data MorphWitness (ToNom nomId term0) (ToNom nomId term1) :: HyperType -> HyperType -> Type Source #

Methods

morphMap :: (forall (a :: HyperType) (b :: HyperType). MorphWitness (ToNom nomId term0) (ToNom nomId term1) a b -> (p # a) -> q # b) -> (ToNom nomId term0 # p) -> ToNom nomId term1 # q Source #

morphLiftConstraint :: forall c (a :: HyperType) (b :: HyperType) r. MorphConstraint (ToNom nomId term0) (ToNom nomId term1) c => MorphWitness (ToNom nomId term0) (ToNom nomId term1) a b -> Proxy c -> (c a b => r) -> r Source #

HMorph (Var v expr0) (Var v expr1) Source # 
Instance details

Defined in Hyper.Syntax.Var

Associated Types

type MorphConstraint (Var v expr0) (Var v expr1) c Source #

data MorphWitness (Var v expr0) (Var v expr1) :: HyperType -> HyperType -> Type Source #

Methods

morphMap :: (forall (a :: HyperType) (b :: HyperType). MorphWitness (Var v expr0) (Var v expr1) a b -> (p # a) -> q # b) -> (Var v expr0 # p) -> Var v expr1 # q Source #

morphLiftConstraint :: forall c (a :: HyperType) (b :: HyperType) r. MorphConstraint (Var v expr0) (Var v expr1) c => MorphWitness (Var v expr0) (Var v expr1) a b -> Proxy c -> (c a b => r) -> r Source #

HMorph (RowExtend key val0 rest0) (RowExtend key val1 rest1) Source # 
Instance details

Defined in Hyper.Syntax.Row

Associated Types

type MorphConstraint (RowExtend key val0 rest0) (RowExtend key val1 rest1) c Source #

data MorphWitness (RowExtend key val0 rest0) (RowExtend key val1 rest1) :: HyperType -> HyperType -> Type Source #

Methods

morphMap :: (forall (a :: HyperType) (b :: HyperType). MorphWitness (RowExtend key val0 rest0) (RowExtend key val1 rest1) a b -> (p # a) -> q # b) -> (RowExtend key val0 rest0 # p) -> RowExtend key val1 rest1 # q Source #

morphLiftConstraint :: forall c (a :: HyperType) (b :: HyperType) r. MorphConstraint (RowExtend key val0 rest0) (RowExtend key val1 rest1) c => MorphWitness (RowExtend key val0 rest0) (RowExtend key val1 rest1) a b -> Proxy c -> (c a b => r) -> r Source #

HMorph (TypedLam var typ0 expr0) (TypedLam var typ1 expr1) Source # 
Instance details

Defined in Hyper.Syntax.TypedLam

Associated Types

type MorphConstraint (TypedLam var typ0 expr0) (TypedLam var typ1 expr1) c Source #

data MorphWitness (TypedLam var typ0 expr0) (TypedLam var typ1 expr1) :: HyperType -> HyperType -> Type Source #

Methods

morphMap :: (forall (a :: HyperType) (b :: HyperType). MorphWitness (TypedLam var typ0 expr0) (TypedLam var typ1 expr1) a b -> (p # a) -> q # b) -> (TypedLam var typ0 expr0 # p) -> TypedLam var typ1 expr1 # q Source #

morphLiftConstraint :: forall c (a :: HyperType) (b :: HyperType) r. MorphConstraint (TypedLam var typ0 expr0) (TypedLam var typ1 expr1) c => MorphWitness (TypedLam var typ0 expr0) (TypedLam var typ1 expr1) a b -> Proxy c -> (c a b => r) -> r Source #

morphTraverse :: (Applicative f, HMorph s t, HTraversable t) => (forall a b. MorphWitness s t a b -> (p # a) -> f (q # b)) -> (s # p) -> f (t # q) Source #

HTraversable extended with support of changing type parameters of the HyperType

(#?>) :: (HMorph s t, MorphConstraint s t c) => Proxy c -> (c a b => r) -> MorphWitness s t a b -> r Source #

class (i0 ~ t0, i1 ~ t1) => HIs2 (i0 :: HyperType) (i1 :: HyperType) t0 t1 Source #

Instances

Instances details
HIs2 a b a b Source # 
Instance details

Defined in Hyper.Class.Morph

morphMapped1 :: forall a b s t p q. HMorphWithConstraint s t (HIs2 a b) => Setter (s # p) (t # q) (p # a) (q # b) Source #

morphTraverse1 :: (HMorphWithConstraint s t (HIs2 a b), HTraversable t) => Traversal (s # p) (t # q) (p # a) (q # b) Source #