Skip to content

Commit d3d8ed5

Browse files
committed
fix readme
1 parent 348a06d commit d3d8ed5

File tree

1 file changed

+26
-31
lines changed

1 file changed

+26
-31
lines changed

README.md

Lines changed: 26 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -6,36 +6,31 @@
66

77

88
### Functions for working with Pairs
9-
```
10-
use function Pairs\cons;
11-
use function Pairs\car;
12-
use function Pairs\cdr;
13-
use function Pairs\toString;
14-
```
9+
10+
use function Pairs\cons;
11+
use function Pairs\car;
12+
use function Pairs\cdr;
13+
use function Pairs\toString;
1514

1615
### Functions for working with Lists
17-
```
18-
use function Lists\length;
19-
use function Lists\reverse;
20-
use function Lists\map;
21-
use function Lists\filter;
22-
use function Lists\reduce;
23-
```
24-
### example
25-
\# 1
26-
```
27-
$pair = cons(1, 2);
28-
29-
$one = Pairs\car($pair); // $one = 1;
30-
$two = Pairs\cdr($pair) // $two = 2;
31-
```
32-
\# 2
33-
```
34-
$list = cons(1, cons(2, cons(3, cons(4, cons(5, cons(6, null))))));
35-
$length = length($list); // $length = 6;
36-
37-
$filter = filter(function ($x) {
38-
return $x % 2 == 0;
39-
}, $list);
40-
$result = toString($filter); \\ $result = "(2, 4, 6)";
41-
```
16+
17+
use function Lists\length;
18+
use function Lists\reverse;
19+
use function Lists\map;
20+
use function Lists\filter;
21+
use function Lists\reduce;
22+
23+
### Examples
24+
25+
$pair = cons(1, 2);
26+
27+
$one = Pairs\car($pair); // $one = 1;
28+
$two = Pairs\cdr($pair) // $two = 2;
29+
30+
$list = cons(1, cons(2, cons(3, cons(4, cons(5, cons(6, null))))));
31+
$length = length($list); // $length = 6;
32+
33+
$filter = filter(function ($x) {
34+
return $x % 2 == 0;
35+
}, $list);
36+
$result = toString($filter); \\ $result = "(2, 4, 6)";

0 commit comments

Comments
 (0)