mirror of
https://github.com/roc-lang/roc.git
synced 2025-10-03 08:34:33 +00:00

Figuring out what this module was doing, and why, took me a bit less than half an hour. We should document what's happening for others in the future so they don't need to follow up on Zulip necessarily.
61 lines
3.1 KiB
Text
61 lines
3.1 KiB
Text
procedure List.3 (#Attr.2, #Attr.3):
|
|
let Test.37 : Builtin(Int(U64)) = lowlevel ListLen #Attr.2;
|
|
let Test.34 : Builtin(Bool) = lowlevel NumLt #Attr.3 Test.37;
|
|
if Test.34 then
|
|
let Test.36 : Builtin(Int(I64)) = lowlevel ListGetUnsafe #Attr.2 #Attr.3;
|
|
let Test.35 : Union(NonRecursive([[Struct([])], [Builtin(Int(I64))]])) = Ok Test.36;
|
|
ret Test.35;
|
|
else
|
|
let Test.33 : Struct([]) = Struct {};
|
|
let Test.32 : Union(NonRecursive([[Struct([])], [Builtin(Int(I64))]])) = Err Test.33;
|
|
ret Test.32;
|
|
|
|
procedure List.4 (#Attr.2, #Attr.3, #Attr.4):
|
|
let Test.15 : Builtin(Int(U64)) = lowlevel ListLen #Attr.2;
|
|
let Test.13 : Builtin(Bool) = lowlevel NumLt #Attr.3 Test.15;
|
|
if Test.13 then
|
|
let Test.14 : Builtin(List(Builtin(Int(I64)))) = lowlevel ListSet #Attr.2 #Attr.3 #Attr.4;
|
|
ret Test.14;
|
|
else
|
|
ret #Attr.2;
|
|
|
|
procedure Test.1 (Test.2):
|
|
let Test.38 : Builtin(Int(U64)) = 0i64;
|
|
let Test.30 : Union(NonRecursive([[Struct([])], [Builtin(Int(I64))]])) = CallByName List.3 Test.2 Test.38;
|
|
let Test.31 : Builtin(Int(U64)) = 0i64;
|
|
let Test.29 : Union(NonRecursive([[Struct([])], [Builtin(Int(I64))]])) = CallByName List.3 Test.2 Test.31;
|
|
let Test.8 : Struct([Union(NonRecursive([[Struct([])], [Builtin(Int(I64))]])), Union(NonRecursive([[Struct([])], [Builtin(Int(I64))]]))]) = Struct {Test.29, Test.30};
|
|
joinpoint Test.26:
|
|
let Test.17 : Builtin(List(Builtin(Int(I64)))) = Array [];
|
|
ret Test.17;
|
|
in
|
|
let Test.23 : Union(NonRecursive([[Struct([])], [Builtin(Int(I64))]])) = StructAtIndex 1 Test.8;
|
|
let Test.24 : Builtin(Int(U8)) = 1i64;
|
|
let Test.25 : Builtin(Int(U8)) = GetTagId Test.23;
|
|
let Test.28 : Builtin(Bool) = lowlevel Eq Test.24 Test.25;
|
|
if Test.28 then
|
|
let Test.20 : Union(NonRecursive([[Struct([])], [Builtin(Int(I64))]])) = StructAtIndex 0 Test.8;
|
|
let Test.21 : Builtin(Int(U8)) = 1i64;
|
|
let Test.22 : Builtin(Int(U8)) = GetTagId Test.20;
|
|
let Test.27 : Builtin(Bool) = lowlevel Eq Test.21 Test.22;
|
|
if Test.27 then
|
|
let Test.19 : Union(NonRecursive([[Struct([])], [Builtin(Int(I64))]])) = StructAtIndex 0 Test.8;
|
|
let Test.4 : Builtin(Int(I64)) = UnionAtIndex (Id 1) (Index 0) Test.19;
|
|
let Test.18 : Union(NonRecursive([[Struct([])], [Builtin(Int(I64))]])) = StructAtIndex 1 Test.8;
|
|
let Test.5 : Builtin(Int(I64)) = UnionAtIndex (Id 1) (Index 0) Test.18;
|
|
let Test.16 : Builtin(Int(U64)) = 0i64;
|
|
let Test.10 : Builtin(List(Builtin(Int(I64)))) = CallByName List.4 Test.2 Test.16 Test.5;
|
|
let Test.11 : Builtin(Int(U64)) = 0i64;
|
|
let Test.9 : Builtin(List(Builtin(Int(I64)))) = CallByName List.4 Test.10 Test.11 Test.4;
|
|
ret Test.9;
|
|
else
|
|
dec Test.2;
|
|
jump Test.26;
|
|
else
|
|
dec Test.2;
|
|
jump Test.26;
|
|
|
|
procedure Test.0 ():
|
|
let Test.7 : Builtin(List(Builtin(Int(I64)))) = Array [1i64, 2i64];
|
|
let Test.6 : Builtin(List(Builtin(Int(I64)))) = CallByName Test.1 Test.7;
|
|
ret Test.6;
|