hermit-0.5.0.0: Haskell Equational Reasoning Model-to-Implementation Tunnel

Safe HaskellNone
LanguageHaskell2010

HERMIT.Kure.SumTypes

Contents

Synopsis

Sum Types

data Core Source

Core is a sum type for use by KURE. Core = ModGuts + CoreProg + CoreBind + CoreDef + CoreExpr + CoreAlt

Constructors

GutsCore ModGuts

The module.

ProgCore CoreProg

A program (a telescope of top-level binding groups).

BindCore CoreBind

A binding group.

DefCore CoreDef

A recursive definition.

ExprCore CoreExpr

An expression.

AltCore CoreAlt

A case alternative.

data TyCo Source

TyCo is a sum type for use by KURE. TyCo = Type + Coercion

Constructors

TypeCore Type

A type.

CoercionCore Coercion

A coercion.

Instances

Equality

Syntactic Equality

coreSyntaxEq :: Core -> Core -> Bool Source

Syntactic equality of Core fragments.

tyCoSyntaxEq :: TyCo -> TyCo -> Bool Source

Syntactic equality of TyCo fragments.

coreTCSyntaxEq :: CoreTC -> CoreTC -> Bool Source

Syntactic equality of CoreTC fragments.

Alpha Equality

coreAlphaEq :: Core -> Core -> Bool Source

Alpha equality of Core fragments.

tyCoAlphaEq :: TyCo -> TyCo -> Bool Source

Alpha equality of TyCo fragments.

coreTCAlphaEq :: CoreTC -> CoreTC -> Bool Source

Alpha equality of CoreTC fragments.

Collecting Free Variables

freeVarsCore :: Core -> VarSet Source

Find all free variables in a Core node.

freeVarsTyCo :: TyCo -> VarSet Source

Find all free variables in a TyCo node.

freeVarsCoreTC :: CoreTC -> VarSet Source

Find all free variables in a CoreTC node.

Promotion Combinators

Transform Promotions

promoteModGutsT :: (Monad m, Injection ModGuts g) => Transform c m ModGuts b -> Transform c m g b Source

Promote a translate on ModGuts.

promoteProgT :: (Monad m, Injection CoreProg g) => Transform c m CoreProg b -> Transform c m g b Source

Promote a translate on CoreProg.

promoteBindT :: (Monad m, Injection CoreBind g) => Transform c m CoreBind b -> Transform c m g b Source

Promote a translate on CoreBind.

promoteDefT :: (Monad m, Injection CoreDef g) => Transform c m CoreDef b -> Transform c m g b Source

Promote a translate on CoreDef.

promoteExprT :: (Monad m, Injection CoreExpr g) => Transform c m CoreExpr b -> Transform c m g b Source

Promote a translate on CoreExpr.

promoteAltT :: (Monad m, Injection CoreAlt g) => Transform c m CoreAlt b -> Transform c m g b Source

Promote a translate on CoreAlt.

promoteTypeT :: (Monad m, Injection Type g) => Transform c m Type b -> Transform c m g b Source

Promote a translate on Type.

promoteCoercionT :: (Monad m, Injection Coercion g) => Transform c m Coercion b -> Transform c m g b Source

Promote a translate on Coercion.

Rewrite Promotions

promoteModGutsR :: (Monad m, Injection ModGuts g) => Rewrite c m ModGuts -> Rewrite c m g Source

Promote a rewrite on ModGuts.

promoteProgR :: (Monad m, Injection CoreProg g) => Rewrite c m CoreProg -> Rewrite c m g Source

Promote a rewrite on CoreProg.

promoteBindR :: (Monad m, Injection CoreBind g) => Rewrite c m CoreBind -> Rewrite c m g Source

Promote a rewrite on CoreBind.

promoteDefR :: (Monad m, Injection CoreDef g) => Rewrite c m CoreDef -> Rewrite c m g Source

Promote a rewrite on CoreDef.

promoteExprR :: (Monad m, Injection CoreExpr g) => Rewrite c m CoreExpr -> Rewrite c m g Source

Promote a rewrite on CoreExpr.

promoteAltR :: (Monad m, Injection CoreAlt g) => Rewrite c m CoreAlt -> Rewrite c m g Source

Promote a rewrite on CoreAlt.

promoteTypeR :: (Monad m, Injection Type g) => Rewrite c m Type -> Rewrite c m g Source

Promote a rewrite on Type.

promoteCoercionR :: (Monad m, Injection Coercion g) => Rewrite c m Coercion -> Rewrite c m g Source

Promote a rewrite on Coercion.

BiRewrite Promotions

promoteExprBiR :: (Monad m, Injection CoreExpr g) => BiRewrite c m CoreExpr -> BiRewrite c m g Source

Promote a bidirectional rewrite on CoreExpr.