This project can be built with cabal or stack.
- cabal
cabal sandbox init
cabal install --only-dependencies
cabal build
cabal exec SEDEL-exe
- stack
stack build
stack exec SEDEL-exe
The REPL prompt is >:
- type
:qto quit - type
:loadto load a file - type
:?for usage
> :load examples/overview.sl
Typing result
: String
Evaluation result
=> "-2.0+3.0 = 1.0"
A program consists of list of declarations (separated by ;), ended with a main declaration.
Like Haskell, a line comment starts with -- and a comment block is wrapped by
{- and -}.
- Primitive type:
Int,Bool,Double, ``String - Top type/value:
() : Top - Type annotation:
2 : Int - Merge:
true ,, 3 - Intersection type:
Bool & (Int -> Int) - If:
if x == 0 then true else false - λ term:
(\x -> x+1) : Int -> Int - Λ term:
/\ (A * Int) . (\x -> x) : A -> A - Disjoint (universal) quantification:
forall (A*Int) . A -> A - Term declaration:
id A (x : A) = x - Type declaration:
type Person = {name : String, male : Bool}
See the examples/ directory, in particular, examples in Section 2 of the paper are inside examples/overview.sl. All examples can be tested:
stack test