Skip to content

Commit dd5eb87

Browse files
GearsDatapackslpil
authored andcommitted
Tweak prelude API
1 parent 8f49543 commit dd5eb87

File tree

1 file changed

+2
-31
lines changed

1 file changed

+2
-31
lines changed

compiler-core/templates/prelude.mjs

Lines changed: 2 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,6 @@ export class CustomType {
1010
}
1111
}
1212

13-
export function isCustomType(value) {
14-
return value instanceof CustomType;
15-
}
16-
1713
export class List {
1814
static fromArray(array, tail) {
1915
let t = tail || new Empty();
@@ -57,14 +53,6 @@ export class List {
5753
}
5854
}
5955

60-
export function isList(value) {
61-
return value instanceof List;
62-
}
63-
64-
export function listToArray(list) {
65-
return list.toArray();
66-
}
67-
6856
// @internal
6957
export function prepend(element, tail) {
7058
return new NonEmpty(element, tail);
@@ -119,10 +107,10 @@ export function List$isNonEmpty(value) {
119107
return value instanceof NonEmpty;
120108
}
121109

122-
export function List$NonEmpty$head(value) {
110+
export function List$NonEmpty$first(value) {
123111
return value.head;
124112
}
125-
export function List$NonEmpty$tail(value) {
113+
export function List$NonEmpty$rest(value) {
126114
return value.tail;
127115
}
128116

@@ -349,19 +337,6 @@ export function BitArray$isBitArray(value) {
349337
return value instanceof BitArray;
350338
}
351339

352-
export function BitArray$BitArray$bitSize(value) {
353-
return value.bitSize;
354-
}
355-
export function BitArray$BitArray$byteSize(value) {
356-
return value.byteSize;
357-
}
358-
export function BitArray$BitArray$bitOffset(value) {
359-
return value.bitOffset;
360-
}
361-
export function BitArray$BitArray$rawBuffer(value) {
362-
return value.rawBuffer;
363-
}
364-
365340
/**
366341
* Returns the nth byte in the given buffer, after applying the specified bit
367342
* offset. If the index is out of bounds then zero is returned.
@@ -1510,10 +1485,6 @@ export class Result extends CustomType {
15101485
}
15111486
}
15121487

1513-
export function isResult(value) {
1514-
return value instanceof Result;
1515-
}
1516-
15171488
export class Ok extends Result {
15181489
constructor(value) {
15191490
super();

0 commit comments

Comments
 (0)