user =
{ <User 1 "Egison_Lang">
<User 2 "__Egi">
...
}
follow =
{ <Follow 1 101 201>
...
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
% egison | |
Egison Version 3.2.12 (C) 2011-2014 Satoshi Egi | |
http://www.egison.org | |
Welcome to Egison Interpreter! | |
> (io (each print (take 10 (map itos primes)))) | |
2 | |
3 | |
5 | |
7 | |
11 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Last login: Mon May 12 19:57:49 on console | |
USER-no-iMac:~ user$ ruby --version | |
ruby 2.0.0p451 (2014-02-24 revision 45167) [universal.x86_64-darwin13] | |
USER-no-iMac:~ user$ sudo gem install egison | |
Password: | |
Fetching: egison-0.0.2.gem (100%) | |
Successfully installed egison-0.0.2 | |
Parsing documentation for egison-0.0.2 | |
Installing ri documentation for egison-0.0.2 | |
1 gem installed |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
> (match-all (between 1 100) (set integer) [<cons (& ?(lte? 32 $) ?(lt? $ 64) $x) _> x]) | |
{32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63} | |
> (car (match-all (between 1 100) (set integer) [<cons (& ?(lte? 32 $) ?(lt? $ 64) $x) _> x])) | |
32 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'egison' | |
require 'prime' | |
include Egison | |
twin_primes = match_stream(Prime) { | |
with(List.(*_, _x, __("x + 2"), *_)) { | |
[x, x + 2] | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(module $Main | |
{ | |
[String {string}] ; import only string | |
[$S [String {append concat}]] ; import only append and concat (with 'S.' as prefix) | |
[$S String] ; import all exported functions (with 'S.' as prefix) | |
} | |
{main} ; export main | |
) | |
(define $main |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
FROM phusion/baseimage:latest | |
MAINTAINER Satoshi Egi | |
RUN apt-get update | |
RUN apt-get -y install libncurses-dev | |
RUN apt-get -y install haskell-platform | |
RUN cabal update | |
RUN cabal install egison | |
ENV PATH /root/.cabal/bin:$PATH |