How to install Egison
1. Install Haskell Platform
If you are using Linux that has
apt-get command, execute the following commands.
% sudo apt-get update % sudo apt-get install haskell-platform libncurses-dev
2. Install Egison via Hackage
After you installed Haskell Platform, perform the following commands in the terminal.
% cabal update % cabal install egison egison-tutorial ... Installing executable(s) in /home/xxx/.cabal/bin Registering egison-X.X.X...
3. Set PATH for your shell
If successfully installed, there will be an output where the binary file is generated as above.
Please add new path to
$PATH variable of your shell, to make your shell be able to find
For example, if you are using bash, you will execute commands as follows.
% echo "PATH=\$PATH:/home/xxx/.cabal/bin" >> ~/.bashrc % source ~/.bashrc
How to start Egison
Now, you can run Egison interpreter with the
Type Control-D to terminate the interpreter.
% egison Egison Version X.X.X (C) 2011-2014 Satoshi Egi http://www.egison.org Welcome to Egison Interpreter! > ^D Leaving Egison Interpreter.
You can run the
egison-tutorial command, too.
Type Control-D to terminate the tutorial.
This is a tutorial command for beginner. Please try it first!
% egison-tutorial Egison Tutorial for Version X.X.X (C) 2013-2014 Satoshi Egi http://www.egison.org Welcome to Egison Tutorial! ============================== List of sections in the tutorial 1: Calculate numbers 2: Basics of functional programming 3: Define your own functions 4: Basic of pattern-matching 5: Pattern-matching against infinite collections 6: Writing scripts in Egison ============================== Choose a section to learn. (1-6): 5 ==================== We can write a pattern-matching against infinite lists even if that has infinite results. Note that Egison really enumerate all pairs of two natural numbers in the following example. Examples: (take 10 (match-all nats (set integer) [
> [m n]])) ==================== >