@@ -3,10 +3,10 @@ import {Empty, Deep} from '.';
3
3
import { _EMPTY , cache , Split } from '../../0-core' ;
4
4
import { One } from '../../1-digit' ;
5
5
6
- export function Single ( M , element ) {
6
+ export function Single ( M , value ) {
7
7
this . M = M ;
8
- this . element = element ;
9
- this . v = M . measure ( element ) ;
8
+ this . a = value ;
9
+ this . v = M . measure ( value ) ;
10
10
}
11
11
12
12
Single . prototype = new Tree ( ) ;
@@ -20,11 +20,11 @@ Single.prototype.empty = function () {
20
20
} ;
21
21
22
22
Single . prototype . head = function ( ) {
23
- return this . element ;
23
+ return this . a ;
24
24
} ;
25
25
26
26
Single . prototype . last = function ( ) {
27
- return this . element ;
27
+ return this . a ;
28
28
} ;
29
29
30
30
Single . prototype . tail = function ( ) {
@@ -40,32 +40,32 @@ Single.prototype.cons = function (value) {
40
40
this . M ,
41
41
new One ( value ) ,
42
42
new Empty ( cache ( this . M ) ) ,
43
- new One ( this . element )
43
+ new One ( this . a )
44
44
) ;
45
45
} ;
46
46
47
47
Single . prototype . push = function ( value ) {
48
48
return new Deep (
49
49
this . M ,
50
- new One ( this . element ) ,
50
+ new One ( this . a ) ,
51
51
new Empty ( cache ( this . M ) ) ,
52
52
new One ( value )
53
53
) ;
54
54
} ;
55
55
56
56
Single . prototype . concat = function ( other ) {
57
- return other . cons ( this . element ) ;
57
+ return other . cons ( this . a ) ;
58
58
} ;
59
59
60
60
Single . prototype [ Symbol . iterator ] = function * ( ) {
61
- yield this . element ;
61
+ yield this . a ;
62
62
} ;
63
63
64
64
/**
65
65
* It is assumed that p(|this|) is true.
66
66
*/
67
67
Single . prototype . splitTree = function ( p , i ) {
68
- return new Split ( new Empty ( this . M ) , this . element , new Empty ( this . M ) ) ;
68
+ return new Split ( new Empty ( this . M ) , this . a , new Empty ( this . M ) ) ;
69
69
} ;
70
70
71
71
Single . prototype . split = function ( p ) {
0 commit comments