unison/unison-src/transcripts-using-base/fix3542.md
2024-04-14 20:20:36 -04:00

266 B

arrayList v n = do
  use ImmutableByteArray read8
  ma = Scope.bytearrayOf v n
  a = freeze! ma
  go acc i =
    acc' = [read8 a i] ++ acc
    if i == 0
    then acc'
    else go acc' (drop i 1)
  go [] (drop n 1)

> Scope.run '(catch (arrayList 7 8))