Safe Haskell | None |
---|---|
Language | Haskell2010 |
An extension of HFunctor
for parameterized HyperType
s
Synopsis
- class HMorph s t where
- type MorphConstraint s t (c :: HyperType -> HyperType -> Constraint) :: Constraint
- data MorphWitness s t :: HyperType -> HyperType -> Type
- morphMap :: (forall a b. MorphWitness s t a b -> (p # a) -> q # b) -> (s # p) -> t # q
- morphLiftConstraint :: MorphConstraint s t c => MorphWitness s t a b -> Proxy c -> (c a b => r) -> r
- type HMorphWithConstraint s t c = (HMorph s t, MorphConstraint s t c)
- 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)
- (#?>) :: (HMorph s t, MorphConstraint s t c) => Proxy c -> (c a b => r) -> MorphWitness s t a b -> r
- class (i0 ~ t0, i1 ~ t1) => HIs2 (i0 :: HyperType) (i1 :: HyperType) t0 t1
- morphMapped1 :: forall a b s t p q. HMorphWithConstraint s t (HIs2 a b) => Setter (s # p) (t # q) (p # a) (q # b)
- morphTraverse1 :: (HMorphWithConstraint s t (HIs2 a b), HTraversable t) => Traversal (s # p) (t # q) (p # a) (q # b)
Documentation
class HMorph s t where Source #
A type-varying variant of HFunctor
which can modify type parameters of the mapped HyperType
type MorphConstraint s t (c :: HyperType -> HyperType -> Constraint) :: Constraint Source #
data MorphWitness s t :: HyperType -> HyperType -> Type Source #
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
HMorph (ANode a) (ANode b) Source # | |
Defined in Hyper.Combinator.ANode type MorphConstraint (ANode a) (ANode b) c Source # data MorphWitness (ANode a) (ANode b) :: HyperType -> HyperType -> Type Source # 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 (FuncType typ0) (FuncType typ1) Source # | |
Defined in Hyper.Type.AST.FuncType type MorphConstraint (FuncType typ0) (FuncType typ1) c Source # data MorphWitness (FuncType typ0) (FuncType typ1) :: HyperType -> HyperType -> Type Source # 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 (App expr0) (App expr1) Source # | |
Defined in Hyper.Type.AST.App type MorphConstraint (App expr0) (App expr1) c Source # data MorphWitness (App expr0) (App expr1) :: HyperType -> HyperType -> Type Source # 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 (TermMap h expr0) (TermMap h expr1) Source # | |
Defined in Hyper.Type.AST.Map type MorphConstraint (TermMap h expr0) (TermMap h expr1) c Source # data MorphWitness (TermMap h expr0) (TermMap h expr1) :: HyperType -> HyperType -> Type Source # 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 (Var v expr0) (Var v expr1) Source # | |
Defined in Hyper.Type.AST.Var type MorphConstraint (Var v expr0) (Var v expr1) c Source # data MorphWitness (Var v expr0) (Var v expr1) :: HyperType -> HyperType -> Type Source # 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 (ToNom nomId term0) (ToNom nomId term1) Source # | |
Defined in Hyper.Type.AST.Nominal type MorphConstraint (ToNom nomId term0) (ToNom nomId term1) c Source # data MorphWitness (ToNom nomId term0) (ToNom nomId term1) :: HyperType -> HyperType -> Type Source # 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 (Let v expr0) (Let v expr1) Source # | |
Defined in Hyper.Type.AST.Let type MorphConstraint (Let v expr0) (Let v expr1) c Source # data MorphWitness (Let v expr0) (Let v expr1) :: HyperType -> HyperType -> Type Source # 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 (Lam v expr0) (Lam v expr1) Source # | |
Defined in Hyper.Type.AST.Lam type MorphConstraint (Lam v expr0) (Lam v expr1) c Source # data MorphWitness (Lam v expr0) (Lam v expr1) :: HyperType -> HyperType -> Type Source # 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 (RowExtend key val0 rest0) (RowExtend key val1 rest1) Source # | |
Defined in Hyper.Type.AST.Row 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 # 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 # | |
Defined in Hyper.Type.AST.TypedLam 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 # 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 # |
type HMorphWithConstraint s t c = (HMorph s t, MorphConstraint s t c) 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
HIs2 a b a b Source # | |
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 #