-
Notifications
You must be signed in to change notification settings - Fork 35
Add helper functions from students #840
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
libraries/common/list.effekt
Outdated
/// Check if the list contains the given `element`, | ||
/// comparing for equality with the given `eq` function. | ||
/// | ||
/// O(N) | ||
def contains[A](list: List[A], element: A) { eq: (A, A) => Bool }: Bool = | ||
list.any { x => eq(x, element) } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should always be able to inline this... right?
/// Fold and map a list with a delimiter, a prefix, a suffix, | ||
/// concatenating the result given the `combine` function. | ||
/// | ||
/// Example: | ||
/// ``` | ||
/// > [1, 2, 3].foldMapDelimited("[", ", ", "]") { n => show(n) } { (s1, s2) => s1 ++ s2 } | ||
/// "[1, 2, 3]" | ||
/// ``` | ||
/// | ||
/// O(N) | ||
def foldMapDelimited[A, B](list: List[A], prefix: B, delimiter: B, suffix: B) { convert: A => B } { combine: (B, B) => B }: B = { | ||
def go(acc: B, as: List[A]): B = as match { | ||
case Nil() => acc | ||
case Cons(head, Nil()) => combine(acc, convert(head)) | ||
case Cons(head, tail) => | ||
val res = combine(combine(acc, convert(head)), delimiter) | ||
go(res, tail) | ||
} | ||
combine(go(prefix, list), suffix) | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I can't use acc.combine(...)
here (cc @b-studios)
I thought I already reported this, but I can't find the issue 😓.

EDIT: ~> #709.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
By the way, feel free to bikeshed the name of this function -- I don't really know what to call it, but it's pretty useful for simple custom list pretty-printing.
The CI is acting up (direct link):
EDIT: I'll cancel the workflow and restart it in a sec. |
Blocked on JVM OOM in CI ↑ Looks like
~> #858 |
def map[A, B](l: List[A]) { f: A => B }: List[B] = { | ||
var acc: List[B] = Nil() | ||
l.foreach { el => | ||
acc = Cons(f(el), acc) | ||
} | ||
acc.reverse | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is exactly foldRight(Nil()) { (x, acc) => Cons(f(x), acc) }
, no?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Agreed, but I think our focus is on showing more "imperative" versions :)
Note that I haven't changed the style map
is written in -- that's the same as it always was.
(And the version with a mutable variable was quicker last time I checked!)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I noted that, but I have never checked the implementation before. I don't find "this is the same it has always been" a very compelling argument, though.
/// Map a function `f` over elements and their indices in a given list. | ||
/// | ||
/// O(N) | ||
def mapWithIndex[A, B](l: List[A]) { f: (Int, A) => B }: List[B] = { | ||
var acc: List[B] = Nil() | ||
l.foreachIndex { (i, el) => | ||
acc = Cons(f(i, el), acc) | ||
} | ||
acc.reverse | ||
} | ||
|
||
/// Map a function `f` over elements in a given list, | ||
/// keeping only the elements for which the function returned `true`, | ||
/// discarding the elements for which the function returned `false`. | ||
/// | ||
/// O(N) | ||
def filter[A](l: List[A]) { shouldKeep: A => Bool }: List[A] = { | ||
var acc: List[A] = Nil() | ||
l.foreach { a => | ||
if (shouldKeep(a)) { | ||
acc = Cons(a, acc) | ||
} | ||
} | ||
acc.reverse | ||
} | ||
|
||
/// Map a function `f` over elements and their indices in a given list, | ||
/// keeping only the elements for which the function returned `true`, | ||
/// discarding the elements for which the function returned `false`. | ||
/// | ||
/// O(N) | ||
def filterWithIndex[A](l: List[A]) { shouldKeep: (Int, A) => Bool }: List[A] = { | ||
var acc: List[A] = Nil() | ||
l.foreachIndex { (i, a) => | ||
if (shouldKeep(i, a)) { | ||
acc = Cons(a, acc) | ||
} | ||
} | ||
acc.reverse | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same for these. This can all be expressed in terms of foldRight
I think. Though, I think this is a matter of preference and not too important.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
dtto above
I don't care about the style here (functional v imperative) too much, I'm mostly mirroring the existing code.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I disagree that this is about functional vs imperative. For me, this is about duplication of existing code and DRY. But if you agree that this is fine here, I respect that.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For me, this is about duplication of existing code and DRY.
I'd like the code to be DRYer as well, yes, but last I've tried to define everything through, let's say, collect
, the inliner couldn't keep up in a bigger app (if a map
is defined via collect
, then I'd want it to desugar to a foreach[Index]
in JS every single time).
There are already ensions about the stdlib being very slow and bloated, I'd hate to make the problem worse when adding a few functions used by the students.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry to chime into the bike shed, but for me this is indeed a functional vs imperative debate.
And I must say, I always have problems reading foldX code (I can never remember the order of traversal) and strictly prefer the imperative loop.
a671ec4
to
12b01df
Compare
09ebdec
to
bc16714
Compare
The OOM ( #858 ) is still blocking this PR 😭 |
bc16714
to
0c1b205
Compare
Interesting, the tests now get stuck a bit later, but actually terminate! |
I looked into the OOM. The It seems like this is related to the shape of tests, after some inlining and commuting conversions,
where each right-hand side is a single test expression using a function like I do not know exactly where the OOM comes into play, but setting |
0c1b205
to
2066704
Compare
Funnily enough when I run just the ![]() and it's even reasonably quick, no OOM to be found... The resulting |
The CI still fails with OOM, sadly :( |
We can fix this by just reducing the default |
For fun, I tried a def eachIndexed[A](list: List[A]): Unit / emit[(Int, A)] = {
def go(list: List[A], i: Int): Unit = list match {
case Nil() => ()
case Cons(head, tail) =>
do emit((i, head))
go(tail, i + 1)
}
go(list, 0)
}
def indexOf[A](list: List[A], element: A) { eq: (A, A) => Bool }: Option[Int] = {
var result = None()
try list.eachIndexed() with emit[(Int, A)] { case (i, a) =>
if (element.eq(a)) {
result = Some(i)
} else {
resume(())
}
}
result
}
def lastIndexOf[A](list: List[A], element: A) { eq: (A, A) => Bool }: Option[Int] = {
var result = None()
try list.eachIndexed() with emit[(Int, A)] { case (i, a) =>
if (element.eq(a)) {
result = Some(i)
}
resume(())
}
result
} The optimised Effekt core with module examples/stdlib/list/indexOf
extern {io_542} def println_1 = (value_2: String_403): Unit_404 = js value_2
extern {} def show_14 = (value_13: Int_408): String_403 = js value_13
extern {} def infixConcat_35 = (s1_33: String_403, s2_34: String_403): String_403 = js s1_33, s2_34
extern {} def infixEq_84 = (x_82: String_403, y_83: String_403): Bool_399 = js x_82, y_83
extern {} def infixAdd_96 = (x_94: Int_408, y_95: Int_408): Int_408 = js x_94, y_95
type Nothing_407 {}
type Ordering_43 {}
type Tuple2_255[A_253, B_254] {}
type Tuple3_259[A_256, B_257, C_258] {}
type Tuple4_264[A_260, B_261, C_262, D_263] {}
type Tuple5_270[A_265, B_266, C_267, D_268, E_269] {}
type Tuple6_277[A_271, B_272, C_273, D_274, E_275, F_276] {}
interface Control_278 {}
interface literal_297 {}
interface splice_299[A_298] {}
interface Exception_543[E_544] {}
type MissingValue_550 {}
type OutOfBounds_552 {}
type RuntimeError_553 {}
type WrongFormat_557 {}
type on_584[E_583] {}
type Option_758[A_757] {
None_812()
Some_813(value_815: A_757)
}
type List_925[A_926] {
Nil_1204()
Cons_1205(head_1208: A_926, tail_1209: List_925[A_926])
}
type Result_2133[A_2132, E_2131] {}
type Map_3722[K_3721, V_3720] {}
type Tree_3928[K_3926, V_3927] {}
type MaxView_4072[K_4070, V_4071] {}
type MinView_4075[K_4073, V_4074] {}
type Set_6289[A_6290] {}
interface Queue_6826[T_6827] {}
type IOError_7315 {}
interface Files_7419 {}
interface emit_7682[A_7681] {}
interface read_7684[A_7683] {}
interface stop_7685 {}
type Indexed_7734[A_7733] {}
interface snapshot_7838 {}
def main_9404() = {
let tmp_8505503 = make List_925[String_403] Nil_1204()
var result_8504752 = make Option_758[Int_408] None_812();
val __8504768: Unit_404 = reset { {p_8504764} =>
def go_8504763(list_8504765: List_925[String_403], i_8504760: Int_408) = list_8504765 match {
case Nil_1204 { () =>
return ()
}
case Cons_1205 { (head_8504758: String_403, tail_8504762: List_925[String_403]) =>
val __8504767: Unit_404 = shift(p_8504764) { {k_8504757} =>
if (infixEq_84("e", head_8504758)) {
result_8504752 := make Option_758[Int_408] Some_813(i_8504760);
return ()
} else {
resume(k_8504757) {
return ()
}
}
};
go_8504763(tail_8504762, infixAdd_96(i_8504760, 1))
}
}
go_8504763(tmp_8505503, 0)
};
let s_8504766 = !result_8504752;
def l_12839251(v_r_16596684: Unit_404) = {
var result_12839002 = make Option_758[Int_408] None_812();
def go_12839000(list_12838999: List_925[String_403], i_12838997: Int_408) = list_12838999 match {
case Nil_1204 { () =>
return ()
}
case Cons_1205 { (head_12839003: String_403, tail_12838998: List_925[String_403]) =>
if (infixEq_84("e", head_12839003)) {
result_12839002 := make Option_758[Int_408] Some_813(i_12838997);
go_12839000(tail_12838998, infixAdd_96(i_12838997, 1))
} else {
go_12839000(tail_12838998, infixAdd_96(i_12838997, 1))
}
}
}
val __16797408: Unit_404 = go_12839000(tmp_8505503, 0);
let s_12839001 = !result_12839002;
def l_14717928(__16797409: Unit_404) = {
let tmp_16797410 = println_1("")
let tmp_14718070 = make List_925[String_403] Cons_1205("e", make List_925[String_403] Cons_1205("f", make List_925[String_403] Cons_1205("f", make List_925[String_403] Cons_1205("e", make List_925[String_403] Cons_1205("k", make List_925[String_403] Cons_1205("t", make List_925[String_403] Nil_1204()))))))
var result_14717854 = make Option_758[Int_408] None_812();
val __16897771: Unit_404 = reset { {p_14717859} =>
def go_14717896(list_14717894: List_925[String_403], i_14717861: Int_408) = list_14717894 match {
case Nil_1204 { () =>
return ()
}
case Cons_1205 { (head_14717855: String_403, tail_14717858: List_925[String_403]) =>
val __16897770: Unit_404 = shift(p_14717859) { {k_14717860} =>
if (infixEq_84("e", head_14717855)) {
result_14717854 := make Option_758[Int_408] Some_813(i_14717861);
return ()
} else {
resume(k_14717860) {
return ()
}
}
};
go_14717896(tail_14717858, infixAdd_96(i_14717861, 1))
}
}
go_14717896(tmp_14718070, 0)
};
let s_14717897 = !result_14717854;
def l_15657456(v_r_16897772: Unit_404) = {
var result_15657231 = make Option_758[Int_408] None_812();
def go_15657227(list_15657232: List_925[String_403], i_15657226: Int_408) = list_15657232 match {
case Nil_1204 { () =>
return ()
}
case Cons_1205 { (head_15657230: String_403, tail_15657228: List_925[String_403]) =>
if (infixEq_84("e", head_15657230)) {
result_15657231 := make Option_758[Int_408] Some_813(i_15657226);
go_15657227(tail_15657228, infixAdd_96(i_15657226, 1))
} else {
go_15657227(tail_15657228, infixAdd_96(i_15657226, 1))
}
}
}
val __16947952: Unit_404 = go_15657227(tmp_14718070, 0);
let s_15657225 = !result_15657231;
def l_16127225(__16947953: Unit_404) = {
let tmp_16947954 = println_1("")
let tmp_16126759 = make List_925[String_403] Cons_1205("b", make List_925[String_403] Cons_1205("r", make List_925[String_403] Cons_1205("e", make List_925[String_403] Cons_1205("a", make List_925[String_403] Cons_1205("d", make List_925[String_403] Nil_1204())))))
var result_16127042 = make Option_758[Int_408] None_812();
val __16973043: Unit_404 = reset { {p_16126967} =>
def go_16126950(list_16126964: List_925[String_403], i_16126963: Int_408) = list_16126964 match {
case Nil_1204 { () =>
return ()
}
case Cons_1205 { (head_16127040: String_403, tail_16126961: List_925[String_403]) =>
val __16973042: Unit_404 = shift(p_16126967) { {k_16126957} =>
if (infixEq_84("e", head_16127040)) {
result_16127042 := make Option_758[Int_408] Some_813(i_16126963);
return ()
} else {
resume(k_16126957) {
return ()
}
}
};
go_16126950(tail_16126961, infixAdd_96(i_16126963, 1))
}
}
go_16126950(tmp_16126759, 0)
};
let s_16126970 = !result_16127042;
def l_16361995(v_r_16973044: Unit_404) = {
var result_16361828 = make Option_758[Int_408] None_812();
def go_16361702(list_16361705: List_925[String_403], i_16361747: Int_408) = list_16361705 match {
case Nil_1204 { () =>
return ()
}
case Cons_1205 { (head_16361701: String_403, tail_16361736: List_925[String_403]) =>
if (infixEq_84("e", head_16361701)) {
result_16361828 := make Option_758[Int_408] Some_813(i_16361747);
go_16361702(tail_16361736, infixAdd_96(i_16361747, 1))
} else {
go_16361702(tail_16361736, infixAdd_96(i_16361747, 1))
}
}
}
val __16985588: Unit_404 = go_16361702(tmp_16126759, 0);
let s_16361823 = !result_16361828;
def l_16479251(__16985589: Unit_404) = {
let tmp_16985590 = println_1("")
let tmp_16479626 = make List_925[String_403] Cons_1205("b", make List_925[String_403] Cons_1205("a", make List_925[String_403] Cons_1205("n", make List_925[String_403] Cons_1205("a", make List_925[String_403] Cons_1205("n", make List_925[String_403] Cons_1205("a", make List_925[String_403] Cons_1205("s", make List_925[String_403] Nil_1204())))))))
var result_16479269 = make Option_758[Int_408] None_812();
val __16991861: Unit_404 = reset { {p_16479274} =>
def go_16479275(list_16479645: List_925[String_403], i_16479616: Int_408) = list_16479645 match {
case Nil_1204 { () =>
return ()
}
case Cons_1205 { (head_16479270: String_403, tail_16479273: List_925[String_403]) =>
val __16991860: Unit_404 = shift(p_16479274) { {k_16479271} =>
if (infixEq_84("b", head_16479270)) {
result_16479269 := make Option_758[Int_408] Some_813(i_16479616);
return ()
} else {
resume(k_16479271) {
return ()
}
}
};
go_16479275(tail_16479273, infixAdd_96(i_16479616, 1))
}
}
go_16479275(tmp_16479626, 0)
};
let s_16479652 = !result_16479269;
def l_16583508(v_r_16991862: Unit_404) = {
var result_16582983 = make Option_758[Int_408] None_812();
def go_16583342(list_16583000: List_925[String_403], i_16583349: Int_408) = list_16583000 match {
case Nil_1204 { () =>
return ()
}
case Cons_1205 { (head_16583019: String_403, tail_16583347: List_925[String_403]) =>
if (infixEq_84("b", head_16583019)) {
result_16582983 := make Option_758[Int_408] Some_813(i_16583349);
go_16583342(tail_16583347, infixAdd_96(i_16583349, 1))
} else {
go_16583342(tail_16583347, infixAdd_96(i_16583349, 1))
}
}
}
val __16994997: Unit_404 = go_16583342(tmp_16479626, 0);
let s_16582941 = !result_16582983;
def l_16570577(v_r_16994998: Unit_404) = {
var result_16570250 = make Option_758[Int_408] None_812();
val __16996565: Unit_404 = reset { {p_16570309} =>
def go_16570270(list_16569908: List_925[String_403], i_16569905: Int_408) = list_16569908 match {
case Nil_1204 { () =>
return ()
}
case Cons_1205 { (head_16569904: String_403, tail_16569895: List_925[String_403]) =>
val __16996564: Unit_404 = shift(p_16570309) { {k_16569907} =>
if (infixEq_84("a", head_16569904)) {
result_16570250 := make Option_758[Int_408] Some_813(i_16569905);
return ()
} else {
resume(k_16569907) {
return ()
}
}
};
go_16570270(tail_16569895, infixAdd_96(i_16569905, 1))
}
}
go_16570270(tmp_16479626, 0)
};
let s_16569906 = !result_16570250;
def l_16557302(v_r_16996566: Unit_404) = {
var result_16556877 = make Option_758[Int_408] None_812();
def go_16556875(list_16556794: List_925[String_403], i_16557152: Int_408) = list_16556794 match {
case Nil_1204 { () =>
return ()
}
case Cons_1205 { (head_16556878: String_403, tail_16556793: List_925[String_403]) =>
if (infixEq_84("a", head_16556878)) {
result_16556877 := make Option_758[Int_408] Some_813(i_16557152);
go_16556875(tail_16556793, infixAdd_96(i_16557152, 1))
} else {
go_16556875(tail_16556793, infixAdd_96(i_16557152, 1))
}
}
}
val __16997349: Unit_404 = go_16556875(tmp_16479626, 0);
let s_16557156 = !result_16556877;
def l_16564889(v_r_16997350: Unit_404) = {
var result_16563712 = make Option_758[Int_408] None_812();
val __16997741: Unit_404 = reset { {p_16563733} =>
def go_16563734(list_16563560: List_925[String_403], i_16563563: Int_408) = list_16563560 match {
case Nil_1204 { () =>
return ()
}
case Cons_1205 { (head_16563713: String_403, tail_16563732: List_925[String_403]) =>
val __16997740: Unit_404 = shift(p_16563733) { {k_16563714} =>
if (infixEq_84("n", head_16563713)) {
result_16563712 := make Option_758[Int_408] Some_813(i_16563563);
return ()
} else {
resume(k_16563714) {
return ()
}
}
};
go_16563734(tail_16563732, infixAdd_96(i_16563563, 1))
}
}
go_16563734(tmp_16479626, 0)
};
let s_16563727 = !result_16563712;
def l_16567991(v_r_16997742: Unit_404) = {
var result_16568037 = make Option_758[Int_408] None_812();
def go_16567889(list_16568160: List_925[String_403], i_16568038: Int_408) = list_16568160 match {
case Nil_1204 { () =>
return ()
}
case Cons_1205 { (head_16567802: String_403, tail_16567868: List_925[String_403]) =>
if (infixEq_84("n", head_16567802)) {
result_16568037 := make Option_758[Int_408] Some_813(i_16568038);
go_16567889(tail_16567868, infixAdd_96(i_16568038, 1))
} else {
go_16567889(tail_16567868, infixAdd_96(i_16568038, 1))
}
}
}
val __16997937: Unit_404 = go_16567889(tmp_16479626, 0);
let s_16568163 = !result_16568037;
def l_16570066(v_r_16997938: Unit_404) = {
var result_16570032 = make Option_758[Int_408] None_812();
val __16998035: Unit_404 = reset { {p_16569773} =>
def go_16569689(list_16569690: List_925[String_403], i_16570031: Int_408) = list_16569690 match {
case Nil_1204 { () =>
return ()
}
case Cons_1205 { (head_16569925: String_403, tail_16569944: List_925[String_403]) =>
val __16998034: Unit_404 = shift(p_16569773) { {k_16569883} =>
if (infixEq_84("s", head_16569925)) {
result_16570032 := make Option_758[Int_408] Some_813(i_16570031);
return ()
} else {
resume(k_16569883) {
return ()
}
}
};
go_16569689(tail_16569944, infixAdd_96(i_16570031, 1))
}
}
go_16569689(tmp_16479626, 0)
};
let s_16569628 = !result_16570032;
def l_16556022(v_r_16998036: Unit_404) = {
var result_16556466 = make Option_758[Int_408] None_812();
def go_16556060(list_16556357: List_925[String_403], i_16556295: Int_408) = list_16556357 match {
case Nil_1204 { () =>
return ()
}
case Cons_1205 { (head_16556121: String_403, tail_16556318: List_925[String_403]) =>
if (infixEq_84("s", head_16556121)) {
result_16556466 := make Option_758[Int_408] Some_813(i_16556295);
go_16556060(tail_16556318, infixAdd_96(i_16556295, 1))
} else {
go_16556060(tail_16556318, infixAdd_96(i_16556295, 1))
}
}
}
val __16998084: Unit_404 = go_16556060(tmp_16479626, 0);
let s_16556315 = !result_16556466;
def l_16555689(__16998085: Unit_404) = {
let tmp_16998086 = println_1("")
var result_16556363 = make Option_758[Int_408] None_812();
val __16998109: Unit_404 = reset { {p_16556784} =>
def go_16556893(list_16556531: List_925[String_403], i_16556642: Int_408) = list_16556531 match {
case Nil_1204 { () =>
return ()
}
case Cons_1205 { (head_16556364: String_403, tail_16556639: List_925[String_403]) =>
val __16998108: Unit_404 = shift(p_16556784) { {k_16556361} =>
if (infixEq_84("na", head_16556364)) {
result_16556363 := make Option_758[Int_408] Some_813(i_16556642);
return ()
} else {
resume(k_16556361) {
return ()
}
}
};
go_16556893(tail_16556639, infixAdd_96(i_16556642, 1))
}
}
go_16556893(tmp_16479626, 0)
};
let s_16556534 = !result_16556363;
def l_16556107(v_r_16998110: Unit_404) = {
var result_16556061 = make Option_758[Int_408] None_812();
def go_16556041(list_16556066: List_925[String_403], i_16556300: Int_408) = list_16556066 match {
case Nil_1204 { () =>
return ()
}
case Cons_1205 { (head_16556208: String_403, tail_16556302: List_925[String_403]) =>
if (infixEq_84("na", head_16556208)) {
result_16556061 := make Option_758[Int_408] Some_813(i_16556300);
go_16556041(tail_16556302, infixAdd_96(i_16556300, 1))
} else {
go_16556041(tail_16556302, infixAdd_96(i_16556300, 1))
}
}
}
val __16998121: Unit_404 = go_16556041(tmp_16479626, 0);
let s_16556063 = !result_16556061;
def l_16556926(v_r_16998122: Unit_404) = {
var result_16556469 = make Option_758[Int_408] None_812();
val __16998127: Unit_404 = reset { {p_16555879} =>
def go_16556883(list_16556553: List_925[String_403], i_16556886: Int_408) = list_16556553 match {
case Nil_1204 { () =>
return ()
}
case Cons_1205 { (head_16556456: String_403, tail_16556305: List_925[String_403]) =>
val __16998126: Unit_404 = shift(p_16555879) { {k_16556730} =>
if (infixEq_84("", head_16556456)) {
result_16556469 := make Option_758[Int_408] Some_813(i_16556886);
return ()
} else {
resume(k_16556730) {
return ()
}
}
};
go_16556883(tail_16556305, infixAdd_96(i_16556886, 1))
}
}
go_16556883(tmp_16479626, 0)
};
let s_16556568 = !result_16556469;
def l_16556628(v_r_16998128: Unit_404) = {
var result_16555769 = make Option_758[Int_408] None_812();
def go_16555835(list_16556132: List_925[String_403], i_16556006: Int_408) = list_16556132 match {
case Nil_1204 { () =>
return ()
}
case Cons_1205 { (head_16556264: String_403, tail_16556005: List_925[String_403]) =>
if (infixEq_84("", head_16556264)) {
result_16555769 := make Option_758[Int_408] Some_813(i_16556006);
go_16555835(tail_16556005, infixAdd_96(i_16556006, 1))
} else {
go_16555835(tail_16556005, infixAdd_96(i_16556006, 1))
}
}
}
val __16998130: Unit_404 = go_16555835(tmp_16479626, 0);
let s_16555770 = !result_16555769;
s_16555770 match {
case None_812 { () =>
let tmp_16556386 = println_1("None()")
return tmp_16556386
}
case Some_813 { (v_16556625: Int_408) =>
let tmp_16556341 = println_1(infixConcat_35(infixConcat_35("Some(", show_14(v_16556625)), ")"))
return tmp_16556341
}
}
}
s_16556568 match {
case None_812 { () =>
let tmp_16556458 = println_1("None()")
l_16556628(tmp_16556458)
}
case Some_813 { (v_16555858: Int_408) =>
let tmp_16556537 = println_1(infixConcat_35(infixConcat_35("Some(", show_14(v_16555858)), ")"))
l_16556628(tmp_16556537)
}
}
}
s_16556063 match {
case None_812 { () =>
let tmp_16557203 = println_1("None()")
l_16556926(tmp_16557203)
}
case Some_813 { (v_16556580: Int_408) =>
let tmp_16556325 = println_1(infixConcat_35(infixConcat_35("Some(", show_14(v_16556580)), ")"))
l_16556926(tmp_16556325)
}
}
}
s_16556534 match {
case None_812 { () =>
let tmp_16556278 = println_1("None()")
l_16556107(tmp_16556278)
}
case Some_813 { (v_16556299: Int_408) =>
let tmp_16556383 = println_1(infixConcat_35(infixConcat_35("Some(", show_14(v_16556299)), ")"))
l_16556107(tmp_16556383)
}
}
}
s_16556315 match {
case None_812 { () =>
let tmp_16555862 = println_1("None()")
l_16555689(tmp_16555862)
}
case Some_813 { (v_16556366: Int_408) =>
let tmp_16555837 = println_1(infixConcat_35(infixConcat_35("Some(", show_14(v_16556366)), ")"))
l_16555689(tmp_16555837)
}
}
}
s_16569628 match {
case None_812 { () =>
let tmp_16555849 = println_1("None()")
l_16556022(tmp_16555849)
}
case Some_813 { (v_16556472: Int_408) =>
let tmp_16556019 = println_1(infixConcat_35(infixConcat_35("Some(", show_14(v_16556472)), ")"))
l_16556022(tmp_16556019)
}
}
}
s_16568163 match {
case None_812 { () =>
let tmp_16570045 = println_1("None()")
l_16570066(tmp_16570045)
}
case Some_813 { (v_16569604: Int_408) =>
let tmp_16569827 = println_1(infixConcat_35(infixConcat_35("Some(", show_14(v_16569604)), ")"))
l_16570066(tmp_16569827)
}
}
}
s_16563727 match {
case None_812 { () =>
let tmp_16567876 = println_1("None()")
l_16567991(tmp_16567876)
}
case Some_813 { (v_16567887: Int_408) =>
let tmp_16567979 = println_1(infixConcat_35(infixConcat_35("Some(", show_14(v_16567887)), ")"))
l_16567991(tmp_16567979)
}
}
}
s_16557156 match {
case None_812 { () =>
let tmp_16564868 = println_1("None()")
l_16564889(tmp_16564868)
}
case Some_813 { (v_16563719: Int_408) =>
let tmp_16564717 = println_1(infixConcat_35(infixConcat_35("Some(", show_14(v_16563719)), ")"))
l_16564889(tmp_16564717)
}
}
}
s_16569906 match {
case None_812 { () =>
let tmp_16557299 = println_1("None()")
l_16557302(tmp_16557299)
}
case Some_813 { (v_16556791: Int_408) =>
let tmp_16557129 = println_1(infixConcat_35(infixConcat_35("Some(", show_14(v_16556791)), ")"))
l_16557302(tmp_16557129)
}
}
}
s_16582941 match {
case None_812 { () =>
let tmp_16570410 = println_1("None()")
l_16570577(tmp_16570410)
}
case Some_813 { (v_16570269: Int_408) =>
let tmp_16570580 = println_1(infixConcat_35(infixConcat_35("Some(", show_14(v_16570269)), ")"))
l_16570577(tmp_16570580)
}
}
}
s_16479652 match {
case None_812 { () =>
let tmp_16583235 = println_1("None()")
l_16583508(tmp_16583235)
}
case Some_813 { (v_16583236: Int_408) =>
let tmp_16583336 = println_1(infixConcat_35(infixConcat_35("Some(", show_14(v_16583236)), ")"))
l_16583508(tmp_16583336)
}
}
}
s_16361823 match {
case None_812 { () =>
let tmp_16479252 = println_1("None()")
l_16479251(tmp_16479252)
}
case Some_813 { (v_16479276: Int_408) =>
let tmp_16479207 = println_1(infixConcat_35(infixConcat_35("Some(", show_14(v_16479276)), ")"))
l_16479251(tmp_16479207)
}
}
}
s_16126970 match {
case None_812 { () =>
let tmp_16362164 = println_1("None()")
l_16361995(tmp_16362164)
}
case Some_813 { (v_16361754: Int_408) =>
let tmp_16361990 = println_1(infixConcat_35(infixConcat_35("Some(", show_14(v_16361754)), ")"))
l_16361995(tmp_16361990)
}
}
}
s_15657225 match {
case None_812 { () =>
let tmp_16127208 = println_1("None()")
l_16127225(tmp_16127208)
}
case Some_813 { (v_16127039: Int_408) =>
let tmp_16127298 = println_1(infixConcat_35(infixConcat_35("Some(", show_14(v_16127039)), ")"))
l_16127225(tmp_16127298)
}
}
}
s_14717897 match {
case None_812 { () =>
let tmp_15657455 = println_1("None()")
l_15657456(tmp_15657455)
}
case Some_813 { (v_15657270: Int_408) =>
let tmp_15657460 = println_1(infixConcat_35(infixConcat_35("Some(", show_14(v_15657270)), ")"))
l_15657456(tmp_15657460)
}
}
}
s_12839001 match {
case None_812 { () =>
let tmp_14717925 = println_1("None()")
l_14717928(tmp_14717925)
}
case Some_813 { (v_14717857: Int_408) =>
let tmp_14717932 = println_1(infixConcat_35(infixConcat_35("Some(", show_14(v_14717857)), ")"))
l_14717928(tmp_14717932)
}
}
}
s_8504766 match {
case None_812 { () =>
let tmp_12839248 = println_1("None()")
l_12839251(tmp_12839248)
}
case Some_813 { (v_12838996: Int_408) =>
let tmp_12839254 = println_1(infixConcat_35(infixConcat_35("Some(", show_14(v_12838996)), ")"))
l_12839251(tmp_12839254)
}
}
} |
Fun, this exposes how each backend acts completely differently even in the Core-related phases: For reference, here's the resulting machine: def main_9404() = {
let make_29425316 = 0();
tmp_19622045 := make_29425316;
let make_29425317 = 0();
tmp_19621742 := make_29425317;
var result_19621156 = tmp_19621742;
val (__19621169 : Positive) = reset {p_19621150 =>
let longLiteral_29425804 = 0;
list_19621155 := tmp_19622045, i_19621157 := longLiteral_29425804;
jump go_19621161};
let s_19621166 = loadVar(result_19621156);
switch s_19621166
0 : { () =>
let utf8StringLiteral_29425783 = "\4e\6f\6e\65\28\29";
let pureApp_29425782 = println_1(utf8StringLiteral_29425783);
tmp_24611535 := pureApp_29425782;
v_r_29023869 := tmp_24611535;
jump l_24611551
}
1 : { (v_24610823 : Positive) =>
let pureApp_29425784 = unboxInt_309(v_24610823);
tmp_24611550 := pureApp_29425784;
let pureApp_29425785 = show_14(tmp_24611550);
tmp_24611549 := pureApp_29425785;
let utf8StringLiteral_29425787 = "\53\6f\6d\65\28";
let pureApp_29425786 = infixConcat_35(utf8StringLiteral_29425787, tmp_24611549);
tmp_24611548 := pureApp_29425786;
let utf8StringLiteral_29425789 = "\29";
let pureApp_29425788 = infixConcat_35(tmp_24611548, utf8StringLiteral_29425789);
tmp_24611553 := pureApp_29425788;
let pureApp_29425790 = println_1(tmp_24611553);
tmp_24611552 := pureApp_29425790;
v_r_29023869 := tmp_24611552;
jump l_24611551
}
}
def go_19621161(list_19621155 : Positive, i_19621157 : Int, p_19621150 : Prompt, result_19621156 : Positive*) = {
switch list_19621155
0 : { () =>
let unitLiteral_29425792 = 0();
return unitLiteral_29425792
}
1 : { (head_19621162 : Positive, tail_19621160 : Positive) =>
let pureApp_29425793 = boxInt_307(i_19621157);
tmp_19622038 := pureApp_29425793;
val (__19621168 : Positive) = shift p_19621150 {k_19621154 =>
let pureApp_29425796 = unboxInt_309(tmp_19622038);
tmp_19622039 := pureApp_29425796;
let utf8StringLiteral_29425798 = "\65";
let pureApp_29425797 = infixEq_84(utf8StringLiteral_29425798, head_19621162);
tmp_19622040 := pureApp_29425797;
switch tmp_19622040
0 : { () =>
resume k_19621154;
let unitLiteral_29425799 = 0();
return unitLiteral_29425799
}
1 : { () =>
let pureApp_29425800 = boxInt_307(tmp_19622039);
tmp_19622041 := pureApp_29425800;
let make_29425801 = 1(tmp_19622041);
tmp_19622042 := make_29425801;
storeVar(result_19621156, tmp_19622042);
let unitLiteral_29425803 = 0();
return unitLiteral_29425803
}};
let longLiteral_29425795 = 1;
let pureApp_29425794 = infixAdd_96(i_19621157, longLiteral_29425795);
tmp_19622043 := pureApp_29425794;
list_19621155 := tail_19621160, i_19621157 := tmp_19622043;
jump go_19621161
}
}
def l_24611551(v_r_29023869 : Positive, tmp_19622045 : Positive) = {
let make_29425319 = 0();
tmp_24610910 := make_29425319;
var result_24610838 = tmp_24610910;
val (__29224593 : Positive) = {
let longLiteral_29425781 = 0;
list_24610837 := tmp_19622045, i_24610840 := longLiteral_29425781;
jump go_24610825
};
let s_24610824 = loadVar(result_24610838);
switch s_24610824
0 : { () =>
let utf8StringLiteral_29425773 = "\4e\6f\6e\65\28\29";
let pureApp_29425772 = println_1(utf8StringLiteral_29425773);
tmp_27818852 := pureApp_29425772;
__29224594 := tmp_27818852;
jump l_27818851
}
1 : { (v_27818289 : Positive) =>
let pureApp_29425774 = unboxInt_309(v_27818289);
tmp_27818850 := pureApp_29425774;
let pureApp_29425775 = show_14(tmp_27818850);
tmp_27818849 := pureApp_29425775;
let utf8StringLiteral_29425777 = "\53\6f\6d\65\28";
let pureApp_29425776 = infixConcat_35(utf8StringLiteral_29425777, tmp_27818849);
tmp_27818855 := pureApp_29425776;
let utf8StringLiteral_29425779 = "\29";
let pureApp_29425778 = infixConcat_35(tmp_27818855, utf8StringLiteral_29425779);
tmp_27818854 := pureApp_29425778;
let pureApp_29425780 = println_1(tmp_27818854);
tmp_27818853 := pureApp_29425780;
__29224594 := tmp_27818853;
jump l_27818851
}
}
def l_27818851(__29224594 : Positive) = {
let utf8StringLiteral_29425334 = "";
let pureApp_29425333 = println_1(utf8StringLiteral_29425334);
tmp_29224595 := pureApp_29425333;
let make_29425335 = 0();
tmp_27818240 := make_29425335;
let utf8StringLiteral_29425337 = "\74";
let make_29425336 = 1(utf8StringLiteral_29425337, tmp_27818240);
tmp_27818239 := make_29425336;
let utf8StringLiteral_29425339 = "\6b";
let make_29425338 = 1(utf8StringLiteral_29425339, tmp_27818239);
tmp_27818238 := make_29425338;
let utf8StringLiteral_29425341 = "\65";
let make_29425340 = 1(utf8StringLiteral_29425341, tmp_27818238);
tmp_27818435 := make_29425340;
let utf8StringLiteral_29425343 = "\66";
let make_29425342 = 1(utf8StringLiteral_29425343, tmp_27818435);
tmp_27818434 := make_29425342;
let utf8StringLiteral_29425345 = "\66";
let make_29425344 = 1(utf8StringLiteral_29425345, tmp_27818434);
tmp_27818433 := make_29425344;
let utf8StringLiteral_29425347 = "\65";
let make_29425346 = 1(utf8StringLiteral_29425347, tmp_27818433);
tmp_27818241 := make_29425346;
let make_29425348 = 0();
tmp_27818233 := make_29425348;
var result_27818285 = tmp_27818233;
val (__29324956 : Positive) = reset {p_27818290 =>
let longLiteral_29425771 = 0;
list_27818286 := tmp_27818241, i_27818284 := longLiteral_29425771;
jump go_27818280};
let s_27818282 = loadVar(result_27818285);
switch s_27818282
0 : { () =>
let utf8StringLiteral_29425750 = "\4e\6f\6e\65\28\29";
let pureApp_29425749 = println_1(utf8StringLiteral_29425750);
tmp_28921375 := pureApp_29425749;
v_r_29324957 := tmp_28921375;
jump l_28921376
}
1 : { (v_28920970 : Positive) =>
let pureApp_29425751 = unboxInt_309(v_28920970);
tmp_28921369 := pureApp_29425751;
let pureApp_29425752 = show_14(tmp_28921369);
tmp_28921370 := pureApp_29425752;
let utf8StringLiteral_29425754 = "\53\6f\6d\65\28";
let pureApp_29425753 = infixConcat_35(utf8StringLiteral_29425754, tmp_28921370);
tmp_28921371 := pureApp_29425753;
let utf8StringLiteral_29425756 = "\29";
let pureApp_29425755 = infixConcat_35(tmp_28921371, utf8StringLiteral_29425756);
tmp_28921372 := pureApp_29425755;
let pureApp_29425757 = println_1(tmp_28921372);
tmp_28921345 := pureApp_29425757;
v_r_29324957 := tmp_28921345;
jump l_28921376
}
}
def go_27818280(list_27818286 : Positive, i_27818284 : Int, result_27818285 : Positive*, p_27818290 : Prompt) = {
switch list_27818286
0 : { () =>
let unitLiteral_29425759 = 0();
return unitLiteral_29425759
}
1 : { (head_27818279 : Positive, tail_27818281 : Positive) =>
let pureApp_29425760 = boxInt_307(i_27818284);
tmp_27818965 := pureApp_29425760;
val (__29324955 : Positive) = shift p_27818290 {k_27818283 =>
let pureApp_29425763 = unboxInt_309(tmp_27818965);
tmp_27818964 := pureApp_29425763;
let utf8StringLiteral_29425765 = "\65";
let pureApp_29425764 = infixEq_84(utf8StringLiteral_29425765, head_27818279);
tmp_27818963 := pureApp_29425764;
switch tmp_27818963
0 : { () =>
resume k_27818283;
let unitLiteral_29425766 = 0();
return unitLiteral_29425766
}
1 : { () =>
let pureApp_29425767 = boxInt_307(tmp_27818964);
tmp_27818970 := pureApp_29425767;
let make_29425768 = 1(tmp_27818970);
tmp_27818969 := make_29425768;
storeVar(result_27818285, tmp_27818969);
let unitLiteral_29425770 = 0();
return unitLiteral_29425770
}};
let longLiteral_29425762 = 1;
let pureApp_29425761 = infixAdd_96(i_27818284, longLiteral_29425762);
tmp_27818968 := pureApp_29425761;
list_27818286 := tail_27818281, i_27818284 := tmp_27818968;
jump go_27818280
}
}
def l_28921376(v_r_29324957 : Positive, tmp_27818241 : Positive) = {
let make_29425350 = 0();
tmp_28920952 := make_29425350;
var result_28921675 = tmp_28920952;
val (__29375137 : Positive) = {
let longLiteral_29425748 = 0;
list_28921676 := tmp_27818241, i_28921673 := longLiteral_29425748;
jump go_28920967
};
let s_28921674 = loadVar(result_28921675);
switch s_28921674
0 : { () =>
let utf8StringLiteral_29425740 = "\4e\6f\6e\65\28\29";
let pureApp_29425739 = println_1(utf8StringLiteral_29425740);
tmp_27543473 := pureApp_29425739;
__29375138 := tmp_27543473;
jump l_27543468
}
1 : { (v_27542889 : Positive) =>
let pureApp_29425741 = unboxInt_309(v_27542889);
tmp_27543467 := pureApp_29425741;
let pureApp_29425742 = show_14(tmp_27543467);
tmp_27543470 := pureApp_29425742;
let utf8StringLiteral_29425744 = "\53\6f\6d\65\28";
let pureApp_29425743 = infixConcat_35(utf8StringLiteral_29425744, tmp_27543470);
tmp_27543469 := pureApp_29425743;
let utf8StringLiteral_29425746 = "\29";
let pureApp_29425745 = infixConcat_35(tmp_27543469, utf8StringLiteral_29425746);
tmp_27543508 := pureApp_29425745;
let pureApp_29425747 = println_1(tmp_27543508);
tmp_27543507 := pureApp_29425747;
__29375138 := tmp_27543507;
jump l_27543468
}
}
def l_27543468(__29375138 : Positive) = {
let utf8StringLiteral_29425365 = "";
let pureApp_29425364 = println_1(utf8StringLiteral_29425365);
tmp_29375139 := pureApp_29425364;
let make_29425366 = 0();
tmp_27542998 := make_29425366;
let utf8StringLiteral_29425368 = "\64";
let make_29425367 = 1(utf8StringLiteral_29425368, tmp_27542998);
tmp_27542994 := make_29425367;
let utf8StringLiteral_29425370 = "\61";
let make_29425369 = 1(utf8StringLiteral_29425370, tmp_27542994);
tmp_27542997 := make_29425369;
let utf8StringLiteral_29425372 = "\65";
let make_29425371 = 1(utf8StringLiteral_29425372, tmp_27542997);
tmp_27542996 := make_29425371;
let utf8StringLiteral_29425374 = "\72";
let make_29425373 = 1(utf8StringLiteral_29425374, tmp_27542996);
tmp_27542999 := make_29425373;
let utf8StringLiteral_29425376 = "\62";
let make_29425375 = 1(utf8StringLiteral_29425376, tmp_27542999);
tmp_27542546 := make_29425375;
let make_29425377 = 0();
tmp_27542561 := make_29425377;
var result_27542892 = tmp_27542561;
val (__29400228 : Positive) = reset {p_27542894 =>
let longLiteral_29425738 = 0;
list_27542893 := tmp_27542546, i_27542895 := longLiteral_29425738;
jump go_27542931};
let s_27542888 = loadVar(result_27542892);
switch s_27542888
0 : { () =>
let utf8StringLiteral_29425717 = "\4e\6f\6e\65\28\29";
let pureApp_29425716 = println_1(utf8StringLiteral_29425717);
tmp_27266854 := pureApp_29425716;
v_r_29400229 := tmp_27266854;
jump l_27266857
}
1 : { (v_27267012 : Positive) =>
let pureApp_29425718 = unboxInt_309(v_27267012);
tmp_27267336 := pureApp_29425718;
let pureApp_29425719 = show_14(tmp_27267336);
tmp_27267343 := pureApp_29425719;
let utf8StringLiteral_29425721 = "\53\6f\6d\65\28";
let pureApp_29425720 = infixConcat_35(utf8StringLiteral_29425721, tmp_27267343);
tmp_27267342 := pureApp_29425720;
let utf8StringLiteral_29425723 = "\29";
let pureApp_29425722 = infixConcat_35(tmp_27267342, utf8StringLiteral_29425723);
tmp_27267345 := pureApp_29425722;
let pureApp_29425724 = println_1(tmp_27267345);
tmp_27267344 := pureApp_29425724;
v_r_29400229 := tmp_27267344;
jump l_27266857
}
}
def go_27542931(list_27542893 : Positive, i_27542895 : Int, result_27542892 : Positive*, p_27542894 : Prompt) = {
switch list_27542893
0 : { () =>
let unitLiteral_29425726 = 0();
return unitLiteral_29425726
}
1 : { (head_27542897 : Positive, tail_27542896 : Positive) =>
let pureApp_29425727 = boxInt_307(i_27542895);
tmp_27543092 := pureApp_29425727;
val (__29400227 : Positive) = shift p_27542894 {k_27542890 =>
let pureApp_29425730 = unboxInt_309(tmp_27543092);
tmp_27543091 := pureApp_29425730;
let utf8StringLiteral_29425732 = "\65";
let pureApp_29425731 = infixEq_84(utf8StringLiteral_29425732, head_27542897);
tmp_27543094 := pureApp_29425731;
switch tmp_27543094
0 : { () =>
resume k_27542890;
let unitLiteral_29425733 = 0();
return unitLiteral_29425733
}
1 : { () =>
let pureApp_29425734 = boxInt_307(tmp_27543091);
tmp_27543093 := pureApp_29425734;
let make_29425735 = 1(tmp_27543093);
tmp_27543472 := make_29425735;
storeVar(result_27542892, tmp_27543472);
let unitLiteral_29425737 = 0();
return unitLiteral_29425737
}};
let longLiteral_29425729 = 1;
let pureApp_29425728 = infixAdd_96(i_27542895, longLiteral_29425729);
tmp_27543471 := pureApp_29425728;
list_27542893 := tail_27542896, i_27542895 := tmp_27543471;
jump go_27542931
}
}
def l_27266857(v_r_29400229 : Positive, tmp_27542546 : Positive) = {
let make_29425379 = 0();
tmp_27266991 := make_29425379;
var result_27266936 = tmp_27266991;
val (__29412773 : Positive) = {
let longLiteral_29425715 = 0;
list_27266931 := tmp_27542546, i_27266935 := longLiteral_29425715;
jump go_27266934
};
let s_27266937 = loadVar(result_27266936);
switch s_27266937
0 : { () =>
let utf8StringLiteral_29425707 = "\4e\6f\6e\65\28\29";
let pureApp_29425706 = println_1(utf8StringLiteral_29425707);
tmp_27507203 := pureApp_29425706;
__29412774 := tmp_27507203;
jump l_27507216
}
1 : { (v_27506862 : Positive) =>
let pureApp_29425708 = unboxInt_309(v_27506862);
tmp_27507362 := pureApp_29425708;
let pureApp_29425709 = show_14(tmp_27507362);
tmp_27507419 := pureApp_29425709;
let utf8StringLiteral_29425711 = "\53\6f\6d\65\28";
let pureApp_29425710 = infixConcat_35(utf8StringLiteral_29425711, tmp_27507419);
tmp_27508035 := pureApp_29425710;
let utf8StringLiteral_29425713 = "\29";
let pureApp_29425712 = infixConcat_35(tmp_27508035, utf8StringLiteral_29425713);
tmp_27508034 := pureApp_29425712;
let pureApp_29425714 = println_1(tmp_27508034);
tmp_27507205 := pureApp_29425714;
__29412774 := tmp_27507205;
jump l_27507216
}
}
def l_27507216(__29412774 : Positive) = {
let utf8StringLiteral_29425394 = "";
let pureApp_29425393 = println_1(utf8StringLiteral_29425394);
tmp_29412775 := pureApp_29425393;
let make_29425395 = 0();
tmp_27507997 := make_29425395;
let utf8StringLiteral_29425397 = "\73";
let make_29425396 = 1(utf8StringLiteral_29425397, tmp_27507997);
tmp_27507988 := make_29425396;
let utf8StringLiteral_29425399 = "\61";
let make_29425398 = 1(utf8StringLiteral_29425399, tmp_27507988);
tmp_27507991 := make_29425398;
let utf8StringLiteral_29425401 = "\6e";
let make_29425400 = 1(utf8StringLiteral_29425401, tmp_27507991);
tmp_27507990 := make_29425400;
let utf8StringLiteral_29425403 = "\61";
let make_29425402 = 1(utf8StringLiteral_29425403, tmp_27507990);
tmp_27507989 := make_29425402;
let utf8StringLiteral_29425405 = "\6e";
let make_29425404 = 1(utf8StringLiteral_29425405, tmp_27507989);
tmp_27507948 := make_29425404;
let utf8StringLiteral_29425407 = "\61";
let make_29425406 = 1(utf8StringLiteral_29425407, tmp_27507948);
tmp_27507951 := make_29425406;
let utf8StringLiteral_29425409 = "\62";
let make_29425408 = 1(utf8StringLiteral_29425409, tmp_27507951);
tmp_27507950 := make_29425408;
let make_29425410 = 0();
tmp_27507961 := make_29425410;
var result_27507683 = tmp_27507961;
val (__29419046 : Positive) = reset {p_27507682 =>
let longLiteral_29425705 = 0;
list_27506811 := tmp_27507950, i_27506812 := longLiteral_29425705;
jump go_27507685};
let s_27506855 = loadVar(result_27507683);
switch s_27506855
0 : { () =>
let utf8StringLiteral_29425684 = "\4e\6f\6e\65\28\29";
let pureApp_29425683 = println_1(utf8StringLiteral_29425684);
tmp_27472482 := pureApp_29425683;
v_r_29419047 := tmp_27472482;
jump l_27472483
}
1 : { (v_27472387 : Positive) =>
let pureApp_29425685 = unboxInt_309(v_27472387);
tmp_27472496 := pureApp_29425685;
let pureApp_29425686 = show_14(tmp_27472496);
tmp_27472497 := pureApp_29425686;
let utf8StringLiteral_29425688 = "\53\6f\6d\65\28";
let pureApp_29425687 = infixConcat_35(utf8StringLiteral_29425688, tmp_27472497);
tmp_27472487 := pureApp_29425687;
let utf8StringLiteral_29425690 = "\29";
let pureApp_29425689 = infixConcat_35(tmp_27472487, utf8StringLiteral_29425690);
tmp_27472484 := pureApp_29425689;
let pureApp_29425691 = println_1(tmp_27472484);
tmp_27472485 := pureApp_29425691;
v_r_29419047 := tmp_27472485;
jump l_27472483
}
}
def go_27507685(list_27506811 : Positive, i_27506812 : Int, result_27507683 : Positive*, p_27507682 : Prompt) = {
switch list_27506811
0 : { () =>
let unitLiteral_29425693 = 0();
return unitLiteral_29425693
}
1 : { (head_27506815 : Positive, tail_27506813 : Positive) =>
let pureApp_29425694 = boxInt_307(i_27506812);
tmp_27507317 := pureApp_29425694;
val (__29419045 : Positive) = shift p_27507682 {k_27506853 =>
let pureApp_29425697 = unboxInt_309(tmp_27507317);
tmp_27507217 := pureApp_29425697;
let utf8StringLiteral_29425699 = "\62";
let pureApp_29425698 = infixEq_84(utf8StringLiteral_29425699, head_27506815);
tmp_27507214 := pureApp_29425698;
switch tmp_27507214
0 : { () =>
resume k_27506853;
let unitLiteral_29425700 = 0();
return unitLiteral_29425700
}
1 : { () =>
let pureApp_29425701 = boxInt_307(tmp_27507217);
tmp_27507207 := pureApp_29425701;
let make_29425702 = 1(tmp_27507207);
tmp_27507204 := make_29425702;
storeVar(result_27507683, tmp_27507204);
let unitLiteral_29425704 = 0();
return unitLiteral_29425704
}};
let longLiteral_29425696 = 1;
let pureApp_29425695 = infixAdd_96(i_27506812, longLiteral_29425696);
tmp_27507213 := pureApp_29425695;
list_27506811 := tail_27506813, i_27506812 := tmp_27507213;
jump go_27507685
}
}
def l_27472483(v_r_29419047 : Positive, tmp_27507950 : Positive) = {
let make_29425412 = 0();
tmp_27473033 := make_29425412;
var result_27473000 = tmp_27473033;
val (__29422182 : Positive) = {
let longLiteral_29425682 = 0;
list_27473660 := tmp_27507950, i_27473701 := longLiteral_29425682;
jump go_27473698
};
let s_27473703 = loadVar(result_27473000);
switch s_27473703
0 : { () =>
let utf8StringLiteral_29425674 = "\4e\6f\6e\65\28\29";
let pureApp_29425673 = println_1(utf8StringLiteral_29425674);
tmp_27438207 := pureApp_29425673;
v_r_29422183 := tmp_27438207;
jump l_27438206
}
1 : { (v_27438621 : Positive) =>
let pureApp_29425675 = unboxInt_309(v_27438621);
tmp_27438197 := pureApp_29425675;
let pureApp_29425676 = show_14(tmp_27438197);
tmp_27438196 := pureApp_29425676;
let utf8StringLiteral_29425678 = "\53\6f\6d\65\28";
let pureApp_29425677 = infixConcat_35(utf8StringLiteral_29425678, tmp_27438196);
tmp_27438195 := pureApp_29425677;
let utf8StringLiteral_29425680 = "\29";
let pureApp_29425679 = infixConcat_35(tmp_27438195, utf8StringLiteral_29425680);
tmp_27438194 := pureApp_29425679;
let pureApp_29425681 = println_1(tmp_27438194);
tmp_27438201 := pureApp_29425681;
v_r_29422183 := tmp_27438201;
jump l_27438206
}
}
def l_27438206(v_r_29422183 : Positive, tmp_27507950 : Positive) = {
let make_29425426 = 0();
tmp_27507259 := make_29425426;
var result_27438316 = tmp_27507259;
val (__29423750 : Positive) = reset {p_27439536 =>
let longLiteral_29425672 = 0;
list_27439529 := tmp_27507950, i_27438315 := longLiteral_29425672;
jump go_27439534};
let s_27439524 = loadVar(result_27438316);
switch s_27439524
0 : { () =>
let utf8StringLiteral_29425651 = "\4e\6f\6e\65\28\29";
let pureApp_29425650 = println_1(utf8StringLiteral_29425651);
tmp_27467480 := pureApp_29425650;
v_r_29423751 := tmp_27467480;
jump l_27467475
}
1 : { (v_27468181 : Positive) =>
let pureApp_29425652 = unboxInt_309(v_27468181);
tmp_27467474 := pureApp_29425652;
let pureApp_29425653 = show_14(tmp_27467474);
tmp_27467477 := pureApp_29425653;
let utf8StringLiteral_29425655 = "\53\6f\6d\65\28";
let pureApp_29425654 = infixConcat_35(utf8StringLiteral_29425655, tmp_27467477);
tmp_27467692 := pureApp_29425654;
let utf8StringLiteral_29425657 = "\29";
let pureApp_29425656 = infixConcat_35(tmp_27467692, utf8StringLiteral_29425657);
tmp_27468731 := pureApp_29425656;
let pureApp_29425658 = println_1(tmp_27468731);
tmp_27468730 := pureApp_29425658;
v_r_29423751 := tmp_27468730;
jump l_27467475
}
}
def go_27439534(list_27439529 : Positive, i_27438315 : Int, p_27439536 : Prompt, result_27438316 : Positive*) = {
switch list_27439529
0 : { () =>
let unitLiteral_29425660 = 0();
return unitLiteral_29425660
}
1 : { (head_27439525 : Positive, tail_27439535 : Positive) =>
let pureApp_29425661 = boxInt_307(i_27438315);
tmp_27438262 := pureApp_29425661;
val (__29423749 : Positive) = shift p_27439536 {k_27439522 =>
let pureApp_29425664 = unboxInt_309(tmp_27438262);
tmp_27438637 := pureApp_29425664;
let utf8StringLiteral_29425666 = "\61";
let pureApp_29425665 = infixEq_84(utf8StringLiteral_29425666, head_27439525);
tmp_27438636 := pureApp_29425665;
switch tmp_27438636
0 : { () =>
resume k_27439522;
let unitLiteral_29425667 = 0();
return unitLiteral_29425667
}
1 : { () =>
let pureApp_29425668 = boxInt_307(tmp_27438637);
tmp_27438635 := pureApp_29425668;
let make_29425669 = 1(tmp_27438635);
tmp_27439338 := make_29425669;
storeVar(result_27438316, tmp_27439338);
let unitLiteral_29425671 = 0();
return unitLiteral_29425671
}};
let longLiteral_29425663 = 1;
let pureApp_29425662 = infixAdd_96(i_27438315, longLiteral_29425663);
tmp_27439345 := pureApp_29425662;
list_27439529 := tail_27439535, i_27438315 := tmp_27439345;
jump go_27439534
}
}
def l_27467475(v_r_29423751 : Positive, tmp_27507950 : Positive) = {
let make_29425428 = 0();
tmp_27466338 := make_29425428;
var result_27468188 = tmp_27466338;
val (__29424534 : Positive) = {
let longLiteral_29425649 = 0;
list_27468226 := tmp_27507950, i_27468232 := longLiteral_29425649;
jump go_27468135
};
let s_27467566 = loadVar(result_27468188);
switch s_27467566
0 : { () =>
let utf8StringLiteral_29425641 = "\4e\6f\6e\65\28\29";
let pureApp_29425640 = println_1(utf8StringLiteral_29425641);
tmp_27461283 := pureApp_29425640;
v_r_29424535 := tmp_27461283;
jump l_27461134
}
1 : { (v_27461681 : Positive) =>
let pureApp_29425642 = unboxInt_309(v_27461681);
tmp_27461137 := pureApp_29425642;
let pureApp_29425643 = show_14(tmp_27461137);
tmp_27461236 := pureApp_29425643;
let utf8StringLiteral_29425645 = "\53\6f\6d\65\28";
let pureApp_29425644 = infixConcat_35(utf8StringLiteral_29425645, tmp_27461236);
tmp_27461738 := pureApp_29425644;
let utf8StringLiteral_29425647 = "\29";
let pureApp_29425646 = infixConcat_35(tmp_27461738, utf8StringLiteral_29425647);
tmp_27461741 := pureApp_29425646;
let pureApp_29425648 = println_1(tmp_27461741);
tmp_27463072 := pureApp_29425648;
v_r_29424535 := tmp_27463072;
jump l_27461134
}
}
def l_27461134(v_r_29424535 : Positive, tmp_27507950 : Positive) = {
let make_29425442 = 0();
tmp_27461144 := make_29425442;
var result_27462585 = tmp_27461144;
val (__29424926 : Positive) = reset {p_27461274 =>
let longLiteral_29425639 = 0;
list_27462582 := tmp_27507950, i_27461276 := longLiteral_29425639;
jump go_27461712};
let s_27461268 = loadVar(result_27462585);
switch s_27461268
0 : { () =>
let utf8StringLiteral_29425618 = "\4e\6f\6e\65\28\29";
let pureApp_29425617 = println_1(utf8StringLiteral_29425618);
tmp_27466239 := pureApp_29425617;
v_r_29424927 := tmp_27466239;
jump l_27465886
}
1 : { (v_27465792 : Positive) =>
let pureApp_29425619 = unboxInt_309(v_27465792);
tmp_27466376 := pureApp_29425619;
let pureApp_29425620 = show_14(tmp_27466376);
tmp_27466371 := pureApp_29425620;
let utf8StringLiteral_29425622 = "\53\6f\6d\65\28";
let pureApp_29425621 = infixConcat_35(utf8StringLiteral_29425622, tmp_27466371);
tmp_27466370 := pureApp_29425621;
let utf8StringLiteral_29425624 = "\29";
let pureApp_29425623 = infixConcat_35(tmp_27466370, utf8StringLiteral_29425624);
tmp_27466573 := pureApp_29425623;
let pureApp_29425625 = println_1(tmp_27466573);
tmp_27466993 := pureApp_29425625;
v_r_29424927 := tmp_27466993;
jump l_27465886
}
}
def go_27461712(list_27462582 : Positive, i_27461276 : Int, result_27462585 : Positive*, p_27461274 : Prompt) = {
switch list_27462582
0 : { () =>
let unitLiteral_29425627 = 0();
return unitLiteral_29425627
}
1 : { (head_27461707 : Positive, tail_27461277 : Positive) =>
let pureApp_29425628 = boxInt_307(i_27461276);
tmp_27463110 := pureApp_29425628;
val (__29424925 : Positive) = shift p_27461274 {k_27461279 =>
let pureApp_29425631 = unboxInt_309(tmp_27463110);
tmp_27463113 := pureApp_29425631;
let utf8StringLiteral_29425633 = "\6e";
let pureApp_29425632 = infixEq_84(utf8StringLiteral_29425633, head_27461707);
tmp_27461740 := pureApp_29425632;
switch tmp_27461740
0 : { () =>
resume k_27461279;
let unitLiteral_29425634 = 0();
return unitLiteral_29425634
}
1 : { () =>
let pureApp_29425635 = boxInt_307(tmp_27463113);
tmp_27461247 := pureApp_29425635;
let make_29425636 = 1(tmp_27461247);
tmp_27461242 := make_29425636;
storeVar(result_27462585, tmp_27461242);
let unitLiteral_29425638 = 0();
return unitLiteral_29425638
}};
let longLiteral_29425630 = 1;
let pureApp_29425629 = infixAdd_96(i_27461276, longLiteral_29425630);
tmp_27461245 := pureApp_29425629;
list_27462582 := tail_27461277, i_27461276 := tmp_27461245;
jump go_27461712
}
}
def l_27465886(v_r_29424927 : Positive, tmp_27507950 : Positive) = {
let make_29425444 = 0();
tmp_27465734 := make_29425444;
var result_27465953 = tmp_27465734;
val (__29425122 : Positive) = {
let longLiteral_29425616 = 0;
list_27465791 := tmp_27507950, i_27466732 := longLiteral_29425616;
jump go_27465787
};
let s_27465950 = loadVar(result_27465953);
switch s_27465950
0 : { () =>
let utf8StringLiteral_29425608 = "\4e\6f\6e\65\28\29";
let pureApp_29425607 = println_1(utf8StringLiteral_29425608);
tmp_27459884 := pureApp_29425607;
v_r_29425123 := tmp_27459884;
jump l_27460183
}
1 : { (v_27459220 : Positive) =>
let pureApp_29425609 = unboxInt_309(v_27459220);
tmp_27460082 := pureApp_29425609;
let pureApp_29425610 = show_14(tmp_27460082);
tmp_27459805 := pureApp_29425610;
let utf8StringLiteral_29425612 = "\53\6f\6d\65\28";
let pureApp_29425611 = infixConcat_35(utf8StringLiteral_29425612, tmp_27459805);
tmp_27459592 := pureApp_29425611;
let utf8StringLiteral_29425614 = "\29";
let pureApp_29425613 = infixConcat_35(tmp_27459592, utf8StringLiteral_29425614);
tmp_27459185 := pureApp_29425613;
let pureApp_29425615 = println_1(tmp_27459185);
tmp_27459804 := pureApp_29425615;
v_r_29425123 := tmp_27459804;
jump l_27460183
}
}
def l_27460183(v_r_29425123 : Positive, tmp_27507950 : Positive) = {
let make_29425458 = 0();
tmp_27459668 := make_29425458;
var result_27459179 = tmp_27459668;
val (__29425220 : Positive) = reset {p_27459273 =>
let longLiteral_29425606 = 0;
list_27459808 := tmp_27507950, i_27459798 := longLiteral_29425606;
jump go_27459946};
let s_27459586 = loadVar(result_27459179);
switch s_27459586
0 : { () =>
let utf8StringLiteral_29425585 = "\4e\6f\6e\65\28\29";
let pureApp_29425584 = println_1(utf8StringLiteral_29425585);
tmp_27460366 := pureApp_29425584;
v_r_29425221 := tmp_27460366;
jump l_27460515
}
1 : { (v_27460539 : Positive) =>
let pureApp_29425586 = unboxInt_309(v_27460539);
tmp_27460536 := pureApp_29425586;
let pureApp_29425587 = show_14(tmp_27460536);
tmp_27460981 := pureApp_29425587;
let utf8StringLiteral_29425589 = "\53\6f\6d\65\28";
let pureApp_29425588 = infixConcat_35(utf8StringLiteral_29425589, tmp_27460981);
tmp_27460514 := pureApp_29425588;
let utf8StringLiteral_29425591 = "\29";
let pureApp_29425590 = infixConcat_35(tmp_27460514, utf8StringLiteral_29425591);
tmp_27460551 := pureApp_29425590;
let pureApp_29425592 = println_1(tmp_27460551);
tmp_27459980 := pureApp_29425592;
v_r_29425221 := tmp_27459980;
jump l_27460515
}
}
def go_27459946(list_27459808 : Positive, i_27459798 : Int, result_27459179 : Positive*, p_27459273 : Prompt) = {
switch list_27459808
0 : { () =>
let unitLiteral_29425594 = 0();
return unitLiteral_29425594
}
1 : { (head_27459587 : Positive, tail_27459631 : Positive) =>
let pureApp_29425595 = boxInt_307(i_27459798);
tmp_27459175 := pureApp_29425595;
val (__29425219 : Positive) = shift p_27459273 {k_27459797 =>
let pureApp_29425598 = unboxInt_309(tmp_27459175);
tmp_27459266 := pureApp_29425598;
let utf8StringLiteral_29425600 = "\73";
let pureApp_29425599 = infixEq_84(utf8StringLiteral_29425600, head_27459587);
tmp_27459885 := pureApp_29425599;
switch tmp_27459885
0 : { () =>
resume k_27459797;
let unitLiteral_29425601 = 0();
return unitLiteral_29425601
}
1 : { () =>
let pureApp_29425602 = boxInt_307(tmp_27459266);
tmp_27459672 := pureApp_29425602;
let make_29425603 = 1(tmp_27459672);
tmp_27459675 := make_29425603;
storeVar(result_27459179, tmp_27459675);
let unitLiteral_29425605 = 0();
return unitLiteral_29425605
}};
let longLiteral_29425597 = 1;
let pureApp_29425596 = infixAdd_96(i_27459798, longLiteral_29425597);
tmp_27459974 := pureApp_29425596;
list_27459808 := tail_27459631, i_27459798 := tmp_27459974;
jump go_27459946
}
}
def l_27460515(v_r_29425221 : Positive, tmp_27507950 : Positive) = {
let make_29425460 = 0();
tmp_27460868 := make_29425460;
var result_27459558 = tmp_27460868;
val (__29425269 : Positive) = {
let longLiteral_29425583 = 0;
list_27460410 := tmp_27507950, i_27460413 := longLiteral_29425583;
jump go_27460415
};
let s_27460068 = loadVar(result_27459558);
switch s_27460068
0 : { () =>
let utf8StringLiteral_29425575 = "\4e\6f\6e\65\28\29";
let pureApp_29425574 = println_1(utf8StringLiteral_29425575);
tmp_27459617 := pureApp_29425574;
__29425270 := tmp_27459617;
jump l_27460172
}
1 : { (v_27460467 : Positive) =>
let pureApp_29425576 = unboxInt_309(v_27460467);
tmp_27459103 := pureApp_29425576;
let pureApp_29425577 = show_14(tmp_27459103);
tmp_27459890 := pureApp_29425577;
let utf8StringLiteral_29425579 = "\53\6f\6d\65\28";
let pureApp_29425578 = infixConcat_35(utf8StringLiteral_29425579, tmp_27459890);
tmp_27459893 := pureApp_29425578;
let utf8StringLiteral_29425581 = "\29";
let pureApp_29425580 = infixConcat_35(tmp_27459893, utf8StringLiteral_29425581);
tmp_27459904 := pureApp_29425580;
let pureApp_29425582 = println_1(tmp_27459904);
tmp_27461421 := pureApp_29425582;
__29425270 := tmp_27461421;
jump l_27460172
}
}
def l_27460172(__29425270 : Positive, tmp_27507950 : Positive) = {
let utf8StringLiteral_29425475 = "";
let pureApp_29425474 = println_1(utf8StringLiteral_29425475);
tmp_29425271 := pureApp_29425474;
let make_29425476 = 0();
tmp_27461164 := make_29425476;
var result_27458753 = tmp_27461164;
val (__29425294 : Positive) = reset {p_27459144 =>
let longLiteral_29425573 = 0;
list_27460550 := tmp_27507950, i_27459846 := longLiteral_29425573;
jump go_27459098};
let s_27459207 = loadVar(result_27458753);
switch s_27459207
0 : { () =>
let utf8StringLiteral_29425552 = "\4e\6f\6e\65\28\29";
let pureApp_29425551 = println_1(utf8StringLiteral_29425552);
tmp_27461340 := pureApp_29425551;
v_r_29425295 := tmp_27461340;
jump l_27461625
}
1 : { (v_27461627 : Positive) =>
let pureApp_29425553 = unboxInt_309(v_27461627);
tmp_27461622 := pureApp_29425553;
let pureApp_29425554 = show_14(tmp_27461622);
tmp_27460211 := pureApp_29425554;
let utf8StringLiteral_29425556 = "\53\6f\6d\65\28";
let pureApp_29425555 = infixConcat_35(utf8StringLiteral_29425556, tmp_27460211);
tmp_27461332 := pureApp_29425555;
let utf8StringLiteral_29425558 = "\29";
let pureApp_29425557 = infixConcat_35(tmp_27461332, utf8StringLiteral_29425558);
tmp_27460721 := pureApp_29425557;
let pureApp_29425559 = println_1(tmp_27460721);
tmp_27460718 := pureApp_29425559;
v_r_29425295 := tmp_27460718;
jump l_27461625
}
}
def go_27459098(list_27460550 : Positive, i_27459846 : Int, result_27458753 : Positive*, p_27459144 : Prompt) = {
switch list_27460550
0 : { () =>
let unitLiteral_29425561 = 0();
return unitLiteral_29425561
}
1 : { (head_27459101 : Positive, tail_27459849 : Positive) =>
let pureApp_29425562 = boxInt_307(i_27459846);
tmp_27460619 := pureApp_29425562;
val (__29425293 : Positive) = shift p_27459144 {k_27460052 =>
let pureApp_29425565 = unboxInt_309(tmp_27460619);
tmp_27459138 := pureApp_29425565;
let utf8StringLiteral_29425567 = "\6e\61";
let pureApp_29425566 = infixEq_84(utf8StringLiteral_29425567, head_27459101);
tmp_27459141 := pureApp_29425566;
switch tmp_27459141
0 : { () =>
resume k_27460052;
let unitLiteral_29425568 = 0();
return unitLiteral_29425568
}
1 : { () =>
let pureApp_29425569 = boxInt_307(tmp_27459138);
tmp_27460560 := pureApp_29425569;
let make_29425570 = 1(tmp_27460560);
tmp_27460059 := make_29425570;
storeVar(result_27458753, tmp_27460059);
let unitLiteral_29425572 = 0();
return unitLiteral_29425572
}};
let longLiteral_29425564 = 1;
let pureApp_29425563 = infixAdd_96(i_27459846, longLiteral_29425564);
tmp_27460555 := pureApp_29425563;
list_27460550 := tail_27459849, i_27459846 := tmp_27460555;
jump go_27459098
}
}
def l_27461625(v_r_29425295 : Positive, tmp_27507950 : Positive) = {
let make_29425478 = 0();
tmp_27461619 := make_29425478;
var result_27461482 = tmp_27461619;
val (__29425306 : Positive) = {
let longLiteral_29425550 = 0;
list_27462093 := tmp_27507950, i_27460757 := longLiteral_29425550;
jump go_27461123
};
let s_27462056 = loadVar(result_27461482);
switch s_27462056
0 : { () =>
let utf8StringLiteral_29425542 = "\4e\6f\6e\65\28\29";
let pureApp_29425541 = println_1(utf8StringLiteral_29425542);
tmp_27460765 := pureApp_29425541;
v_r_29425307 := tmp_27460765;
jump l_27461258
}
1 : { (v_27460500 : Positive) =>
let pureApp_29425543 = unboxInt_309(v_27460500);
tmp_27462597 := pureApp_29425543;
let pureApp_29425544 = show_14(tmp_27462597);
tmp_27461376 := pureApp_29425544;
let utf8StringLiteral_29425546 = "\53\6f\6d\65\28";
let pureApp_29425545 = infixConcat_35(utf8StringLiteral_29425546, tmp_27461376);
tmp_27461371 := pureApp_29425545;
let utf8StringLiteral_29425548 = "\29";
let pureApp_29425547 = infixConcat_35(tmp_27461371, utf8StringLiteral_29425548);
tmp_27461417 := pureApp_29425547;
let pureApp_29425549 = println_1(tmp_27461417);
tmp_27462015 := pureApp_29425549;
v_r_29425307 := tmp_27462015;
jump l_27461258
}
}
def l_27461258(v_r_29425307 : Positive, tmp_27507950 : Positive) = {
let make_29425492 = 0();
tmp_27461166 := make_29425492;
var result_27459887 = tmp_27461166;
val (__29425312 : Positive) = reset {p_27460553 =>
let longLiteral_29425540 = 0;
list_27459843 := tmp_27507950, i_27459845 := longLiteral_29425540;
jump go_27460287};
let s_27461457 = loadVar(result_27459887);
switch s_27461457
0 : { () =>
let utf8StringLiteral_29425519 = "\4e\6f\6e\65\28\29";
let pureApp_29425518 = println_1(utf8StringLiteral_29425519);
tmp_27461111 := pureApp_29425518;
v_r_29425313 := tmp_27461111;
jump l_27460282
}
1 : { (v_27460776 : Positive) =>
let pureApp_29425520 = unboxInt_309(v_27460776);
tmp_27461454 := pureApp_29425520;
let pureApp_29425521 = show_14(tmp_27461454);
tmp_27459242 := pureApp_29425521;
let utf8StringLiteral_29425523 = "\53\6f\6d\65\28";
let pureApp_29425522 = infixConcat_35(utf8StringLiteral_29425523, tmp_27459242);
tmp_27458699 := pureApp_29425522;
let utf8StringLiteral_29425525 = "\29";
let pureApp_29425524 = infixConcat_35(tmp_27458699, utf8StringLiteral_29425525);
tmp_27460755 := pureApp_29425524;
let pureApp_29425526 = println_1(tmp_27460755);
tmp_27461588 := pureApp_29425526;
v_r_29425313 := tmp_27461588;
jump l_27460282
}
}
def go_27460287(list_27459843 : Positive, i_27459845 : Int, p_27460553 : Prompt, result_27459887 : Positive*) = {
switch list_27459843
0 : { () =>
let unitLiteral_29425528 = 0();
return unitLiteral_29425528
}
1 : { (head_27459318 : Positive, tail_27460284 : Positive) =>
let pureApp_29425529 = boxInt_307(i_27459845);
tmp_27462098 := pureApp_29425529;
val (__29425311 : Positive) = shift p_27460553 {k_27460504 =>
let pureApp_29425532 = unboxInt_309(tmp_27462098);
tmp_27461347 := pureApp_29425532;
let utf8StringLiteral_29425534 = "";
let pureApp_29425533 = infixEq_84(utf8StringLiteral_29425534, head_27459318);
tmp_27461999 := pureApp_29425533;
switch tmp_27461999
0 : { () =>
resume k_27460504;
let unitLiteral_29425535 = 0();
return unitLiteral_29425535
}
1 : { () =>
let pureApp_29425536 = boxInt_307(tmp_27461347);
tmp_27460758 := pureApp_29425536;
let make_29425537 = 1(tmp_27460758);
tmp_27460756 := make_29425537;
storeVar(result_27459887, tmp_27460756);
let unitLiteral_29425539 = 0();
return unitLiteral_29425539
}};
let longLiteral_29425531 = 1;
let pureApp_29425530 = infixAdd_96(i_27459845, longLiteral_29425531);
tmp_27460754 := pureApp_29425530;
list_27459843 := tail_27460284, i_27459845 := tmp_27460754;
jump go_27460287
}
}
def l_27460282(v_r_29425313 : Positive, tmp_27507950 : Positive) = {
let make_29425494 = 0();
tmp_27461879 := make_29425494;
var result_27461228 = tmp_27461879;
val (__29425315 : Positive) = {
let longLiteral_29425517 = 0;
list_27460733 := tmp_27507950, i_27462547 := longLiteral_29425517;
jump go_27461971
};
let s_27461931 = loadVar(result_27461228);
switch s_27461931
0 : { () =>
let utf8StringLiteral_29425509 = "\4e\6f\6e\65\28\29";
let pureApp_29425508 = println_1(utf8StringLiteral_29425509);
tmp_27462092 := pureApp_29425508;
return tmp_27462092
}
1 : { (v_27459317 : Positive) =>
let pureApp_29425510 = unboxInt_309(v_27459317);
tmp_27462550 := pureApp_29425510;
let pureApp_29425511 = show_14(tmp_27462550);
tmp_27462073 := pureApp_29425511;
let utf8StringLiteral_29425513 = "\53\6f\6d\65\28";
let pureApp_29425512 = infixConcat_35(utf8StringLiteral_29425513, tmp_27462073);
tmp_27462101 := pureApp_29425512;
let utf8StringLiteral_29425515 = "\29";
let pureApp_29425514 = infixConcat_35(tmp_27462101, utf8StringLiteral_29425515);
tmp_27461414 := pureApp_29425514;
let pureApp_29425516 = println_1(tmp_27461414);
tmp_27461122 := pureApp_29425516;
return tmp_27461122
}
}
def go_27461971(list_27460733 : Positive, i_27462547 : Int, result_27461228 : Positive*) = {
switch list_27460733
0 : { () =>
let unitLiteral_29425496 = 0();
return unitLiteral_29425496
}
1 : { (head_27461902 : Positive, tail_27461936 : Positive) =>
let pureApp_29425497 = boxInt_307(i_27462547);
tmp_27462069 := pureApp_29425497;
let pureApp_29425498 = unboxInt_309(tmp_27462069);
tmp_27461261 := pureApp_29425498;
let utf8StringLiteral_29425500 = "";
let pureApp_29425499 = infixEq_84(utf8StringLiteral_29425500, head_27461902);
tmp_27461871 := pureApp_29425499;
switch tmp_27461871
0 : { () =>
let longLiteral_29425502 = 1;
let pureApp_29425501 = infixAdd_96(i_27462547, longLiteral_29425502);
tmp_27462090 := pureApp_29425501;
list_27460733 := tail_27461936, i_27462547 := tmp_27462090;
jump go_27461971
}
1 : { () =>
let pureApp_29425503 = boxInt_307(tmp_27461261);
tmp_27461167 := pureApp_29425503;
let make_29425504 = 1(tmp_27461167);
tmp_27461935 := make_29425504;
storeVar(result_27461228, tmp_27461935);
let longLiteral_29425507 = 1;
let pureApp_29425506 = infixAdd_96(i_27462547, longLiteral_29425507);
tmp_27461976 := pureApp_29425506;
list_27460733 := tail_27461936, i_27462547 := tmp_27461976;
jump go_27461971
}
}
}
def go_27461123(list_27462093 : Positive, i_27460757 : Int, result_27461482 : Positive*) = {
switch list_27462093
0 : { () =>
let unitLiteral_29425480 = 0();
return unitLiteral_29425480
}
1 : { (head_27462078 : Positive, tail_27462012 : Positive) =>
let pureApp_29425481 = boxInt_307(i_27460757);
tmp_27462589 := pureApp_29425481;
let pureApp_29425482 = unboxInt_309(tmp_27462589);
tmp_27462586 := pureApp_29425482;
let utf8StringLiteral_29425484 = "\6e\61";
let pureApp_29425483 = infixEq_84(utf8StringLiteral_29425484, head_27462078);
tmp_27460744 := pureApp_29425483;
switch tmp_27460744
0 : { () =>
let longLiteral_29425486 = 1;
let pureApp_29425485 = infixAdd_96(i_27460757, longLiteral_29425486);
tmp_27460058 := pureApp_29425485;
list_27462093 := tail_27462012, i_27460757 := tmp_27460058;
jump go_27461123
}
1 : { () =>
let pureApp_29425487 = boxInt_307(tmp_27462586);
tmp_27461128 := pureApp_29425487;
let make_29425488 = 1(tmp_27461128);
tmp_27461621 := make_29425488;
storeVar(result_27461482, tmp_27461621);
let longLiteral_29425491 = 1;
let pureApp_29425490 = infixAdd_96(i_27460757, longLiteral_29425491);
tmp_27459970 := pureApp_29425490;
list_27462093 := tail_27462012, i_27460757 := tmp_27459970;
jump go_27461123
}
}
}
def go_27460415(list_27460410 : Positive, i_27460413 : Int, result_27459558 : Positive*) = {
switch list_27460410
0 : { () =>
let unitLiteral_29425462 = 0();
return unitLiteral_29425462
}
1 : { (head_27460517 : Positive, tail_27459632 : Positive) =>
let pureApp_29425463 = boxInt_307(i_27460413);
tmp_27459679 := pureApp_29425463;
let pureApp_29425464 = unboxInt_309(tmp_27459679);
tmp_27460356 := pureApp_29425464;
let utf8StringLiteral_29425466 = "\73";
let pureApp_29425465 = infixEq_84(utf8StringLiteral_29425466, head_27460517);
tmp_27460473 := pureApp_29425465;
switch tmp_27460473
0 : { () =>
let longLiteral_29425468 = 1;
let pureApp_29425467 = infixAdd_96(i_27460413, longLiteral_29425468);
tmp_27460240 := pureApp_29425467;
list_27460410 := tail_27459632, i_27460413 := tmp_27460240;
jump go_27460415
}
1 : { () =>
let pureApp_29425469 = boxInt_307(tmp_27460356);
tmp_27460451 := pureApp_29425469;
let make_29425470 = 1(tmp_27460451);
tmp_27460472 := make_29425470;
storeVar(result_27459558, tmp_27460472);
let longLiteral_29425473 = 1;
let pureApp_29425472 = infixAdd_96(i_27460413, longLiteral_29425473);
tmp_27462003 := pureApp_29425472;
list_27460410 := tail_27459632, i_27460413 := tmp_27462003;
jump go_27460415
}
}
}
def go_27465787(list_27465791 : Positive, i_27466732 : Int, result_27465953 : Positive*) = {
switch list_27465791
0 : { () =>
let unitLiteral_29425446 = 0();
return unitLiteral_29425446
}
1 : { (head_27465789 : Positive, tail_27465786 : Positive) =>
let pureApp_29425447 = boxInt_307(i_27466732);
tmp_27465895 := pureApp_29425447;
let pureApp_29425448 = unboxInt_309(tmp_27465895);
tmp_27466278 := pureApp_29425448;
let utf8StringLiteral_29425450 = "\6e";
let pureApp_29425449 = infixEq_84(utf8StringLiteral_29425450, head_27465789);
tmp_27465889 := pureApp_29425449;
switch tmp_27465889
0 : { () =>
let longLiteral_29425452 = 1;
let pureApp_29425451 = infixAdd_96(i_27466732, longLiteral_29425452);
tmp_27458750 := pureApp_29425451;
list_27465791 := tail_27465786, i_27466732 := tmp_27458750;
jump go_27465787
}
1 : { () =>
let pureApp_29425453 = boxInt_307(tmp_27466278);
tmp_27466235 := pureApp_29425453;
let make_29425454 = 1(tmp_27466235);
tmp_27466234 := make_29425454;
storeVar(result_27465953, tmp_27466234);
let longLiteral_29425457 = 1;
let pureApp_29425456 = infixAdd_96(i_27466732, longLiteral_29425457);
tmp_27460499 := pureApp_29425456;
list_27465791 := tail_27465786, i_27466732 := tmp_27460499;
jump go_27465787
}
}
}
def go_27468135(list_27468226 : Positive, i_27468232 : Int, result_27468188 : Positive*) = {
switch list_27468226
0 : { () =>
let unitLiteral_29425430 = 0();
return unitLiteral_29425430
}
1 : { (head_27467569 : Positive, tail_27468227 : Positive) =>
let pureApp_29425431 = boxInt_307(i_27468232);
tmp_27467488 := pureApp_29425431;
let pureApp_29425432 = unboxInt_309(tmp_27467488);
tmp_27467483 := pureApp_29425432;
let utf8StringLiteral_29425434 = "\61";
let pureApp_29425433 = infixEq_84(utf8StringLiteral_29425434, head_27467569);
tmp_27467482 := pureApp_29425433;
switch tmp_27467482
0 : { () =>
let longLiteral_29425436 = 1;
let pureApp_29425435 = infixAdd_96(i_27468232, longLiteral_29425436);
tmp_27458381 := pureApp_29425435;
list_27468226 := tail_27468227, i_27468232 := tmp_27458381;
jump go_27468135
}
1 : { () =>
let pureApp_29425437 = boxInt_307(tmp_27467483);
tmp_27467476 := pureApp_29425437;
let make_29425438 = 1(tmp_27467476);
tmp_27467775 := make_29425438;
storeVar(result_27468188, tmp_27467775);
let longLiteral_29425441 = 1;
let pureApp_29425440 = infixAdd_96(i_27468232, longLiteral_29425441);
tmp_27457656 := pureApp_29425440;
list_27468226 := tail_27468227, i_27468232 := tmp_27457656;
jump go_27468135
}
}
}
def go_27473698(list_27473660 : Positive, i_27473701 : Int, result_27473000 : Positive*) = {
switch list_27473660
0 : { () =>
let unitLiteral_29425414 = 0();
return unitLiteral_29425414
}
1 : { (head_27473699 : Positive, tail_27473710 : Positive) =>
let pureApp_29425415 = boxInt_307(i_27473701);
tmp_27472955 := pureApp_29425415;
let pureApp_29425416 = unboxInt_309(tmp_27472955);
tmp_27473320 := pureApp_29425416;
let utf8StringLiteral_29425418 = "\62";
let pureApp_29425417 = infixEq_84(utf8StringLiteral_29425418, head_27473699);
tmp_27473321 := pureApp_29425417;
switch tmp_27473321
0 : { () =>
let longLiteral_29425420 = 1;
let pureApp_29425419 = infixAdd_96(i_27473701, longLiteral_29425420);
tmp_27507244 := pureApp_29425419;
list_27473660 := tail_27473710, i_27473701 := tmp_27507244;
jump go_27473698
}
1 : { () =>
let pureApp_29425421 = boxInt_307(tmp_27473320);
tmp_27473114 := pureApp_29425421;
let make_29425422 = 1(tmp_27473114);
tmp_27473119 := make_29425422;
storeVar(result_27473000, tmp_27473119);
let longLiteral_29425425 = 1;
let pureApp_29425424 = infixAdd_96(i_27473701, longLiteral_29425425);
tmp_27507245 := pureApp_29425424;
list_27473660 := tail_27473710, i_27473701 := tmp_27507245;
jump go_27473698
}
}
}
def go_27266934(list_27266931 : Positive, i_27266935 : Int, result_27266936 : Positive*) = {
switch list_27266931
0 : { () =>
let unitLiteral_29425381 = 0();
return unitLiteral_29425381
}
1 : { (head_27266933 : Positive, tail_27266930 : Positive) =>
let pureApp_29425382 = boxInt_307(i_27266935);
tmp_27267474 := pureApp_29425382;
let pureApp_29425383 = unboxInt_309(tmp_27267474);
tmp_27267477 := pureApp_29425383;
let utf8StringLiteral_29425385 = "\65";
let pureApp_29425384 = infixEq_84(utf8StringLiteral_29425385, head_27266933);
tmp_27267476 := pureApp_29425384;
switch tmp_27267476
0 : { () =>
let longLiteral_29425387 = 1;
let pureApp_29425386 = infixAdd_96(i_27266935, longLiteral_29425387);
tmp_27404308 := pureApp_29425386;
list_27266931 := tail_27266930, i_27266935 := tmp_27404308;
jump go_27266934
}
1 : { () =>
let pureApp_29425388 = boxInt_307(tmp_27267477);
tmp_27267330 := pureApp_29425388;
let make_29425389 = 1(tmp_27267330);
tmp_27267333 := make_29425389;
storeVar(result_27266936, tmp_27267333);
let longLiteral_29425392 = 1;
let pureApp_29425391 = infixAdd_96(i_27266935, longLiteral_29425392);
tmp_27404319 := pureApp_29425391;
list_27266931 := tail_27266930, i_27266935 := tmp_27404319;
jump go_27266934
}
}
}
def go_28920967(list_28921676 : Positive, i_28921673 : Int, result_28921675 : Positive*) = {
switch list_28921676
0 : { () =>
let unitLiteral_29425352 = 0();
return unitLiteral_29425352
}
1 : { (head_28920987 : Positive, tail_28920990 : Positive) =>
let pureApp_29425353 = boxInt_307(i_28921673);
tmp_28921744 := pureApp_29425353;
let pureApp_29425354 = unboxInt_309(tmp_28921744);
tmp_28921713 := pureApp_29425354;
let utf8StringLiteral_29425356 = "\65";
let pureApp_29425355 = infixEq_84(utf8StringLiteral_29425356, head_28920987);
tmp_28921354 := pureApp_29425355;
switch tmp_28921354
0 : { () =>
let longLiteral_29425358 = 1;
let pureApp_29425357 = infixAdd_96(i_28921673, longLiteral_29425358);
tmp_27266387 := pureApp_29425357;
list_28921676 := tail_28920990, i_28921673 := tmp_27266387;
jump go_28920967
}
1 : { () =>
let pureApp_29425359 = boxInt_307(tmp_28921713);
tmp_28921356 := pureApp_29425359;
let make_29425360 = 1(tmp_28921356);
tmp_28921741 := make_29425360;
storeVar(result_28921675, tmp_28921741);
let longLiteral_29425363 = 1;
let pureApp_29425362 = infixAdd_96(i_28921673, longLiteral_29425363);
tmp_27266386 := pureApp_29425362;
list_28921676 := tail_28920990, i_28921673 := tmp_27266386;
jump go_28920967
}
}
}
def go_24610825(list_24610837 : Positive, i_24610840 : Int, result_24610838 : Positive*) = {
switch list_24610837
0 : { () =>
let unitLiteral_29425321 = 0();
return unitLiteral_29425321
}
1 : { (head_24610836 : Positive, tail_24610839 : Positive) =>
let pureApp_29425322 = boxInt_307(i_24610840);
tmp_24611543 := pureApp_29425322;
let pureApp_29425323 = unboxInt_309(tmp_24611543);
tmp_24611534 := pureApp_29425323;
let utf8StringLiteral_29425325 = "\65";
let pureApp_29425324 = infixEq_84(utf8StringLiteral_29425325, head_24610836);
tmp_24611533 := pureApp_29425324;
switch tmp_24611533
0 : { () =>
let longLiteral_29425327 = 1;
let pureApp_29425326 = infixAdd_96(i_24610840, longLiteral_29425327);
tmp_26817357 := pureApp_29425326;
list_24610837 := tail_24610839, i_24610840 := tmp_26817357;
jump go_24610825
}
1 : { () =>
let pureApp_29425328 = boxInt_307(tmp_24611534);
tmp_24611531 := pureApp_29425328;
let make_29425329 = 1(tmp_24611531);
tmp_24611538 := make_29425329;
storeVar(result_24610838, tmp_24611538);
let longLiteral_29425332 = 1;
let pureApp_29425331 = infixAdd_96(i_24610840, longLiteral_29425332);
tmp_26817356 := pureApp_29425331;
list_24610837 := tail_24610839, i_24610840 := tmp_26817356;
jump go_24610825
}
}
} |
Warning
Blocked on #858
Here are some simple reusable helper functions inspired by ones used in the EPE students' projects.