Egison のインストール方法(Homebrew)

Homebrew をつかって簡単にインストールできます。 以下のような、シンプルなコマンドをうつだけでEgisonをインストールできるようになっています。

$ brew update
$ brew tap egison/egison
$ brew install egison egison-tutorial

Egison のインストール方法(Haskell Platform)

Haskellの処理系GHCをつかって手元のコンピューターでコンパイルしてインストールすることも可能です。

1. Haskell Platform をインストール

Egison をインストールするには Haskell Platform を先にインストールする必要があります。 その理由は Hackage という Haskell のパッケージシステムを用いて Egison が配布されているためです。

Haskell Platform のインストーラーはここからダウンロードできます。

2. Hackage から Egison をインストール

Haskell Platform をインストールしたら、ターミナルから以下のコマンドで Egison をインストールできます。

% cabal update
% cabal install egison egison-tutorial
...
Installing executable(s) in /home/xxx/.cabal/bin
Registering egison-X.X.X...

このコマンドにより、egisonegison-tutorial コマンドが ~/.cabal/bin 以下にインストールされます。
ですので、以下のような行を .bashrc.zshenv に書き加えてください。

PATH=:$HOME/.cabal/bin:$PATH
export PATH

Egison の始め方

インストールに成功すると、egison コマンドで Egison のインタプリタを起動できるようになります。 インタプリタを止めるには Control-D を押してください。

% egison
Egison Version X.X.X (C) 2011-2014 Satoshi Egi
http://www.egison.org
Welcome to Egison Interpreter!
> ^D
Leaving Egison Interpreter.

egison-tutorial コマンドも使えるようになります。 チュートリアルを止めるには Control-D を押してください。
このチュートリアルは Egison に初めて触れるひとのためのチュートリアルです。 ぜひ最初に試してみてください。

% 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]]))
====================
>

次に見てほしいもの...

オンライン・チュートリアル オンライン・デモンストレーション » トップに戻る