@effekt-lang/effekt 0.86.0 → 0.87.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/bin/effekt +0 -0
- package/libraries/common/array.effekt +9 -20
- package/libraries/common/buffer.effekt +1 -1
- package/libraries/common/bytearray.effekt +1 -1
- package/libraries/common/bytestream.effekt +10 -10
- package/libraries/common/dequeue.effekt +0 -8
- package/libraries/common/dictionary.effekt +3 -3
- package/libraries/common/effekt.effekt +5 -11
- package/libraries/common/exception.effekt +1 -1
- package/libraries/common/io/network.effekt +3 -3
- package/libraries/common/io/promise.effekt +1 -1
- package/libraries/common/json.effekt +3 -3
- package/libraries/common/list.effekt +1 -10
- package/libraries/common/map.effekt +5 -5
- package/libraries/common/option.effekt +0 -9
- package/libraries/common/queue.effekt +2 -2
- package/libraries/common/resizable_array.effekt +1 -1
- package/libraries/common/result.effekt +1 -1
- package/libraries/common/scanner.effekt +11 -11
- package/libraries/common/set.effekt +4 -4
- package/libraries/common/stream.effekt +13 -13
- package/libraries/common/string.effekt +4 -4
- package/licenses/mit license - mit-license.html +48 -89
- package/licenses/the bsd license - bsd-license.html +41 -88
- package/licenses/the mit license - mit.html +45 -92
- package/package.json +1 -1
|
@@ -39,7 +39,7 @@ def substring(str: String, from: Int): String =
|
|
|
39
39
|
|
|
40
40
|
/// Checks whether str starts with the given prefix at `from`
|
|
41
41
|
def isSubstringAt(str: String, prefix: String, from: Int): Bool = {
|
|
42
|
-
with default
|
|
42
|
+
with default { false };
|
|
43
43
|
|
|
44
44
|
val stringLength = str.length
|
|
45
45
|
val prefixLength = prefix.length
|
|
@@ -236,7 +236,7 @@ namespace internal {
|
|
|
236
236
|
"""
|
|
237
237
|
|
|
238
238
|
def utf8ByteLength(str: String): Int = stream::sum {
|
|
239
|
-
for {str.each} { (c
|
|
239
|
+
for {str.each} { (c) =>
|
|
240
240
|
do emit(c.utf8ByteCount)
|
|
241
241
|
}
|
|
242
242
|
}
|
|
@@ -323,7 +323,7 @@ def each(string: String): Unit / emit[Char] =
|
|
|
323
323
|
}
|
|
324
324
|
|
|
325
325
|
def collect(capacity: Int) { stream: () => Unit / emit[Char] }: String =
|
|
326
|
-
returning::collect
|
|
326
|
+
returning::collect(capacity){stream}.second
|
|
327
327
|
|
|
328
328
|
def collect { stream: () => Unit / emit[Char] }: String =
|
|
329
329
|
collect(4){stream}
|
|
@@ -331,7 +331,7 @@ def collect { stream: () => Unit / emit[Char] }: String =
|
|
|
331
331
|
namespace returning {
|
|
332
332
|
|
|
333
333
|
def collect[R](capacity: Int) { stream: () => R / emit[Char] }: (R, String) = {
|
|
334
|
-
val (result, bytes) = bytearray::returning::collect
|
|
334
|
+
val (result, bytes) = bytearray::returning::collect(capacity) { encodeUTF8 { stream } }
|
|
335
335
|
(result, bytes.toString)
|
|
336
336
|
}
|
|
337
337
|
|