8000 GitHub - nahiluhmot/SKI: An SKI Combinator Calculus Interpreter · GitHub
[go: up one dir, main page]

Skip to content
nahiluhmotPublic

About

An SKI Combinator Calculus Interpreter

Resources

Stars

5 stars

Watchers

1 watching

Forks

Latest commit

 

History

5 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 

Repository files navigation

SKI Combinator Calculus is a system with three operations which do the
following:
    s f g x = g x (f x)
    k x y = x
    i x = x
The only valid syntax of this lanugage is composed of those functions, (), and
literals (strings of many letters prefaced by a quote). Examples:
    > (i k)
    => k
    > (k 'a 'b)
    => 'a
    > (s i i 'a)
    => ('a 'a)
When not enough arguments are supplied to one of these functions, the arguments
are evaluated and then return as an argument to the base function. Examples:
    > (k (i 'a))
    => (k 'a)
    > (i)
    => i
    > (s i k (i k))
    => (k (k k))
When too many arguments are given, the function is applied to the number that it
takes, then the resulting function evalates the remainder of the arguments.
Examples:
    > (i k 'x 'y)
    => 'x
    > (k i s s)
    => s
    > (i k (s i k k))
    => (k (k (k k)))
To use the interactive interpreter, just call `runhaskell SKI.hs`. To run a
file, supply the file at the end (`runhaskell SKI.hs test.ski`).
Enjoy!

About

An SKI Combinator Calculus Interpreter

Resources

Stars

5 stars

Watchers

1 watching

Forks

Releases

Packages

Contributors

Languages

0