How to install Egison (Homebrew)
Mac users can install Egison with Homebrew by the following simple commands!
$ brew update $ brew tap egison/egison $ brew install egison
How to install Egison (Haskell Platform)
1. Install Haskell Platform
You can download an installer from here.
2. Install Egison via Hackage
After you installed Haskell Platform, perform the following commands in Command Prompt.
% cabal update % cabal install egison egison-tutorial ... Installing executable(s) in /home/xxx/.cabal/bin Registering egison-X.X.X...
egison-tutorial commands are installed in
~/.cabal/bin/ by the above the package.
So please add the following lines to your
PATH=:$HOME/.cabal/bin:$PATH export PATH
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]])) ==================== >