Skip to content

Commit 8b58933

Browse files
committed
chore: formatting List.ark
1 parent 752d1dc commit 8b58933

File tree

1 file changed

+12
-16
lines changed

1 file changed

+12
-16
lines changed

List.ark

Lines changed: 12 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -114,8 +114,7 @@
114114
(mut _output [])
115115

116116
(while (< _index (len _L)) {
117-
(if (_f (@ _L _index))
118-
(append! _output (@ _L _index)))
117+
(if (_f (@ _L _index)) (append! _output (@ _L _index)))
119118
(set _index (+ 1 _index)) })
120119
_output }))
121120

@@ -169,9 +168,9 @@
169168
(while (< _index (len _L)) {
170169
(mut _sub (@ _L _index))
171170

172-
(if (= "List" (type _sub))
173-
(concat! _output _sub)
174-
(append! _output _sub))
171+
(if (= "List" (type _sub))
172+
(concat! _output _sub)
173+
(append! _output _sub))
175174
(set _index (+ 1 _index)) })
176175
_output }))
177176

@@ -191,9 +190,9 @@
191190
(while (< _index (len _L)) {
192191
(mut _res (_f (@ _L _index)))
193192

194-
(if (= "List" (type _res))
195-
(concat! _output _res)
196-
(append! _output _res))
193+
(if (= "List" (type _res))
194+
(concat! _output _res)
195+
(append! _output _res))
197196
(set _index (+ 1 _index)) })
198197
_output }))
199198

@@ -400,8 +399,7 @@
400399
# (print (iota 0 10)) # [0 1 2 3 4 5 6 7 8 9]
401400
# =end
402401
# @author https://github.com/SuperFola
403-
(let iota (fun (_init _length)
404-
(iterate _init (fun (x) (+ 1 x)) _length)))
402+
(let iota (fun (_init _length) (iterate _init (fun (x) (+ 1 x)) _length)))
405403

406404
# @brief Chunk a list in sub-lists of size n
407405
# @param _L list to chunk
@@ -420,13 +418,11 @@
420418
(mut _i 0)
421419
(while (< _i _source_len) {
422420
(append! _current (@ _L _i))
423-
(if (= (len _current) _length)
424-
{
425-
(append! _output _current)
426-
(set _current []) })
421+
(if (= (len _current) _length) {
422+
(append! _output _current)
423+
(set _current []) })
427424
(set _i (+ 1 _i)) })
428425

429-
(if (not (empty? _current))
430-
(append! _output _current))
426+
(if (not (empty? _current)) (append! _output _current))
431427

432428
_output }))

0 commit comments

Comments
 (0)