Skip to content

Commit

Permalink
Merge pull request #778 from candy-lang/refactor-iterable
Browse files Browse the repository at this point in the history
Refactor iterable
  • Loading branch information
jwbot authored Jan 6, 2024
2 parents 43e93ad + c175754 commit 8885300
Show file tree
Hide file tree
Showing 14 changed files with 354 additions and 329 deletions.
6 changes: 2 additions & 4 deletions packages/Builtins/_.candy
Original file line number Diff line number Diff line change
Expand Up @@ -171,9 +171,7 @@ intBitLength value :=
# intBitLength -3 => 2
# ```
needs (value | typeIs Int)
needs
(value | ✨.intAdd 1 | ✨.intCompareTo 0 | ✨.equals Greater)
"Value must be non-negative"
needs (value | ✨.intAdd 1 | ✨.intCompareTo 0 | ✨.equals Greater) "Value must be non-negative"
✨.intBitLength value

intBitwiseAnd a b :=
Expand Down Expand Up @@ -552,7 +550,7 @@ textFromUtf8 bytes :=
# ```
needs (bytes | typeIs List)
## TODO: Add this when it runs faster.
## needs (bytes | iterable.fromList | iterable.all { byte ->
## needs (bytes | iterator.fromList | iterator.all { byte ->
## bool.lazyAnd (int.is byte) {
## bool.and (byte | int.isNonNegative) (byte | int.isLessThan 256)
## }
Expand Down
2 changes: 1 addition & 1 deletion packages/Core/_.candy
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ bool := use ".bool"
fixedDecimal := use ".fixedDecimal"
function := use ".function"
int := use ".int"
iterable := use ".iterable"
iterator := use ".iterator"
list := use ".list"
[panic] := use ".panic"
result := use ".result"
Expand Down
269 changes: 0 additions & 269 deletions packages/Core/iterable.candy

This file was deleted.

Loading

1 comment on commit 8885300

@jwbot
Copy link
Collaborator Author

@jwbot jwbot commented on 8885300 Jan 6, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Compiler

Benchmark suite Current: 8885300 Previous: 43e93ad Ratio
Time: Compiler/hello_world 21646011 ns/iter (± 377531) 18696214 ns/iter (± 663107) 1.16
Time: Compiler/fibonacci 176912587 ns/iter (± 1515200) 144743100 ns/iter (± 1008251) 1.22
Time: VM Runtime/hello_world 32405 ns/iter (± 3701) 32055 ns/iter (± 92728) 1.01

This comment was automatically generated by workflow using github-action-benchmark.

Please sign in to comment.