LAM-0.1.0.0
Safe HaskellSafe-Inferred
LanguageHaskell2010

LAM.Types.Generic

Description

Generic term type and functions.

Synopsis

Documentation

type Name = Text #

Variable names.

type family XVar a #

Type family for variable names.

Instances

Instances details
type XVar Trim0 # 
Instance details

Defined in LAM.Trim

type XVar Trim0 = Int
type XVar BV # 
Instance details

Defined in LAM.Types.BV

type XVar BV = Name
type XVar BVDB # 
Instance details

Defined in LAM.Types.BV

type XVar BVDB = Int
type XVar Base # 
Instance details

Defined in LAM.Types.Pure

type XVar Base = Name
type XVar DB # 
Instance details

Defined in LAM.Types.Pure

type XVar DB = Int

type family XLet a #

Type family for extra information at let bindings (usually trimmers).

Instances

Instances details
type XLet Trim0 # 
Instance details

Defined in LAM.Trim

type XLet BV # 
Instance details

Defined in LAM.Types.BV

type XLet BV = ()
type XLet BVDB # 
Instance details

Defined in LAM.Types.BV

type XLet BVDB = ()
type XLet Base # 
Instance details

Defined in LAM.Types.Pure

type XLet Base = ()
type XLet DB # 
Instance details

Defined in LAM.Types.Pure

type XLet DB = ()

type family XExt a #

Type family for extra constructors (like base values).

Instances

Instances details
type XExt Trim0 # 
Instance details

Defined in LAM.Trim

type XExt Trim0 = Void
type XExt BV # 
Instance details

Defined in LAM.Types.BV

type XExt BV = BVCtrs
type XExt BVDB # 
Instance details

Defined in LAM.Types.BV

type XExt Base # 
Instance details

Defined in LAM.Types.Pure

type XExt Base = Void
type XExt DB # 
Instance details

Defined in LAM.Types.Pure

type XExt DB = Void

data ETerm d #

Generic term datatype.

Constructors

Var (XVar d) 
Lam Name (ETerm d) 
App (ETerm d) (XVar d) 
XLet (XLet d) [(Name, ETerm d)] (ETerm d) 
Ext !(XExt d) 

Instances

Instances details
Show BVDBTerm # 
Instance details

Defined in LAM.Types.BV

Show BVTerm # 
Instance details

Defined in LAM.Types.BV

Show DBTerm # 
Instance details

Defined in LAM.Types.Pure

Show Term # 
Instance details

Defined in LAM.Types.Pure

Methods

showsPrec :: Int -> Term -> ShowS #

show :: Term -> String #

showList :: [Term] -> ShowS #

CanTrim DBTerm NamedList # 
Instance details

Defined in LAM.CanTrim

CanTrim DBTerm Seq # 
Instance details

Defined in LAM.Exec.DBNoTrimPure

CanTrim DBTerm Vector # 
Instance details

Defined in LAM.Exec.DBNoTrimPure

CanTrim DBTerm [] # 
Instance details

Defined in LAM.Exec.DBNoTrimPure

CanTrim Term NamedList # 
Instance details

Defined in LAM.CanTrim

CanTrim Term Trie # 
Instance details

Defined in LAM.CanTrim

Generic (ETerm d) # 
Instance details

Defined in LAM.Types.Generic

Methods

from :: ETerm d -> Rep (ETerm d) x #

to :: Rep (ETerm d) x -> ETerm d #

(Eq (XVar a), Eq (XLet a), Eq (XExt a)) => Eq (ETerm a) # 
Instance details

Defined in LAM.Types.Generic

Methods

(==) :: ETerm a -> ETerm a -> Bool #

(/=) :: ETerm a -> ETerm a -> Bool #

(Ord (XVar a), Ord (XLet a), Ord (XExt a)) => Ord (ETerm a) # 
Instance details

Defined in LAM.Types.Generic

Methods

compare :: ETerm a -> ETerm a -> Ordering #

(<) :: ETerm a -> ETerm a -> Bool #

(<=) :: ETerm a -> ETerm a -> Bool #

(>) :: ETerm a -> ETerm a -> Bool #

(>=) :: ETerm a -> ETerm a -> Bool #

max :: ETerm a -> ETerm a -> ETerm a #

min :: ETerm a -> ETerm a -> ETerm a #

ToPureState (State NamedList) NamedList # 
Instance details

Defined in LAM.Exec.DBNoTrimPure

ToPureState (State NamedList) Trie # 
Instance details

Defined in LAM.Exec.DBNoTrimPure

ToPureState (State Seq) NamedList # 
Instance details

Defined in LAM.Exec.DBNoTrimPure

ToPureState (State Seq) Trie # 
Instance details

Defined in LAM.Exec.DBNoTrimPure

ToPureState (State Vector) NamedList # 
Instance details

Defined in LAM.Exec.DBNoTrimPure

ToPureState (State Vector) Trie # 
Instance details

Defined in LAM.Exec.DBNoTrimPure

ToPureState (State []) NamedList # 
Instance details

Defined in LAM.Exec.DBNoTrimPure

ToPureState (State []) Trie # 
Instance details

Defined in LAM.Exec.DBNoTrimPure

Methods

toPureState :: State [] -> IO (PState Trie) #

IsNamedEnv t => ToPureState (PState t) t # 
Instance details

Defined in LAM.Pure

Methods

toPureState :: PState t -> IO (PState t) #

(IsNamedEnv t1, IsNamedEnv t2) => ToPureState (PState t1) t2 # 
Instance details

Defined in LAM.Pure

Methods

toPureState :: PState t1 -> IO (PState t2) #

Show (Closure DBTerm t) # 
Instance details

Defined in LAM.Pure

Show (Closure Term Trie) # 
Instance details

Defined in LAM.Pure

(Traversable t1, CanTrim Term t1, IsNamedEnv t1, IsNamedEnv t2) => ToPureState (RState IORef Term t1) t2 # 
Instance details

Defined in LAM.Pure

Methods

toPureState :: RState IORef Term t1 -> IO (PState t2) #

type Rep (ETerm d) # 
Instance details

Defined in LAM.Types.Generic

pattern Let :: XLet d ~ () => [(Name, ETerm d)] -> ETerm d -> ETerm d #

Without extra data on XLet, we can have a simplified pattern.

showTermWithCtx :: (XVar d ~ Name, XLet d ~ ()) => (XExt d -> String) -> (Name -> String) -> ETerm d -> String #

Show a term, with a special function to show free variables.

fromDBTermCtx :: (XVar d1 ~ Name, XVar d2 ~ Int, XLet d2 ~ (), XLet d1 ~ ()) => (XExt d2 -> XExt d1) -> [Name] -> ETerm d2 -> ETerm d1 #

Convert from DeBruijn to named representation in a context.

fromDBTerm :: (XVar d1 ~ Name, XVar d2 ~ Int, XLet d2 ~ (), XLet d1 ~ (), XExt d1 ~ XExt d2) => ETerm d2 -> ETerm d1 #

Convert from DeBruijn to named representation.

toDBTermCtx :: (XVar d1 ~ Name, XVar d2 ~ Int, XLet d2 ~ (), XLet d1 ~ ()) => (XExt d1 -> XExt d2) -> [Name] -> ETerm d1 -> ETerm d2 #

Convert from named to DeBruijn representation in a context.

toDBTerm :: (XVar d1 ~ Name, XVar d2 ~ Int, XLet d2 ~ (), XLet d1 ~ ()) => (XExt d1 -> XExt d2) -> ETerm d1 -> ETerm d2 #

Convert from named to DeBruijn representation.