hypertypes-0.2.2: Typed ASTs
Safe HaskellSafe-Inferred
LanguageHaskell2010

Hyper.Syntax.Lam

Synopsis

Documentation

data Lam v expr h Source #

A term for lambda abstractions.

Lam v exprs express lambda abstractions with vs as variable names and exprs for bodies.

Apart from the data type, an Infer instance is also provided.

Constructors

Lam 

Fields

Instances

Instances details
(Infer m t, UnifyGen m (TypeOf t), HSubset' (TypeOf t) (FuncType (TypeOf t)), HasInferredType t, LocalScopeType v (UVarOf m # TypeOf t) m) => Infer m (Lam v t) Source # 
Instance details

Defined in Hyper.Syntax.Lam

Methods

inferBody :: forall (h :: AHyperType -> Type). (Lam v t # InferChild m h) -> m (Lam v t # h, InferOf (Lam v t) # UVarOf m) Source #

inferContext :: proxy0 m -> proxy1 (Lam v t) -> Dict (HNodesConstraint (Lam v t) (Infer m), HNodesConstraint (InferOf (Lam v t)) (UnifyGen m)) Source #

(c (Lam v t), Recursively c t) => Recursively c (Lam v t) Source # 
Instance details

Defined in Hyper.Syntax.Lam

Methods

recursively :: proxy (c (Lam v t)) -> Dict (c (Lam v t), HNodesConstraint (Lam v t) (Recursively c)) Source #

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

Defined in Hyper.Syntax.Lam

Methods

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

HContext (Lam v expr) Source # 
Instance details

Defined in Hyper.Syntax.Lam

Methods

hcontext :: forall (p :: HyperType). (Lam v expr # p) -> Lam v expr # (HFunc p (Const (Lam v expr # p)) :*: p) Source #

HFoldable (Lam v expr) Source # 
Instance details

Defined in Hyper.Syntax.Lam

Methods

hfoldMap :: Monoid a => (forall (n :: HyperType). HWitness (Lam v expr) n -> (p # n) -> a) -> (Lam v expr # p) -> a 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 #

HNodes (Lam v expr) Source # 
Instance details

Defined in Hyper.Syntax.Lam

Associated Types

type HNodesConstraint (Lam v expr) c Source #

type HWitnessType (Lam v expr) :: HyperType -> Type Source #

Methods

hLiftConstraint :: forall c (n :: HyperType) r. HNodesConstraint (Lam v expr) c => HWitness (Lam v expr) n -> Proxy c -> (c n => r) -> r Source #

Monoid v => HPointed (Lam v expr) Source # 
Instance details

Defined in Hyper.Syntax.Lam

Methods

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

RNodes t => RNodes (Lam v t) Source # 
Instance details

Defined in Hyper.Syntax.Lam

RTraversable t => RTraversable (Lam v t) Source # 
Instance details

Defined in Hyper.Syntax.Lam

HTraversable (Lam v expr) Source # 
Instance details

Defined in Hyper.Syntax.Lam

Methods

hsequence :: forall f (p :: AHyperType -> Type). Applicative f => (Lam v expr # ContainedH f p) -> f (Lam v expr # p) Source #

Eq v => ZipMatch (Lam v expr) Source # 
Instance details

Defined in Hyper.Syntax.Lam

Methods

zipMatch :: forall (p :: HyperType) (q :: HyperType). (Lam v expr # p) -> (Lam v expr # q) -> Maybe (Lam v expr # (p :*: q)) 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 #

Generic (Lam v expr h) Source # 
Instance details

Defined in Hyper.Syntax.Lam

Associated Types

type Rep (Lam v expr h) :: Type -> Type #

Methods

from :: Lam v expr h -> Rep (Lam v expr h) x #

to :: Rep (Lam v expr h) x -> Lam v expr h #

Constraints (Lam v expr h) Show => Show (Lam v expr h) Source # 
Instance details

Defined in Hyper.Syntax.Lam

Methods

showsPrec :: Int -> Lam v expr h -> ShowS #

show :: Lam v expr h -> String #

showList :: [Lam v expr h] -> ShowS #

Constraints (Lam v expr h) Binary => Binary (Lam v expr h) Source # 
Instance details

Defined in Hyper.Syntax.Lam

Methods

put :: Lam v expr h -> Put #

get :: Get (Lam v expr h) #

putList :: [Lam v expr h] -> Put #

Constraints (Lam v expr h) NFData => NFData (Lam v expr h) Source # 
Instance details

Defined in Hyper.Syntax.Lam

Methods

rnf :: Lam v expr h -> () #

Constraints (Lam v expr h) Eq => Eq (Lam v expr h) Source # 
Instance details

Defined in Hyper.Syntax.Lam

Methods

(==) :: Lam v expr h -> Lam v expr h -> Bool #

(/=) :: Lam v expr h -> Lam v expr h -> Bool #

Constraints (Lam v expr h) Ord => Ord (Lam v expr h) Source # 
Instance details

Defined in Hyper.Syntax.Lam

Methods

compare :: Lam v expr h -> Lam v expr h -> Ordering #

(<) :: Lam v expr h -> Lam v expr h -> Bool #

(<=) :: Lam v expr h -> Lam v expr h -> Bool #

(>) :: Lam v expr h -> Lam v expr h -> Bool #

(>=) :: Lam v expr h -> Lam v expr h -> Bool #

max :: Lam v expr h -> Lam v expr h -> Lam v expr h #

min :: Lam v expr h -> Lam v expr h -> Lam v expr h #

Constraints (Lam v expr h) Pretty => Pretty (Lam v expr h) Source # 
Instance details

Defined in Hyper.Syntax.Lam

Methods

pPrintPrec :: PrettyLevel -> Rational -> Lam v expr h -> Doc #

pPrint :: Lam v expr h -> Doc #

pPrintList :: PrettyLevel -> [Lam v expr h] -> Doc #

type InferOf (Lam _1 t) Source # 
Instance details

Defined in Hyper.Syntax.Lam

type InferOf (Lam _1 t) = ANode (TypeOf t)
type HWitnessType (Lam v expr) Source # 
Instance details

Defined in Hyper.Syntax.Lam

type HWitnessType (Lam v expr) = W_Lam v expr
type HNodesConstraint (Lam v expr) constraint Source # 
Instance details

Defined in Hyper.Syntax.Lam

type HNodesConstraint (Lam v expr) constraint = constraint expr
data MorphWitness (Lam v expr0) (Lam v expr1) _ _1 Source # 
Instance details

Defined in Hyper.Syntax.Lam

data MorphWitness (Lam v expr0) (Lam v expr1) _ _1 where
type MorphConstraint (Lam v expr0) (Lam v expr1) constraint Source # 
Instance details

Defined in Hyper.Syntax.Lam

type MorphConstraint (Lam v expr0) (Lam v expr1) constraint = constraint expr0 expr1
type Rep (Lam v expr h) Source # 
Instance details

Defined in Hyper.Syntax.Lam

type Rep (Lam v expr h) = D1 ('MetaData "Lam" "Hyper.Syntax.Lam" "hypertypes-0.2.2-9g9pX7Hb2mGI4yyssTDpOd" 'False) (C1 ('MetaCons "Lam" 'PrefixI 'True) (S1 ('MetaSel ('Just "_lamIn") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 v) :*: S1 ('MetaSel ('Just "_lamOut") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (h :# expr))))

lamIn :: forall v expr h v. Lens (Lam v expr h) (Lam v expr h) v v Source #

lamOut :: forall v expr h expr h. Lens (Lam v expr h) (Lam v expr h) ((:#) h expr) ((:#) h expr) Source #

data W_Lam (v :: Type) (expr :: HyperType) node where Source #

Constructors

W_Lam_expr :: W_Lam v expr expr 

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

Instances

Instances details
data MorphWitness (ANode a) (ANode b) _ _1 Source # 
Instance details

Defined in Hyper.Combinator.ANode

data MorphWitness (ANode a) (ANode b) _ _1 where
data MorphWitness (App expr0) (App expr1) _ _1 Source # 
Instance details

Defined in Hyper.Syntax.App

data MorphWitness (App expr0) (App expr1) _ _1 where
data MorphWitness (FuncType typ0) (FuncType typ1) _ _1 Source # 
Instance details

Defined in Hyper.Syntax.FuncType

data MorphWitness (FuncType typ0) (FuncType typ1) _ _1 where
data MorphWitness (Lam v expr0) (Lam v expr1) _ _1 Source # 
Instance details

Defined in Hyper.Syntax.Lam

data MorphWitness (Lam v expr0) (Lam v expr1) _ _1 where
data MorphWitness (Let v expr0) (Let v expr1) _ _1 Source # 
Instance details

Defined in Hyper.Syntax.Let

data MorphWitness (Let v expr0) (Let v expr1) _ _1 where
data MorphWitness (TermMap h expr0) (TermMap h expr1) _ _1 Source # 
Instance details

Defined in Hyper.Syntax.Map

data MorphWitness (TermMap h expr0) (TermMap h expr1) _ _1 where
data MorphWitness (ToNom nomId term0) (ToNom nomId term1) _ _1 Source # 
Instance details

Defined in Hyper.Syntax.Nominal

data MorphWitness (ToNom nomId term0) (ToNom nomId term1) _ _1 where
data MorphWitness (Var v expr0) (Var v expr1) _ _1 Source # 
Instance details

Defined in Hyper.Syntax.Var

data MorphWitness (Var v expr0) (Var v expr1) _ _1
data MorphWitness (RowExtend key val0 rest0) (RowExtend key val1 rest1) _ _1 Source # 
Instance details

Defined in Hyper.Syntax.Row

data MorphWitness (RowExtend key val0 rest0) (RowExtend key val1 rest1) _ _1 where
data MorphWitness (TypedLam var typ0 expr0) (TypedLam var typ1 expr1) _ _1 Source # 
Instance details

Defined in Hyper.Syntax.TypedLam

data MorphWitness (TypedLam var typ0 expr0) (TypedLam var typ1 expr1) _ _1 where