Create basic lambda term type
This commit is contained in:
parent
b17c5d9d3d
commit
fc0ede9499
3 changed files with 31 additions and 1 deletions
23
src/Props/Lambda.hs
Normal file
23
src/Props/Lambda.hs
Normal file
|
|
@ -0,0 +1,23 @@
|
|||
{-# LANGUAGE OverloadedStrings #-}
|
||||
|
||||
module Props.Lambda
|
||||
( Term(..)
|
||||
, displayTerm
|
||||
) where
|
||||
|
||||
import qualified Data.Set as Set
|
||||
import qualified Data.Text as T
|
||||
|
||||
type Name = T.Text
|
||||
type PreferredName = Maybe Name
|
||||
|
||||
-- | Lambda calculus term using De Bruijn indexing
|
||||
data Term a
|
||||
= Var PreferredName Int
|
||||
| Lambda PreferredName (Term a)
|
||||
| App (Term a) (Term a)
|
||||
| Native a
|
||||
deriving (Show)
|
||||
|
||||
displayTerm :: (Set.Set Name -> a -> T.Text) -> Term a -> T.Text
|
||||
displayTerm = undefined
|
||||
Loading…
Add table
Add a link
Reference in a new issue