hypertypes-0.2.2: Typed ASTs
Safe HaskellSafe-Inferred
LanguageHaskell2010

Hyper.Class.Functor

Description

A variant of Functor for HyperTypes

Synopsis

Documentation

class HNodes h => HFunctor h where Source #

A variant of Functor for HyperTypes

Minimal complete definition

Nothing

Methods

hmap :: (forall n. HWitness h n -> (p # n) -> q # n) -> (h # p) -> h # q Source #

HFunctor variant of fmap

Applied a given mapping for h's nodes (trees along witnesses that they are nodes of h) to result with a new tree, potentially with a different nest type.

default hmap :: (Generic1 h, HFunctor (Rep1 h), HWitnessType h ~ HWitnessType (Rep1 h)) => (forall n. HWitness h n -> (p # n) -> q # n) -> (h # p) -> h # q Source #

Instances

Instances details
HFunctor Prune Source # 
Instance details

Defined in Hyper.Type.Prune

Methods

hmap :: (forall (n :: HyperType). HWitness Prune n -> (p # n) -> q # n) -> (Prune # p) -> Prune # q Source #

HFunctor Pure Source # 
Instance details

Defined in Hyper.Type.Pure

Methods

hmap :: (forall (n :: HyperType). HWitness Pure n -> (p # n) -> q # n) -> (Pure # p) -> Pure # q Source #

HFunctor (ANode c) Source # 
Instance details

Defined in Hyper.Combinator.ANode

Methods

hmap :: (forall (n :: HyperType). HWitness (ANode c) n -> (p # n) -> q # n) -> (ANode c # p) -> ANode c # q Source #

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

Defined in Hyper.Combinator.Ann

Methods

hmap :: (forall (n :: HyperType). HWitness (Ann a) n -> (p # n) -> q # n) -> (Ann a # p) -> Ann a # q Source #

HFunctor (App expr) Source # 
Instance details

Defined in Hyper.Syntax.App

Methods

hmap :: (forall (n :: HyperType). HWitness (App expr) n -> (p # n) -> q # n) -> (App expr # p) -> App expr # q Source #

HFunctor (FuncType typ) Source # 
Instance details

Defined in Hyper.Syntax.FuncType

Methods

hmap :: (forall (n :: HyperType). HWitness (FuncType typ) n -> (p # n) -> q # n) -> (FuncType typ # p) -> FuncType typ # q Source #

(Recursively HFunctor typ, HFunctor (NomVarTypes typ)) => HFunctor (LoadedNominalDecl typ) Source # 
Instance details

Defined in Hyper.Syntax.Nominal

Methods

hmap :: (forall (n :: HyperType). HWitness (LoadedNominalDecl typ) n -> (p # n) -> q # n) -> (LoadedNominalDecl typ # p) -> LoadedNominalDecl typ # q Source #

HFunctor (NominalDecl typ) Source # 
Instance details

Defined in Hyper.Syntax.Nominal

Methods

hmap :: (forall (n :: HyperType). HWitness (NominalDecl typ) n -> (p # n) -> q # n) -> (NominalDecl typ # p) -> NominalDecl typ # q Source #

Functor f => HFunctor (F f) Source # 
Instance details

Defined in Hyper.Type.Functor

Methods

hmap :: (forall (n :: HyperType). HWitness (F f) n -> (p # n) -> q # n) -> (F f # p) -> F f # q Source #

HFunctor t => HFunctor (UnifyError t) Source # 
Instance details

Defined in Hyper.Unify.Error

Methods

hmap :: (forall (n :: HyperType). HWitness (UnifyError t) n -> (p # n) -> q # n) -> (UnifyError t # p) -> UnifyError t # q Source #

HFunctor v => HFunctor (GTerm v) Source # 
Instance details

Defined in Hyper.Unify.Generalize

Methods

hmap :: (forall (n :: HyperType). HWitness (GTerm v) n -> (p # n) -> q # n) -> (GTerm v # p) -> GTerm v # q Source #

HFunctor (Const a :: AHyperType -> Type) Source # 
Instance details

Defined in Hyper.Class.Functor

Methods

hmap :: (forall (n :: HyperType). HWitness (Const a) n -> (p # n) -> q # n) -> (Const a # p) -> Const a # q Source #

HFunctor h => HFunctor (Rec1 h) Source # 
Instance details

Defined in Hyper.Class.Functor

Methods

hmap :: (forall (n :: HyperType). HWitness (Rec1 h) n -> (p # n) -> q # n) -> (Rec1 h # p) -> Rec1 h # q Source #

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

Defined in Hyper.Combinator.Compose

Methods

hmap :: (forall (n :: HyperType). HWitness (HCompose a b) n -> (p # n) -> q # n) -> (HCompose a b # p) -> HCompose a b # q Source #

Recursively HFunctor h => HFunctor (HFlip Ann h) Source # 
Instance details

Defined in Hyper.Combinator.Ann

Methods

hmap :: (forall (n :: HyperType). HWitness (HFlip Ann h) n -> (p # n) -> q # n) -> (HFlip Ann h # p) -> HFlip Ann h # q Source #

HFunctor (InferOf e) => HFunctor (HFlip InferResult e) Source # 
Instance details

Defined in Hyper.Infer.Result

Methods

hmap :: (forall (n :: HyperType). HWitness (HFlip InferResult e) n -> (p # n) -> q # n) -> (HFlip InferResult e # p) -> HFlip InferResult e # q Source #

Recursively HFunctor ast => HFunctor (HFlip GTerm ast) Source # 
Instance details

Defined in Hyper.Unify.Generalize

Methods

hmap :: (forall (n :: HyperType). HWitness (HFlip GTerm ast) n -> (p # n) -> q # n) -> (HFlip GTerm ast # p) -> HFlip GTerm ast # q Source #

HFunctor (Lam v expr) Source # 
Instance details

Defined in Hyper.Syntax.Lam

Methods

hmap :: (forall (n :: HyperType). HWitness (Lam v expr) n -> (p # n) -> q # n) -> (Lam v expr # p) -> Lam v expr # q Source #

HFunctor (Let v expr) Source # 
Instance details

Defined in Hyper.Syntax.Let

Methods

hmap :: (forall (n :: HyperType). HWitness (Let v expr) n -> (p # n) -> q # n) -> (Let v expr # p) -> Let v expr # q Source #

HFunctor (TermMap h expr) Source # 
Instance details

Defined in Hyper.Syntax.Map

Methods

hmap :: (forall (n :: HyperType). HWitness (TermMap h expr) n -> (p # n) -> q # n) -> (TermMap h expr # p) -> TermMap h expr # q Source #

HFunctor (FromNom nomId term) Source # 
Instance details

Defined in Hyper.Syntax.Nominal

Methods

hmap :: (forall (n :: HyperType). HWitness (FromNom nomId term) n -> (p # n) -> q # n) -> (FromNom nomId term # p) -> FromNom nomId term # q Source #

HFunctor v => HFunctor (NominalInst n v) Source # 
Instance details

Defined in Hyper.Syntax.Nominal

Methods

hmap :: (forall (n0 :: HyperType). HWitness (NominalInst n v) n0 -> (p # n0) -> q # n0) -> (NominalInst n v # p) -> NominalInst n v # q Source #

HFunctor (ToNom nomId term) Source # 
Instance details

Defined in Hyper.Syntax.Nominal

Methods

hmap :: (forall (n :: HyperType). HWitness (ToNom nomId term) n -> (p # n) -> q # n) -> (ToNom nomId term # p) -> ToNom nomId term # q Source #

HFunctor (Scheme varTypes typ) Source # 
Instance details

Defined in Hyper.Syntax.Scheme

Methods

hmap :: (forall (n :: HyperType). HWitness (Scheme varTypes typ) n -> (p # n) -> q # n) -> (Scheme varTypes typ # p) -> Scheme varTypes typ # q Source #

HFunctor (TypeSig vars term) Source # 
Instance details

Defined in Hyper.Syntax.TypeSig

Methods

hmap :: (forall (n :: HyperType). HWitness (TypeSig vars term) n -> (p # n) -> q # n) -> (TypeSig vars term # p) -> TypeSig vars term # q Source #

HFunctor (Var v expr) Source # 
Instance details

Defined in Hyper.Syntax.Var

Methods

hmap :: (forall (n :: HyperType). HWitness (Var v expr) n -> (p # n) -> q # n) -> (Var v expr # p) -> Var v expr # q Source #

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

Defined in Hyper.Class.Functor

Methods

hmap :: (forall (n :: HyperType). HWitness (a :*: b) n -> (p # n) -> q # n) -> ((a :*: b) # p) -> (a :*: b) # q Source #

(HFunctor a, HFunctor b) => HFunctor (a :+: b) Source # 
Instance details

Defined in Hyper.Class.Functor

Methods

hmap :: (forall (n :: HyperType). HWitness (a :+: b) n -> (p # n) -> q # n) -> ((a :+: b) # p) -> (a :+: b) # q Source #

HFunctor (FlatRowExtends key val rest) Source # 
Instance details

Defined in Hyper.Syntax.Row

Methods

hmap :: (forall (n :: HyperType). HWitness (FlatRowExtends key val rest) n -> (p # n) -> q # n) -> (FlatRowExtends key val rest # p) -> FlatRowExtends key val rest # q Source #

HFunctor (RowExtend key val rest) Source # 
Instance details

Defined in Hyper.Syntax.Row

Methods

hmap :: (forall (n :: HyperType). HWitness (RowExtend key val rest) n -> (p # n) -> q # n) -> (RowExtend key val rest # p) -> RowExtend key val rest # q Source #

HFunctor (TypedLam var typ expr) Source # 
Instance details

Defined in Hyper.Syntax.TypedLam

Methods

hmap :: (forall (n :: HyperType). HWitness (TypedLam var typ expr) n -> (p # n) -> q # n) -> (TypedLam var typ expr # p) -> TypedLam var typ expr # q Source #

HFunctor h => HFunctor (M1 i m h) Source # 
Instance details

Defined in Hyper.Class.Functor

Methods

hmap :: (forall (n :: HyperType). HWitness (M1 i m h) n -> (p # n) -> q # n) -> (M1 i m h # p) -> M1 i m h # q Source #

hmapped1 :: forall h n p q. (HFunctor h, HNodesConstraint h ((~) n)) => Setter (h # p) (h # q) (p # n) (q # n) Source #

HFunctor variant of mapped for HyperTypes with a single node type.

Avoids using RankNTypes and thus can be composed with other optics.

hiso :: HFunctor h => (forall n. HWitness h n -> AnIso' (p # n) (q # n)) -> Iso' (h # p) (h # q) Source #

Define Isos for HFunctors

TODO: Is there an equivalent for this in lens that we can name this after?