elsa-0.2.2.0: A tiny language for understanding the lambda-calculus
Safe HaskellSafe-Inferred
LanguageHaskell2010

Language.Elsa.Types

Synopsis

Documentation

type Id = String Source #

type SElsa = Elsa SourceSpan Source #

type SDefn = Defn SourceSpan Source #

type SExpr = Expr SourceSpan Source #

type SEval = Eval SourceSpan Source #

type SStep = Step SourceSpan Source #

type SBind = Bind SourceSpan Source #

type SEqn = Eqn SourceSpan Source #

type SResult = Result SourceSpan Source #

data Result a Source #

Result

Constructors

OK (Bind a) 
Partial (Bind a) a 
Invalid (Bind a) a 
Unbound (Bind a) Id a 
DupDefn (Bind a) a 
DupEval (Bind a) a 

Instances

Instances details
Functor Result Source # 
Instance details

Defined in Language.Elsa.Types

Methods

fmap :: (a -> b) -> Result a -> Result b #

(<$) :: a -> Result b -> Result a #

Show a => Show (Result a) Source # 
Instance details

Defined in Language.Elsa.Types

Methods

showsPrec :: Int -> Result a -> ShowS #

show :: Result a -> String #

showList :: [Result a] -> ShowS #

Eq a => Eq (Result a) Source # 
Instance details

Defined in Language.Elsa.Types

Methods

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

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

failures :: [Result a] -> [Id] Source #

successes :: [Result a] -> [Id] Source #

resultError :: Located a => Result a -> Maybe UserError Source #

mkErr :: Located a => a -> Text -> Maybe UserError Source #

data Elsa a Source #

Programs

Constructors

Elsa 

Fields

Instances

Instances details
Show a => Show (Elsa a) Source # 
Instance details

Defined in Language.Elsa.Types

Methods

showsPrec :: Int -> Elsa a -> ShowS #

show :: Elsa a -> String #

showList :: [Elsa a] -> ShowS #

Eq a => Eq (Elsa a) Source # 
Instance details

Defined in Language.Elsa.Types

Methods

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

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

data Defn a Source #

Constructors

Defn !(Bind a) !(Expr a) 

Instances

Instances details
Show a => Show (Defn a) Source # 
Instance details

Defined in Language.Elsa.Types

Methods

showsPrec :: Int -> Defn a -> ShowS #

show :: Defn a -> String #

showList :: [Defn a] -> ShowS #

Eq (Defn a) Source # 
Instance details

Defined in Language.Elsa.Types

Methods

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

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

data Eval a Source #

Constructors

Eval 

Fields

Instances

Instances details
Show a => Show (Eval a) Source # 
Instance details

Defined in Language.Elsa.Types

Methods

showsPrec :: Int -> Eval a -> ShowS #

show :: Eval a -> String #

showList :: [Eval a] -> ShowS #

Eq a => Eq (Eval a) Source # 
Instance details

Defined in Language.Elsa.Types

Methods

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

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

data Step a Source #

Constructors

Step !(Eqn a) !(Expr a) 

Instances

Instances details
Show a => Show (Step a) Source # 
Instance details

Defined in Language.Elsa.Types

Methods

showsPrec :: Int -> Step a -> ShowS #

show :: Step a -> String #

showList :: [Step a] -> ShowS #

Eq a => Eq (Step a) Source # 
Instance details

Defined in Language.Elsa.Types

Methods

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

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

data Eqn a Source #

Constructors

AlphEq a 
BetaEq a 
UnBeta a 
DefnEq a 
TrnsEq a 
UnTrEq a 
NormEq a 

Instances

Instances details
Tagged Eqn Source # 
Instance details

Defined in Language.Elsa.Types

Methods

tag :: Eqn a -> a Source #

Show a => Show (Eqn a) Source # 
Instance details

Defined in Language.Elsa.Types

Methods

showsPrec :: Int -> Eqn a -> ShowS #

show :: Eqn a -> String #

showList :: [Eqn a] -> ShowS #

Eq a => Eq (Eqn a) Source # 
Instance details

Defined in Language.Elsa.Types

Methods

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

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

data Bind a Source #

Constructors

Bind Id a 

Instances

Instances details
Functor Bind Source # 
Instance details

Defined in Language.Elsa.Types

Methods

fmap :: (a -> b) -> Bind a -> Bind b #

(<$) :: a -> Bind b -> Bind a #

Tagged Bind Source # 
Instance details

Defined in Language.Elsa.Types

Methods

tag :: Bind a -> a Source #

Show a => Show (Bind a) Source # 
Instance details

Defined in Language.Elsa.Types

Methods

showsPrec :: Int -> Bind a -> ShowS #

show :: Bind a -> String #

showList :: [Bind a] -> ShowS #

Eq (Bind a) Source # 
Instance details

Defined in Language.Elsa.Types

Methods

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

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

data Expr a Source #

Constructors

EVar Id a 
ELam !(Bind a) !(Expr a) a 
EApp !(Expr a) !(Expr a) a 

Instances

Instances details
Tagged Expr Source # 
Instance details

Defined in Language.Elsa.Types

Methods

tag :: Expr a -> a Source #

Show (Expr a) Source # 
Instance details

Defined in Language.Elsa.Types

Methods

showsPrec :: Int -> Expr a -> ShowS #

show :: Expr a -> String #

showList :: [Expr a] -> ShowS #

Eq (Expr a) Source # 
Instance details

Defined in Language.Elsa.Types

Methods

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

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

Hashable (Expr a) Source # 
Instance details

Defined in Language.Elsa.Types

Methods

hashWithSalt :: Int -> Expr a -> Int #

hash :: Expr a -> Int #

data RExpr Source #

Constructors

RVar Id 
RLam Id RExpr 
RApp RExpr RExpr 

Instances

Instances details
Generic RExpr Source # 
Instance details

Defined in Language.Elsa.Types

Associated Types

type Rep RExpr :: Type -> Type #

Methods

from :: RExpr -> Rep RExpr x #

to :: Rep RExpr x -> RExpr #

Eq RExpr Source # 
Instance details

Defined in Language.Elsa.Types

Methods

(==) :: RExpr -> RExpr -> Bool #

(/=) :: RExpr -> RExpr -> Bool #

Hashable RExpr Source # 
Instance details

Defined in Language.Elsa.Types

Methods

hashWithSalt :: Int -> RExpr -> Int #

hash :: RExpr -> Int #

type Rep RExpr Source # 
Instance details

Defined in Language.Elsa.Types

bkLam :: Expr a -> ([Bind a], Expr a) Source #

mkLam :: Monoid a => [Bind a] -> Expr a -> Expr a Source #

class Tagged t where Source #

Tag Extraction

Methods

tag :: t a -> a Source #

Instances

Instances details
Tagged Bind Source # 
Instance details

Defined in Language.Elsa.Types

Methods

tag :: Bind a -> a Source #

Tagged Eqn Source # 
Instance details

Defined in Language.Elsa.Types

Methods

tag :: Eqn a -> a Source #

Tagged Expr Source # 
Instance details

Defined in Language.Elsa.Types

Methods

tag :: Expr a -> a Source #