diff --git a/doc/book.html b/doc/book.html index b12980d95..154c2c059 100644 --- a/doc/book.html +++ b/doc/book.html @@ -1909,7 +1909,7 @@

control (ctl) operation to yield intstd/core/types/int: V values:

effect yield
   ctl yield( i : int ) : bool
-effectwhy/yield: (E, V) -> V yieldwhy/yield: (E, V) -> V
+effectwhy/yield: (E, V) -> V yieldwhy/yield: (E, V) -> V
   ctl yield( ii: int : intstd/core/types/int: V ) : boolstd/core/types/bool: V
 
@@ -2535,7 +2535,7 @@

// declare an abstract operation: emit, how it emits is defined dynamically by a handler. -effecttour/emit: (E, V) -> V fun emittour/emit: (E, V) -> V(msgmsg: string : stringstd/core/types/string: V) : (std/core/types/unit: V)std/core/types/unit: V +effecttour/emit: (E, V) -> V fun emittour/emit: (E, V) -> V(msgmsg: string : stringstd/core/types/string: V) : (std/core/types/unit: V)std/core/types/unit: V // emit a standard greeting. fun hellotour/hello: () -> emit ()()result: -> emit () : emittour/emit: (E, V) -> V (std/core/types/unit: V)std/core/types/unit: V @@ -2646,7 +2646,12 @@

Here is a slightly larger program inspired by an example in Graham Hutton's most excellent "Programming in Haskell" book: -

fun main()
+

import std/num/float64
+import std/num/float64std/num/float64
+
+ + +
fun main()
   test-uncaesar()
 
 fun encode( s : string, shift : int )
@@ -3112,9 +3117,10 @@ 

Special cases of these enumerated types are the voidstd/core/types/void: V type which has no alternatives (and therefore there exists no value with this type), the unit -type (()) which has just one constructor, also written as () (and -therefore, there exists only one value with the type (()), namely ()), and +type unitstd/core/types/unit: V which has just one constructor Unitstd/core/types/Unit: () (and +therefore, there exists only one value with the type unitstd/core/types/unit: V, namely Unitstd/core/types/Unit: ()), and finally the boolean type boolstd/core/types/bool: V with two constructors Truestd/core/types/True: bool and Falsestd/core/types/False: bool. +As a short-hand, we can also write () for the unitstd/core/types/unit: V type, and () for the Unitstd/core/types/Unit: () constructor.

type void
 
 type ()
@@ -3221,7 +3227,7 @@ 

3.3.6. Inductive, Co-inductive, and Recursive Types

For the purposes of equational reasoning and termination checking, a type declaration is limited to finite inductive types. There are two more -declarations, namely co type and rec type that allow for co-inductive types, +declarations, namely co type and div type that allow for co-inductive types, and arbitrary recursive types respectively.

3.3.7. Value Types

Value types are (non-recursive) data types that are not heap allocated @@ -3238,7 +3244,7 @@

We can also force a type to be compiled as a value type by using the value keyword in front of a type or struct declaration:

value struct argb{ alpha: int; color-red: int; color-green: int; color-blue: int }
-value struct argbtour/argb: V{ alphatour/argb/alpha: (argb : argb) -> int: intstd/core/types/int: V; color-redtour/argb/color-red: (argb : argb) -> int: intstd/core/types/int: V; color-greentour/argb/color-green: (argb : argb) -> int: intstd/core/types/int: V; color-bluetour/argb/color-blue: (argb : argb) -> int: intstd/core/types/int: V }
+value struct argbtour/argb: V{ alphatour/argb/alpha: (argb : argb) -> int: intstd/core/types/int: V; color-redtour/argb/color-red: (argb : argb) -> int: intstd/core/types/int: V; color-greentour/argb/color-green: (argb : argb) -> int: intstd/core/types/int: V; color-bluetour/argb/color-blue: (argb : argb) -> int: intstd/core/types/int: V }
 
@@ -3289,7 +3295,7 @@

control (ctl) operation:

effect raise
   ctl raise( msg : string ) : a
-effecttour/raise: (E, V) -> V raisetour/raise: (E, V) -> V
+effecttour/raise: (E, V) -> V raisetour/raise: (E, V) -> V
   ctl raise( msgmsg: string : stringstd/core/types/string: V ) : aa: V
 
@@ -3406,7 +3412,7 @@

effecttour/ask: (V, E, V) -> V asktour/ask: (V, E, V) -> V<aa: V> // or: effect<a> ctl ask() : a +effecttour/ask: (V, E, V) -> V asktour/ask: (V, E, V) -> V<aa: V> // or: effect<a> ctl ask() : a ctl ask() : aa: V fun add-twicetour/add-twice: () -> (ask<int>) int()result: -> (ask<int>) int : asktour/ask: (V, E, V) -> V<intstd/core/types/int: V> intstd/core/types/int: V @@ -3440,7 +3446,7 @@

where ask-randomtour/ask-random: () -> random int() now handled the asktour/ask: (V, E, V) -> V<intstd/core/types/int: V> effect, but itself now has -randomstd/num/random/random: (E, V) -> V effect (see std/num/random). +randomstd/num/random/random: (E, V) -> V effect (see std/num/randomstd/num/random). The resumestd/core/hnd/resume: forall<a,e,e1,b> (r : resume-context<a,e,e1,b>, x : a) -> e b function is implicitly bound by a ctl operation and resumes back to the call-site with the given result.

@@ -3590,7 +3596,7 @@

Or, we can define it as a value operation instead:

effect val width : int
-effecttour/width: (E, V) -> V val widthtour/width: (E, V) -> V : intstd/core/types/int: V
+effecttour/width: (E, V) -> V val widthtour/width: (E, V) -> V : intstd/core/types/int: V
 
@@ -3715,7 +3721,7 @@

fun emit-collecttour/emit-collect: forall<e> (action : () -> <emit|e> ()) -> e string( actionaction: () -> <emit|$5629> () : () -> <emittour/emit: (E, V) -> V|std/core/types/effect-extend: (X, E) -> Eee: E> (std/core/types/unit: V)std/core/types/unit: V )result: -> 5916 string : ee: E stringstd/core/types/string: V +fun emit-collecttour/emit-collect: forall<e> (action : () -> <emit|e> ()) -> e string( actionaction: () -> <emit|$5629> () : () -> <emittour/emit: (E, V) -> V|std/core/types/effect-extend: (X, E) -> Eee: E> (std/core/types/unit: V)std/core/types/unit: V )result: -> 5916 string : ee: E stringstd/core/types/string: V var lineslines: local-var<$5638,list<string>> := [std/core/types/Nil: forall<a> list<a>]std/core/types/Nil: forall<a> list<a> withwith: () -> <emit|$5629> () handlerhandler: (() -> <emit,local<$5638>|$5629> ()) -> <local<$5638>|$5629> string returnreturn: (x : _5656) -> <local<$5638>|_5676> string(xx: _5656) lineslines: list<string>.reversestd/core/list/reverse: (xs : list<string>) -> <local<$5638>|_5676> list<string>.joinstd/core/list/joinsep/join: (xs : list<string>, sep : string) -> <local<$5638>|_5676> string("\n"literal: string
count= 1
) @@ -3739,7 +3745,7 @@

fun catch( hnd : (string) -> e a, action : () -> <raise|e> a ) : e a with ctl raise(msg) hnd(msg) action() -fun catchtour/catch: forall<a,e> (hnd : (string) -> e a, action : () -> <raise|e> a) -> e a( hndhnd: (string) -> $5932 $5931 : (stringstd/core/types/string: V) -> ee: E aa: V, actionaction: () -> <raise|$5932> $5931 : () -> <raisetour/raise: (E, V) -> V|std/core/types/effect-extend: (X, E) -> Eee: E> aa: V )result: -> 6012 6011 : ee: E aa: V +fun catchtour/catch: forall<a,e> (hnd : (string) -> e a, action : () -> <raise|e> a) -> e a( hndhnd: (string) -> $5932 $5931 : (stringstd/core/types/string: V) -> ee: E aa: V, actionaction: () -> <raise|$5932> $5931 : () -> <raisetour/raise: (E, V) -> V|std/core/types/effect-extend: (X, E) -> Eee: E> aa: V )result: -> 6012 6011 : ee: E aa: V withhandler: (() -> <raise|$5932> $5931) -> $5932 $5931 ctl raiseraise: (msg : string, resume : (_5938) -> $5932 $5931) -> $5932 $5931
(msgmsg: string) hndhnd: (string) -> $5932 $5931(msgmsg: string) actionaction: () -> <raise|$5932> $5931(
)

@@ -3790,7 +3796,7 @@

fun raise-maybetour/raise-maybe: forall<a,e> (action : () -> <raise|e> a) -> e maybe<a>( actionaction: () -> <raise|$6099> $6098 : () -> <raisetour/raise: (E, V) -> V|std/core/types/effect-extend: (X, E) -> Eee: E> aa: V )result: -> 6200 maybe<6199> : ee: E maybestd/core/types/maybe: V -> V<aa: V> +fun raise-maybetour/raise-maybe: forall<a,e> (action : () -> <raise|e> a) -> e maybe<a>( actionaction: () -> <raise|$6099> $6098 : () -> <raisetour/raise: (E, V) -> V|std/core/types/effect-extend: (X, E) -> Eee: E> aa: V )result: -> 6200 maybe<6199> : ee: E maybestd/core/types/maybe: V -> V<aa: V> withwith: () -> <raise|$6099> $6098 handlerhandler: (() -> <raise|$6099> $6098) -> $6099 maybe<$6098> returnreturn: (x : $6098) -> _6104 maybe<$6098>(xx: $6098) Juststd/core/types/Just: forall<a> (value : a) -> maybe<a>(xx: $6098) // normal return: wrap in Just ctl raiseraise: (msg : string, resume : (_6115) -> $6099 maybe<$6098>) -> $6099 maybe<$6098>
(msgmsg: string) Nothingstd/core/types/Nothing: forall<a> maybe<a> // exception: return Nothing directly @@ -3817,7 +3823,7 @@

effecttour/state: (V, E, V) -> V statetour/state: (V, E, V) -> V<aa: V> +effecttour/state: (V, E, V) -> V statetour/state: (V, E, V) -> V<aa: V> fun get() : aa: V fun set( xx: $6444 : aa: V ) : (std/core/types/unit: V)std/core/types/unit: V @@ -3837,7 +3843,7 @@

fun statetour/state: forall<a,b,e> (init : a, action : () -> <state<a>,div|e> b) -> <div|e> b( initinit: $6565 : aa: V, actionaction: () -> <state<$6565>,div|$6567> $6566 : () -> <statetour/state: (V, E, V) -> V<aa: V>,divstd/core/types/div: X|std/core/types/effect-extend: (X, E) -> Eee: E> bb: V )result: -> <div|6832> 6831 : <divstd/core/types/div: X|std/core/types/effect-extend: (X, E) -> Eee: E> bb: V +fun statetour/state: forall<a,b,e> (init : a, action : () -> <state<a>,div|e> b) -> <div|e> b( initinit: $6565 : aa: V, actionaction: () -> <state<$6565>,div|$6567> $6566 : () -> <statetour/state: (V, E, V) -> V<aa: V>,divstd/core/types/div: X|std/core/types/effect-extend: (X, E) -> Eee: E> bb: V )result: -> <div|6832> 6831 : <divstd/core/types/div: X|std/core/types/effect-extend: (X, E) -> Eee: E> bb: V var stst: local-var<$6576,$6565> := initinit: $6565 withwith: () -> <state<$6565>,div|$6567> $6566 handlerhandler: (() -> <state<$6565>,local<$6576>,div|$6567> $6566) -> <local<$6576>,div|$6567> $6566 fun getget: () -> <local<$6576>,div|$6567> $6565() stst: $6565 @@ -3862,7 +3868,7 @@

fun pstatetour/pstate: forall<a,b,e> (init : a, action : () -> <state<a>,div|e> b) -> <div|e> (b, a)( initinit: $6842 : aa: V, actionaction: () -> <state<$6842>,div|$6844> $6843 : () -> <statetour/state: (V, E, V) -> V<aa: V>,divstd/core/types/div: X|std/core/types/effect-extend: (X, E) -> Eee: E> bb: V )result: -> <div|7185> (7184, 7183) : <divstd/core/types/div: X|std/core/types/effect-extend: (X, E) -> Eee: E> (std/core/types/tuple2: (V, V) -> Vbb: V,aa: V) +fun pstatetour/pstate: forall<a,b,e> (init : a, action : () -> <state<a>,div|e> b) -> <div|e> (b, a)( initinit: $6842 : aa: V, actionaction: () -> <state<$6842>,div|$6844> $6843 : () -> <statetour/state: (V, E, V) -> V<aa: V>,divstd/core/types/div: X|std/core/types/effect-extend: (X, E) -> Eee: E> bb: V )result: -> <div|7185> (7184, 7183) : <divstd/core/types/div: X|std/core/types/effect-extend: (X, E) -> Eee: E> (std/core/types/tuple2: (V, V) -> Vbb: V,aa: V) var stst: local-var<$6853,$6842> := initinit: $6842 withwith: () -> <state<$6842>,div|$6844> $6843 handlerhandler: (() -> <state<$6842>,local<$6853>,div|$6844> $6843) -> <local<$6853>,div|$6844> ($6843, $6842) returnreturn: (x : _6871) -> <local<$6853>,div|_7160> (_6871, $6842)(xx: _6871) (std/core/types/Tuple2: forall<a,b> (fst : a, snd : b) -> (a, b)xx: _6871,stst: $6842)std/core/types/Tuple2: forall<a,b> (fst : a, snd : b) -> (a, b) // pair with the final state @@ -3887,7 +3893,7 @@

fun pstate2tour/pstate2: forall<a,b,e> (init : a, action : () -> <state<a>,div|e> b) -> <div|e> (b, a)( initinit: $7195 : aa: V, actionaction: () -> <state<$7195>,div|$7197> $7196 : () -> <statetour/state: (V, E, V) -> V<aa: V>,divstd/core/types/div: X|std/core/types/effect-extend: (X, E) -> Eee: E> bb: V )result: -> <div|7500> (7499, 7498) : <divstd/core/types/div: X|std/core/types/effect-extend: (X, E) -> Eee: E> (std/core/types/tuple2: (V, V) -> Vbb: V,aa: V) +fun pstate2tour/pstate2: forall<a,b,e> (init : a, action : () -> <state<a>,div|e> b) -> <div|e> (b, a)( initinit: $7195 : aa: V, actionaction: () -> <state<$7195>,div|$7197> $7196 : () -> <statetour/state: (V, E, V) -> V<aa: V>,divstd/core/types/div: X|std/core/types/effect-extend: (X, E) -> Eee: E> bb: V )result: -> <div|7500> (7499, 7498) : <divstd/core/types/div: X|std/core/types/effect-extend: (X, E) -> Eee: E> (std/core/types/tuple2: (V, V) -> Vbb: V,aa: V) var stst: local-var<$7206,$7195> := initinit: $7195 withwith: () -> <local<$7206>,div|$7197> $7196 returnreturn: (x : $7196) -> <local<$7206>,div|$7197> ($7196, $7195)(xx: $7196) (std/core/types/Tuple2: forall<a,b> (fst : a, snd : b) -> (a, b)xx: $7196,stst: $7195)std/core/types/Tuple2: forall<a,b> (fst : a, snd : b) -> (a, b) withwith: () -> <state<$7195>,div|$7197> $7196 handlerhandler: (() -> <state<$7195>,local<$7206>,div|$7197> $7196) -> <local<$7206>,div|$7197> $7196 @@ -4056,8 +4062,8 @@

peektour/peek: forall<a> -> (peek<a>) a and poketour/poke: forall<a> (x : a) -> (poke<a>) ():

effect<a> val peek : a             // get the state
 effect<a> ctl poke( x : a ) : ()   // set the state to x
-effecttour/peek: (V, E, V) -> V<aa: V> val peektour/peek: (V, E, V) -> V : aa: V             // get the state
-effecttour/poke: (V, E, V) -> V<aa: V> ctl poketour/poke: (V, E, V) -> V( xx: $8241 : aa: V ) : (std/core/types/unit: V)std/core/types/unit: V   // set the state to x
+effecttour/peek: (V, E, V) -> V<aa: V> val peektour/peek: (V, E, V) -> V : aa: V             // get the state
+effecttour/poke: (V, E, V) -> V<aa: V> ctl poketour/poke: (V, E, V) -> V( xx: $8241 : aa: V ) : (std/core/types/unit: V)std/core/types/unit: V   // set the state to x
 
@@ -4070,7 +4076,7 @@

fun ppstatetour/ppstate: forall<a,b,e> (init : a, action : () -> <peek<a>,poke<a>|e> b) -> e b( initinit: $8296 : aa: V, actionaction: () -> <peek<$8296>,poke<$8296>|$8298> $8297 : () -> <peektour/peek: (V, E, V) -> V<aa: V>,poketour/poke: (V, E, V) -> V<aa: V>|std/core/types/effect-extend: (X, E) -> Eee: E> bb: V )result: -> 8526 8525 : ee: E bb: V +fun ppstatetour/ppstate: forall<a,b,e> (init : a, action : () -> <peek<a>,poke<a>|e> b) -> e b( initinit: $8296 : aa: V, actionaction: () -> <peek<$8296>,poke<$8296>|$8298> $8297 : () -> <peektour/peek: (V, E, V) -> V<aa: V>,poketour/poke: (V, E, V) -> V<aa: V>|std/core/types/effect-extend: (X, E) -> Eee: E> bb: V )result: -> 8526 8525 : ee: E bb: V withhandler: (() -> <peek<$8296>|$8298> $8297) -> $8298 $8297 val peekpeek: () -> $8298 $8296 = initinit: $8296 withhandler: (() -> <poke<$8296>,peek<$8296>|$8298> $8297) -> <peek<$8296>|$8298> $8297 ctl pokepoke: (x : $8296, resume : (()) -> <peek<$8296>|$8298> $8297) -> <peek<$8296>|$8298> $8297
(xx: $8296) mask<peek_1: V> @@ -4099,7 +4105,7 @@

fun emit-quoted1( action : () -> <emit,emit|e> a ) : <emit|e> a with fun emit(msg) emit("\"" ++ msg ++ "\"") action() -fun emit-quoted1tour/emit-quoted1: forall<a,e> (action : () -> <emit,emit|e> a) -> <emit|e> a( actionaction: () -> <emit,emit|$8537> $8536 : () -> <emittour/emit: (E, V) -> V,emittour/emit: (E, V) -> V|std/core/types/effect-extend: (X, E) -> Eee: E> aa: V )result: -> <emit|8625> 8624 : <emittour/emit: (E, V) -> V|std/core/types/effect-extend: (X, E) -> Eee: E> aa: V +fun emit-quoted1tour/emit-quoted1: forall<a,e> (action : () -> <emit,emit|e> a) -> <emit|e> a( actionaction: () -> <emit,emit|$8537> $8536 : () -> <emittour/emit: (E, V) -> V,emittour/emit: (E, V) -> V|std/core/types/effect-extend: (X, E) -> Eee: E> aa: V )result: -> <emit|8625> 8624 : <emittour/emit: (E, V) -> V|std/core/types/effect-extend: (X, E) -> Eee: E> aa: V withhandler: (() -> <emit,emit|$8537> $8536) -> <emit|$8537> $8536 fun emitemit: (msg : string) -> <emit|$8537> ()(msgmsg: string) emittour/emit: (msg : string) -> <emit|$8537> ()("\""literal: string
count= 1
++std/core/types/(++): (x : string, y : string) -> <emit|$8537> string msgmsg: string ++std/core/types/(++): (x : string, y : string) -> <emit|$8537> string "\""literal: string
count= 1
) actionaction: () -> <emit,emit|$8537> $8536(
)

@@ -4116,7 +4122,7 @@

fun emit-quoted2( action : () -> <emit|e> a ) : <emit|e> a with override fun emit(msg) emit("\"" ++ msg ++ "\"" ) action() -fun emit-quoted2tour/emit-quoted2: forall<a,e> (action : () -> <emit|e> a) -> <emit|e> a( actionaction: () -> <emit|$8633> $8632 : () -> <emittour/emit: (E, V) -> V|std/core/types/effect-extend: (X, E) -> Eee: E> aa: V )result: -> <emit|8735> 8734 : <emittour/emit: (E, V) -> V|std/core/types/effect-extend: (X, E) -> Eee: E> aa: V +fun emit-quoted2tour/emit-quoted2: forall<a,e> (action : () -> <emit|e> a) -> <emit|e> a( actionaction: () -> <emit|$8633> $8632 : () -> <emittour/emit: (E, V) -> V|std/core/types/effect-extend: (X, E) -> Eee: E> aa: V )result: -> <emit|8735> 8734 : <emittour/emit: (E, V) -> V|std/core/types/effect-extend: (X, E) -> Eee: E> aa: V withhandler: (() -> <emit,emit|$8633> $8632) -> <emit|$8633> $8632 override fun emitemit: (msg : string) -> <emit|$8633> ()(msgmsg: string) emittour/emit: (msg : string) -> <emit|$8633> ()("\""literal: string
count= 1
++std/core/types/(++): (x : string, y : string) -> <emit|$8633> string msgmsg: string ++std/core/types/(++): (x : string, y : string) -> <emit|$8633> string "\""literal: string
count= 1
) actionaction: () -> <emit|$8633> $8632(
)

@@ -4180,7 +4186,7 @@

effecttour/choice: (E, V) -> V ctl choicetour/choice: (E, V) -> V() : boolstd/core/types/bool: V +effecttour/choice: (E, V) -> V ctl choicetour/choice: (E, V) -> V() : boolstd/core/types/bool: V fun xortour/xor: () -> choice bool()result: -> choice bool : choicetour/choice: (E, V) -> V boolstd/core/types/bool: V val pp: bool = choicetour/choice: () -> choice bool() @@ -4194,7 +4200,7 @@

fun choice-random(action : () -> <choice,random|e> a) : <random|e> a with fun choice() random-bool() action() -fun choice-randomtour/choice-random: forall<a,e> (action : () -> <choice,random|e> a) -> <random|e> a(actionaction: () -> <choice,random|$8988> $8987 : () -> <choicetour/choice: (E, V) -> V,randomstd/num/random/random: (E, V) -> V|std/core/types/effect-extend: (X, E) -> Eee: E> aa: V)result: -> <random|9056> 9055 : <randomstd/num/random/random: (E, V) -> V|std/core/types/effect-extend: (X, E) -> Eee: E> aa: V +fun choice-randomtour/choice-random: forall<a,e> (action : () -> <choice,random|e> a) -> <random|e> a(actionaction: () -> <choice,random|$8988> $8987 : () -> <choicetour/choice: (E, V) -> V,randomstd/num/random/random: (E, V) -> V|std/core/types/effect-extend: (X, E) -> Eee: E> aa: V)result: -> <random|9056> 9055 : <randomstd/num/random/random: (E, V) -> V|std/core/types/effect-extend: (X, E) -> Eee: E> aa: V withhandler: (() -> <choice,random|$8988> $8987) -> <random|$8988> $8987 fun choicechoice: () -> <random|$8988> bool() random-boolstd/num/random/random-bool: () -> <random|$8988> bool() actionaction: () -> <choice,random|$8988> $8987() @@ -4212,7 +4218,7 @@

fun choice-alltour/choice-all: forall<a,e> (action : () -> <choice|e> a) -> e list<a>(actionaction: () -> <choice|$9064> $9063 : () -> <choicetour/choice: (E, V) -> V|std/core/types/effect-extend: (X, E) -> Eee: E> aa: V)result: -> 9167 list<9166> : ee: E liststd/core/types/list: V -> V<aa: V> +fun choice-alltour/choice-all: forall<a,e> (action : () -> <choice|e> a) -> e list<a>(actionaction: () -> <choice|$9064> $9063 : () -> <choicetour/choice: (E, V) -> V|std/core/types/effect-extend: (X, E) -> Eee: E> aa: V)result: -> 9167 list<9166> : ee: E liststd/core/types/list: V -> V<aa: V> withwith: () -> <choice|$9064> $9063 handlerhandler: (() -> <choice|$9064> $9063) -> $9064 list<$9063> returnreturn: (x : $9063) -> _9067 list<$9063>(xx: $9063) [std/core/types/Cons: forall<a> (head : a, tail : list<a>) -> list<a>xx: $9063]std/core/types/Nil: forall<a> list<a> ctl choicechoice: (resume : (bool) -> $9064 list<$9063>) -> $9064 list<$9063>
() resumeresume: (bool) -> $9064 list<$9063>(Falsestd/core/types/False: bool) ++std/core/list/(++): (xs : list<$9063>, ys : list<$9063>) -> $9064 list<$9063> resumeresume: (bool) -> $9064 list<$9063>(Truestd/core/types/True: bool) @@ -4392,13 +4398,13 @@

3.4.12. Linear Effects

Todo. -Use linear effect to declare effects whose operations are always tail-resumptive +Use linear effect to declare effects whose operations are always tail-resumptive and use only linear effects themselves (and thus resume exactly once). This removes monadic translation for such effects and can make code that uses only linear effects more compact and efficient.

3.4.13. Named and Scoped Handlers

Todo. -See named-handlers.

3.5. FBIP: Functional but In-Place

+
See samples/handlers/named.

3.5. FBIP: Functional but In-Place

With Perceus reuse analysis we can write algorithms that dynamically adapt to use in-place mutation when possible (and use copying when used persistently). Importantly, @@ -4954,7 +4960,7 @@

fun eq2spec/eq2: (x : int, y : int) -> io bool( xx: int : intstd/core/types/int: V, - y :std/core/types/int: V intstd/core/types/int: V ) :std/core/io: E iostd/core/io: E boolstd/core/types/bool: V + y :std/core/types/int: V intstd/core/types/int: V ) :std/core/io: E iostd/core/io: E boolstd/core/types/bool: V print("calc " ++ "equ" ++ "ality") diff --git a/doc/index.html b/doc/index.html index 96809679f..6cb7fa82e 100644 --- a/doc/index.html +++ b/doc/index.html @@ -1106,7 +1106,7 @@ println("yielded " ++ i.show) [1,2,3].traverse // A generator effect with one operation -effectindex/yield: (V, E, V) -> V yieldindex/yield: (V, E, V) -> V<aa: V> +effectindex/yield: (V, E, V) -> V yieldindex/yield: (V, E, V) -> V<aa: V> fun yield( xx: $265 : aa: V ) : (std/core/types/unit: V)std/core/types/unit: V // Traverse a list and yield the elements diff --git a/doc/std_core-source.html b/doc/std_core-source.html index 462815192..7ee510421 100644 --- a/doc/std_core-source.html +++ b/doc/std_core-source.html @@ -29,28 +29,28 @@ Some types and operations are required to be defined for the compiler to work correctly (i.e. types like `:exn` or `:list`) */ -module std/corestd/core - -pub import std/core/typesstd/core/types -import std/core/undivstd/core/undiv -import std/core/unsafestd/core/unsafe -pub import std/core/hndstd/core/hnd -pub import std/core/exnstd/core/exn -pub import std/core/boolstd/core/bool -pub import std/core/orderstd/core/order -pub import std/core/charstd/core/char -pub import std/core/intstd/core/int -pub import std/core/vectorstd/core/vector -pub import std/core/stringstd/core/string -pub import std/core/sslicestd/core/sslice -pub import std/core/liststd/core/list -pub import std/core/maybestd/core/maybe -pub import std/core/eitherstd/core/either -pub import std/core/tuplestd/core/tuple -pub import std/core/showstd/core/show -pub import std/core/debugstd/core/debug -pub import std/core/delayedstd/core/delayed -pub import std/core/consolestd/core/console +module std/corestd/core + +pub import std/core/typesstd/core/types +import std/core/undivstd/core/undiv +import std/core/unsafestd/core/unsafe +pub import std/core/hndstd/core/hnd +pub import std/core/exnstd/core/exn +pub import std/core/boolstd/core/bool +pub import std/core/orderstd/core/order +pub import std/core/charstd/core/char +pub import std/core/intstd/core/int +pub import std/core/vectorstd/core/vector +pub import std/core/stringstd/core/string +pub import std/core/sslicestd/core/sslice +pub import std/core/liststd/core/list +pub import std/core/maybestd/core/maybe +pub import std/core/eitherstd/core/either +pub import std/core/tuplestd/core/tuple +pub import std/core/showstd/core/show +pub import std/core/debugstd/core/debug +pub import std/core/delayedstd/core/delayed +pub import std/core/consolestd/core/console extern import c file "core/inline/core" @@ -65,37 +65,37 @@ // An alias for pure effects: a pure function always returns the same result // when called with the same arguments but may not terminate or raise an exception. -pub alias purestd/core/pure: E = <std/core/types/total: Eexnstd/core/exn/exn: (E, V) -> V,divstd/core/types/div: X> +pub alias purestd/core/pure: E = <std/core/types/total: Eexnstd/core/exn/exn: (E, V) -> V,divstd/core/types/div: X> // The `:global-scope` is a special type constant to denote the global scope -pub type global-scopestd/core/global-scope: S :: S +pub type global-scopestd/core/global-scope: S :: S // The `:net` effect signifies a function may access the network -pub type netstd/core/net: X :: X +pub type netstd/core/net: X :: X // The `:fsys` effect signifies a function may access the file system -pub type fsysstd/core/fsys: X :: X +pub type fsysstd/core/fsys: X :: X // The `:ui` effect signifies a function may access the graphics system -pub type uistd/core/ui: X :: X +pub type uistd/core/ui: X :: X // The `:blocking` effect signifies that a function may block -pub type blockingstd/core/blocking: X :: X +pub type blockingstd/core/blocking: X :: X // The `:io-total` effect is used for functions that perform arbitrary I/O operations, but are terminating without raising exceptions. -pub alias io-totalstd/core/io-total: E = <std/core/types/total: Endetstd/core/types/ndet: X,consolestd/core/console/console: X,netstd/core/net: X,fsysstd/core/fsys: X,uistd/core/ui: X,ststd/core/types/st: H -> E<globalstd/core/types/global: H>> +pub alias io-totalstd/core/io-total: E = <std/core/types/total: Endetstd/core/types/ndet: X,consolestd/core/console/console: X,netstd/core/net: X,fsysstd/core/fsys: X,uistd/core/ui: X,ststd/core/types/st: H -> E<globalstd/core/types/global: H>> // The `:io-noexn` effect is used for functions that perform arbitrary I/O operations, but raise no exceptions -pub alias io-noexnstd/core/io-noexn: E = <std/core/types/total: Edivstd/core/types/div: X,io-totalstd/core/io-total: E> +pub alias io-noexnstd/core/io-noexn: E = <std/core/types/total: Edivstd/core/types/div: X,io-totalstd/core/io-total: E> // The `:io` effect is used for functions that perform arbitrary I/O operations. -pub alias iostd/core/io: E = <std/core/types/total: Eexnstd/core/exn/exn: (E, V) -> V,io-noexnstd/core/io-noexn: E> +pub alias iostd/core/io: E = <std/core/types/total: Eexnstd/core/exn/exn: (E, V) -> V,io-noexnstd/core/io-noexn: E> // The `:named` effect is the default umbrella effect for named effects -pub type nmdstd/core/nmd: X :: X +pub type nmdstd/core/nmd: X :: X // The `:scope` effect is used to ensure named effects cannot escape the scope of their handler -pub type scopestd/core/scope: S -> X :: S -> X +pub type scopestd/core/scope: S -> X :: S -> X // ---------------------------------------------------------------------------- @@ -103,23 +103,23 @@ // ---------------------------------------------------------------------------- // Apply a function `f` to a specified argument `x`. -pub fun applystd/core/apply: forall<a,b,e> (f : (a) -> e b, x : a) -> e b(ff: (_258) -> _259 _260,xx: _258)result: -> 271 270 +pub fun applystd/core/apply: forall<a,b,e> (f : (a) -> e b, x : a) -> e b(ff: (_258) -> _259 _260,xx: _258)result: -> 271 270 ff: (_258) -> _259 _260(xx: _258) // Compose two functions `f` and `g`. -pub fun ostd/core/o: forall<a,b,c,e> (f : (a) -> e b, g : (c) -> e a) -> ((x : c) -> e b)(ff: (_295) -> _287 _288,gg: (_286) -> _287 _295)result: -> total (x : 308) -> 309 307 +pub fun ostd/core/o: forall<a,b,c,e> (f : (a) -> e b, g : (c) -> e a) -> ((x : c) -> e b)(ff: (_295) -> _287 _288,gg: (_286) -> _287 _295)result: -> total (x : 308) -> 309 307 fnfn: (x : _286) -> _287 _288(xx: _286) ff: (_295) -> _287 _288(gg: (_286) -> _287 _295(xx: _286)) // The `ignore` function ignores its argument. -pub fun ignorestd/core/ignore: forall<a> (x : a) -> ()( xx: $324 : aa: V )result: -> total () : (std/core/types/unit: V)std/core/types/unit: V - (std/core/types/Unit: ())std/core/types/Unit: () +pub fun ignorestd/core/ignore: forall<a> (x : a) -> ()( xx: $324 : aa: V )result: -> total () : (std/core/types/unit: V)std/core/types/unit: V + (std/core/types/Unit: ())std/core/types/Unit: () // Return a 'constant' function that ignores its argument and always returns the same result -pub fun conststd/core/const: forall<a,b> (default : a) -> ((x : b) -> a)( defaultdefault: $337 : aa: V )result: -> total (x : 352) -> 351 : totalstd/core/types/total: E (( x : bb: V ) -> astd/core/types/total: E) +pub fun conststd/core/const: forall<a,b> (default : a) -> ((x : b) -> a)( defaultdefault: $337 : aa: V )result: -> total (x : 352) -> 351 : totalstd/core/types/total: E (( x : bb: V ) -> astd/core/types/total: E) fnfn: ($338) -> $337(_) defaultdefault: $337 // Concise way to ensure two expressions have the same type. -pub fun same-typestd/core/same-type: forall<a> (x : a, y : a) -> a( xx: $360 : aa: V, yy: $360 : aa: V )result: -> total 368 : astd/core/types/total: E +pub fun same-typestd/core/same-type: forall<a> (x : a, y : a) -> a( xx: $360 : aa: V, yy: $360 : aa: V )result: -> total 368 : astd/core/types/total: E xx: $360 // ---------------------------------------------------------------------------- @@ -127,72 +127,72 @@ // ---------------------------------------------------------------------------- // The `while` fun executes `action` as long as `pred` is `true`. -pub fun whilestd/core/while: forall<e> (predicate : () -> <div|e> bool, action : () -> <div|e> ()) -> <div|e> ()( predicatepredicate: () -> <div|$373> bool : () -> <divstd/core/types/div: X|std/core/types/effect-extend: (X, E) -> Eee: E> boolstd/core/types/bool: V, actionaction: () -> <div|$373> () : () -> <divstd/core/types/div: X|std/core/types/effect-extend: (X, E) -> Eee: E> (std/core/types/unit: V)std/core/types/unit: V )result: -> <div|391> () : <divstd/core/types/div: X|std/core/types/effect-extend: (X, E) -> Eee: E> (std/core/types/unit: V)std/core/types/unit: V +pub fun whilestd/core/while: forall<e> (predicate : () -> <div|e> bool, action : () -> <div|e> ()) -> <div|e> ()( predicatepredicate: () -> <div|$373> bool : () -> <divstd/core/types/div: X|std/core/types/effect-extend: (X, E) -> Eee: E> boolstd/core/types/bool: V, actionaction: () -> <div|$373> () : () -> <divstd/core/types/div: X|std/core/types/effect-extend: (X, E) -> Eee: E> (std/core/types/unit: V)std/core/types/unit: V )result: -> <div|391> () : <divstd/core/types/div: X|std/core/types/effect-extend: (X, E) -> Eee: E> (std/core/types/unit: V)std/core/types/unit: V if predicatepredicate: () -> <div|$373> bool() then actionaction: () -> <div|$373> ()() - whilestd/core/while: (predicate : () -> <div|$373> bool, action : () -> <div|$373> ()) -> <div|$373> ()(predicatepredicate: () -> <div|$373> bool, actionaction: () -> <div|$373> ())std/core/types/Unit: () + whilestd/core/while: (predicate : () -> <div|$373> bool, action : () -> <div|$373> ()) -> <div|$373> ()(predicatepredicate: () -> <div|$373> bool, actionaction: () -> <div|$373> ())std/core/types/Unit: () // The `repeat` fun executes `action` `n` times. -pub fun repeatstd/core/repeat: forall<e> (n : int, action : () -> e ()) -> e ()( ^nn: int : intstd/core/types/int: V, actionaction: () -> $946 () : () -> ee: E (std/core/types/unit: V)std/core/types/unit: V )result: -> 960 () : ee: E (std/core/types/unit: V)std/core/types/unit: V +pub fun repeatstd/core/repeat: forall<e> (n : int, action : () -> e ()) -> e ()( ^nn: int : intstd/core/types/int: V, actionaction: () -> $946 () : () -> ee: E (std/core/types/unit: V)std/core/types/unit: V )result: -> 960 () : ee: E (std/core/types/unit: V)std/core/types/unit: V forstd/core/for: (n : int, action : (int) -> $946 ()) -> $946 ()(nn: int) fnfn: (i : int) -> $946 ()(ii: int) actionaction: () -> $946 ()() // Executes `action` for each integer from `start` to `end` (including `end` ). // If `start > end` the function returns without any call to `action` . -pub fun range/forstd/core/range/for: forall<e> (start : int, end : int, action : (int) -> e ()) -> e ()( ^startstart: int: intstd/core/types/int: V, endend: int : intstd/core/types/int: V, actionaction: (int) -> $878 () : (intstd/core/types/int: V) -> ee: E (std/core/types/unit: V)std/core/types/unit: V )result: -> 919 () : ee: E (std/core/types/unit: V)std/core/types/unit: V - fun reprep: (i : int) -> $878 ()( ^ii: int : intstd/core/types/int: V )result: -> $878 () - if ii: int <=std/core/int/(<=): (x : int, y : int) -> $878 bool endend: int then +pub fun range/forstd/core/range/for: forall<e> (start : int, end : int, action : (int) -> e ()) -> e ()( ^startstart: int: intstd/core/types/int: V, endend: int : intstd/core/types/int: V, actionaction: (int) -> $878 () : (intstd/core/types/int: V) -> ee: E (std/core/types/unit: V)std/core/types/unit: V )result: -> 919 () : ee: E (std/core/types/unit: V)std/core/types/unit: V + fun reprep: (i : int) -> $878 ()( ^ii: int : intstd/core/types/int: V )result: -> $878 () + if ii: int <=std/core/int/(<=): (x : int, y : int) -> $878 bool endend: int then actionaction: (int) -> $878 ()(ii: int) - reprep: (i : int) -> $878 ()(pretend-decreasingstd/core/undiv/pretend-decreasing: (x : int) -> $878 int(ii: int.incstd/core/int/inc: (i : int) -> $878 int))std/core/types/Unit: () + reprep: (i : int) -> $878 ()(pretend-decreasingstd/core/undiv/pretend-decreasing: (x : int) -> $878 int(ii: int.incstd/core/int/inc: (i : int) -> $878 int))std/core/types/Unit: () reprep: (i : int) -> $878 ()(startstart: int) // Executes `action` `n` times for each integer from `0` to `n-1`. // If `n <= 0` the function returns without any call to `action` . -pub fun forstd/core/for: forall<e> (n : int, action : (int) -> e ()) -> e ()( ^nn: int : intstd/core/types/int: V, actionaction: (int) -> $923 () : (intstd/core/types/int: V) -> ee: E (std/core/types/unit: V)std/core/types/unit: V )result: -> 940 () : ee: E (std/core/types/unit: V)std/core/types/unit: V - range/forstd/core/range/for: (start : int, end : int, action : (int) -> $923 ()) -> $923 ()(0literal: int
dec = 0
hex8 = 0x00
bit8 = 0b00000000
, nn: int -std/core/int/(-): (x : int, y : int) -> $923 int 1literal: int
dec = 1
hex8 = 0x01
bit8 = 0b00000001
, actionaction: (int) -> $923 ()
) +pub fun forstd/core/for: forall<e> (n : int, action : (int) -> e ()) -> e ()( ^nn: int : intstd/core/types/int: V, actionaction: (int) -> $923 () : (intstd/core/types/int: V) -> ee: E (std/core/types/unit: V)std/core/types/unit: V )result: -> 940 () : ee: E (std/core/types/unit: V)std/core/types/unit: V + range/forstd/core/range/for: (start : int, end : int, action : (int) -> $923 ()) -> $923 ()(0literal: int
dec = 0
hex8 = 0x00
bit8 = 0b00000000
, nn: int -std/core/int/(-): (x : int, y : int) -> $923 int 1literal: int
dec = 1
hex8 = 0x01
bit8 = 0b00000001
, actionaction: (int) -> $923 ()
) // Executes `action` for each integer between `start` to `end` (including `end` ). // If `start > end` the function returns without any call to `action` . // If `action` returns `Just`, the iteration is stopped and the result returned -pub fun range/for-whilestd/core/range/for-while: forall<a,e> (start : int, end : int, action : (int) -> e maybe<a>) -> e maybe<a>( startstart: int: intstd/core/types/int: V, endend: int : intstd/core/types/int: V, actionaction: (int) -> $965 maybe<$964> : (intstd/core/types/int: V) -> ee: E maybestd/core/types/maybe: V -> V<aa: V> )result: -> 1027 maybe<1026> : ee: E maybestd/core/types/maybe: V -> V<aa: V> - fun reprep: (i : int) -> $965 maybe<$964>( ii: int : intstd/core/types/int: V )result: -> $965 maybe<$964> - if ii: int <=std/core/int/(<=): (x : int, y : int) -> $965 bool endend: int then +pub fun range/for-whilestd/core/range/for-while: forall<a,e> (start : int, end : int, action : (int) -> e maybe<a>) -> e maybe<a>( startstart: int: intstd/core/types/int: V, endend: int : intstd/core/types/int: V, actionaction: (int) -> $965 maybe<$964> : (intstd/core/types/int: V) -> ee: E maybestd/core/types/maybe: V -> V<aa: V> )result: -> 1027 maybe<1026> : ee: E maybestd/core/types/maybe: V -> V<aa: V> + fun reprep: (i : int) -> $965 maybe<$964>( ii: int : intstd/core/types/int: V )result: -> $965 maybe<$964> + if ii: int <=std/core/int/(<=): (x : int, y : int) -> $965 bool endend: int then match actionaction: (int) -> $965 maybe<$964>(ii: int) - Nothingstd/core/types/Nothing: forall<a> maybe<a> -> reprep: (i : int) -> $965 maybe<$964>(pretend-decreasingstd/core/undiv/pretend-decreasing: (x : int) -> $965 int(ii: int.incstd/core/int/inc: (i : int) -> $965 int)) - Juststd/core/types/Just: forall<a> (value : a) -> maybe<a>(xx: $964) -> Juststd/core/types/Just: forall<a> (value : a) -> maybe<a>(xx: $964) - else Nothingstd/core/types/Nothing: forall<a> maybe<a> + Nothingstd/core/types/Nothing: forall<a> maybe<a> -> reprep: (i : int) -> $965 maybe<$964>(pretend-decreasingstd/core/undiv/pretend-decreasing: (x : int) -> $965 int(ii: int.incstd/core/int/inc: (i : int) -> $965 int)) + Juststd/core/types/Just: forall<a> (value : a) -> maybe<a>(xx: $964) -> Juststd/core/types/Just: forall<a> (value : a) -> maybe<a>(xx: $964) + else Nothingstd/core/types/Nothing: forall<a> maybe<a> reprep: (i : int) -> $965 maybe<$964>(startstart: int) // Executes `action` for each integer between [0,`n`) (excluding `n` ). // If `n <= 0` the function returns without any call to `action` . // If `action` returns `Just`, the iteration is stopped and the result returned -pub fun for-whilestd/core/for-while: forall<a,e> (n : int, action : (int) -> e maybe<a>) -> e maybe<a>( nn: int : intstd/core/types/int: V, actionaction: (int) -> $1035 maybe<$1034> : (intstd/core/types/int: V) -> ee: E maybestd/core/types/maybe: V -> V<aa: V> )result: -> 1060 maybe<1059> : ee: E maybestd/core/types/maybe: V -> V<aa: V> - range/for-whilestd/core/range/for-while: (start : int, end : int, action : (int) -> $1035 maybe<$1034>) -> $1035 maybe<$1034>(0literal: int
dec = 0
hex8 = 0x00
bit8 = 0b00000000
, nn: int -std/core/int/(-): (x : int, y : int) -> $1035 int 1literal: int
dec = 1
hex8 = 0x01
bit8 = 0b00000001
, actionaction: (int) -> $1035 maybe<$1034>
) +pub fun for-whilestd/core/for-while: forall<a,e> (n : int, action : (int) -> e maybe<a>) -> e maybe<a>( nn: int : intstd/core/types/int: V, actionaction: (int) -> $1035 maybe<$1034> : (intstd/core/types/int: V) -> ee: E maybestd/core/types/maybe: V -> V<aa: V> )result: -> 1060 maybe<1059> : ee: E maybestd/core/types/maybe: V -> V<aa: V> + range/for-whilestd/core/range/for-while: (start : int, end : int, action : (int) -> $1035 maybe<$1034>) -> $1035 maybe<$1034>(0literal: int
dec = 0
hex8 = 0x00
bit8 = 0b00000000
, nn: int -std/core/int/(-): (x : int, y : int) -> $1035 int 1literal: int
dec = 1
hex8 = 0x01
bit8 = 0b00000001
, actionaction: (int) -> $1035 maybe<$1034>
) // Fold over the integers between [`start`,`end`] (including `end`). -pub fun range/foldstd/core/range/fold: forall<a,e> (start : int, end : int, init : a, f : (int, a) -> e a) -> e a( startstart: int : intstd/core/types/int: V, endend: int : intstd/core/types/int: V, initinit: $573 : aa: V, ff: (int, $573) -> $574 $573 : (intstd/core/types/int: V,aa: V) -> ee: E aa: V )result: -> 629 628 : ee: E aa: V - if startstart: int >std/core/int/(>): (x : int, y : int) -> $574 bool endend: int then initinit: $573 else +pub fun range/foldstd/core/range/fold: forall<a,e> (start : int, end : int, init : a, f : (int, a) -> e a) -> e a( startstart: int : intstd/core/types/int: V, endend: int : intstd/core/types/int: V, initinit: $573 : aa: V, ff: (int, $573) -> $574 $573 : (intstd/core/types/int: V,aa: V) -> ee: E aa: V )result: -> 629 628 : ee: E aa: V + if startstart: int >std/core/int/(>): (x : int, y : int) -> $574 bool endend: int then initinit: $573 else val xx: $573 = ff: (int, $573) -> $574 $573(startstart: int,initinit: $573) - foldstd/core/range/fold: (start : int, end : int, init : $573, f : (int, $573) -> $574 $573) -> $574 $573(pretend-decreasingstd/core/undiv/pretend-decreasing: (x : int) -> $574 int(startstart: int.incstd/core/int/inc: (i : int) -> $574 int), endend: int, xx: $573, ff: (int, $573) -> $574 $573) + foldstd/core/range/fold: (start : int, end : int, init : $573, f : (int, $573) -> $574 $573) -> $574 $573(pretend-decreasingstd/core/undiv/pretend-decreasing: (x : int) -> $574 int(startstart: int.incstd/core/int/inc: (i : int) -> $574 int), endend: int, xx: $573, ff: (int, $573) -> $574 $573) // Fold over the integers between [0,`upto`) (excluding `upto`). -pub fun foldstd/core/fold: forall<a,e> (upto : int, init : a, f : (int, a) -> e a) -> e a( uptoupto: int : intstd/core/types/int: V, initinit: $546 : aa: V, ff: (int, $546) -> $547 $546 : (intstd/core/types/int: V,aa: V) -> ee: E aa: V )result: -> 572 571 : ee: E aa: V - range/foldstd/core/range/fold: (start : int, end : int, init : $546, f : (int, $546) -> $547 $546) -> $547 $546( 0literal: int
dec = 0
hex8 = 0x00
bit8 = 0b00000000
, uptoupto: int.decstd/core/int/dec: (i : int) -> $547 int, initinit: $546, ff: (int, $546) -> $547 $546
) +pub fun foldstd/core/fold: forall<a,e> (upto : int, init : a, f : (int, a) -> e a) -> e a( uptoupto: int : intstd/core/types/int: V, initinit: $546 : aa: V, ff: (int, $546) -> $547 $546 : (intstd/core/types/int: V,aa: V) -> ee: E aa: V )result: -> 572 571 : ee: E aa: V + range/foldstd/core/range/fold: (start : int, end : int, init : $546, f : (int, $546) -> $547 $546) -> $547 $546( 0literal: int
dec = 0
hex8 = 0x00
bit8 = 0b00000000
, uptoupto: int.decstd/core/int/dec: (i : int) -> $547 int, initinit: $546, ff: (int, $546) -> $547 $546
) // Fold over the integers between [`start`,`end`] (including `end`) or until `f` returns `Nothing` -pub fun range/fold-whilestd/core/range/fold-while: forall<a,e> (start : int, end : int, init : a, f : (int, a) -> e maybe<a>) -> e a( startstart: int : intstd/core/types/int: V, endend: int : intstd/core/types/int: V, initinit: $673 : aa: V, ff: (int, $673) -> $674 maybe<$673> : (intstd/core/types/int: V,aa: V) -> ee: E maybestd/core/types/maybe: V -> V<aa: V> )result: -> 735 734 : ee: E aa: V - if startstart: int >std/core/int/(>): (x : int, y : int) -> $674 bool endend: int then initinit: $673 else +pub fun range/fold-whilestd/core/range/fold-while: forall<a,e> (start : int, end : int, init : a, f : (int, a) -> e maybe<a>) -> e a( startstart: int : intstd/core/types/int: V, endend: int : intstd/core/types/int: V, initinit: $673 : aa: V, ff: (int, $673) -> $674 maybe<$673> : (intstd/core/types/int: V,aa: V) -> ee: E maybestd/core/types/maybe: V -> V<aa: V> )result: -> 735 734 : ee: E aa: V + if startstart: int >std/core/int/(>): (x : int, y : int) -> $674 bool endend: int then initinit: $673 else match ff: (int, $673) -> $674 maybe<$673>(startstart: int,initinit: $673) - Juststd/core/types/Just: forall<a> (value : a) -> maybe<a>(xx: $673) -> range/fold-whilestd/core/range/fold-while: (start : int, end : int, init : $673, f : (int, $673) -> $674 maybe<$673>) -> $674 $673(pretend-decreasingstd/core/undiv/pretend-decreasing: (x : int) -> $674 int(startstart: int.incstd/core/int/inc: (i : int) -> $674 int), endend: int, xx: $673, ff: (int, $673) -> $674 maybe<$673>) - Nothingstd/core/types/Nothing: forall<a> maybe<a> -> initinit: $673 + Juststd/core/types/Just: forall<a> (value : a) -> maybe<a>(xx: $673) -> range/fold-whilestd/core/range/fold-while: (start : int, end : int, init : $673, f : (int, $673) -> $674 maybe<$673>) -> $674 $673(pretend-decreasingstd/core/undiv/pretend-decreasing: (x : int) -> $674 int(startstart: int.incstd/core/int/inc: (i : int) -> $674 int), endend: int, xx: $673, ff: (int, $673) -> $674 maybe<$673>) + Nothingstd/core/types/Nothing: forall<a> maybe<a> -> initinit: $673 // Fold over the integers between [0,`n`) (excluding `n`) or until `f` returns `Nothing` -pub fun fold-whilestd/core/fold-while: forall<a,e> (n : int, init : a, f : (int, a) -> e maybe<a>) -> e a( nn: int : intstd/core/types/int: V, initinit: $646 : aa: V, ff: (int, $646) -> $647 maybe<$646> : (intstd/core/types/int: V,aa: V) -> ee: E maybestd/core/types/maybe: V -> V<aa: V> )result: -> 672 671 : ee: E aa: V - range/fold-whilestd/core/range/fold-while: (start : int, end : int, init : $646, f : (int, $646) -> $647 maybe<$646>) -> $647 $646( 0literal: int
dec = 0
hex8 = 0x00
bit8 = 0b00000000
, nn: int.decstd/core/int/dec: (i : int) -> $647 int, initinit: $646, ff: (int, $646) -> $647 maybe<$646>
) +pub fun fold-whilestd/core/fold-while: forall<a,e> (n : int, init : a, f : (int, a) -> e maybe<a>) -> e a( nn: int : intstd/core/types/int: V, initinit: $646 : aa: V, ff: (int, $646) -> $647 maybe<$646> : (intstd/core/types/int: V,aa: V) -> ee: E maybestd/core/types/maybe: V -> V<aa: V> )result: -> 672 671 : ee: E aa: V + range/fold-whilestd/core/range/fold-while: (start : int, end : int, init : $646, f : (int, $646) -> $647 maybe<$646>) -> $647 $646( 0literal: int
dec = 0
hex8 = 0x00
bit8 = 0b00000000
, nn: int.decstd/core/int/dec: (i : int) -> $647 int, initinit: $646, ff: (int, $646) -> $647 maybe<$646>
) // ---------------------------------------------------------------------------- @@ -200,29 +200,29 @@ // ---------------------------------------------------------------------------- // Generic inequality -pub fun (!=)std/core/(!=): forall<a> (x : a, y : a, @implicit/(==) : (a, a) -> bool) -> bool(xx: $438 : aa: V, yy: $438 : aa: V, (@implicit/==)?(==): ($438, $438) -> bool : (aa: V,aa: V) -> boolstd/core/types/bool: V )result: -> total bool : boolstd/core/types/bool: V - notstd/core/types/not: (b : bool) -> bool(xx: $438==?(==): ($438, $438) -> boolyy: $438) +pub fun (!=)std/core/(!=): forall<a> (x : a, y : a, @implicit/(==) : (a, a) -> bool) -> bool(xx: $438 : aa: V, yy: $438 : aa: V, (@implicit/==)?(==): ($438, $438) -> bool : (aa: V,aa: V) -> boolstd/core/types/bool: V )result: -> total bool : boolstd/core/types/bool: V + notstd/core/types/not: (b : bool) -> bool(xx: $438==?(==): ($438, $438) -> boolyy: $438) // Generic equality if `cmp` exists -pub fun cmp/(==)std/core/cmp/(==): forall<a> (x : a, y : a, @implicit/cmp : (a, a) -> order) -> bool(xx: $401 : aa: V, yy: $401 : aa: V, @implicit/cmp?cmp: ($401, $401) -> order : (aa: V,aa: V) -> orderstd/core/types/order: V )result: -> total bool : boolstd/core/types/bool: V +pub fun cmp/(==)std/core/cmp/(==): forall<a> (x : a, y : a, @implicit/cmp : (a, a) -> order) -> bool(xx: $401 : aa: V, yy: $401 : aa: V, @implicit/cmp?cmp: ($401, $401) -> order : (aa: V,aa: V) -> orderstd/core/types/order: V )result: -> total bool : boolstd/core/types/bool: V match cmp?cmp: ($401, $401) -> order(xx: $401,yy: $401) - Eqstd/core/types/Eq: order -> Truestd/core/types/True: bool - _ -> Falsestd/core/types/False: bool + Eqstd/core/types/Eq: order -> Truestd/core/types/True: bool + _ -> Falsestd/core/types/False: bool // Generic greater than -pub fun (>)std/core/(>): forall<a> (x : a, y : a, @implicit/cmp : (a, a) -> order) -> bool(xx: $484 : aa: V, yy: $484 : aa: V, @implicit/cmp?cmp: ($484, $484) -> order : (aa: V,aa: V) -> orderstd/core/types/order: V )result: -> total bool : boolstd/core/types/bool: V - cmp?cmp: ($484, $484) -> order(xx: $484,yy: $484) ==std/core/order/(==): (x : order, y : order) -> bool Gtstd/core/types/Gt: order +pub fun (>)std/core/(>): forall<a> (x : a, y : a, @implicit/cmp : (a, a) -> order) -> bool(xx: $484 : aa: V, yy: $484 : aa: V, @implicit/cmp?cmp: ($484, $484) -> order : (aa: V,aa: V) -> orderstd/core/types/order: V )result: -> total bool : boolstd/core/types/bool: V + cmp?cmp: ($484, $484) -> order(xx: $484,yy: $484) ==std/core/order/(==): (x : order, y : order) -> bool Gtstd/core/types/Gt: order // Generic lower than -pub fun (<)std/core/(<): forall<a> (x : a, y : a, @implicit/cmp : (a, a) -> order) -> bool(xx: $752 : aa: V, yy: $752 : aa: V, @implicit/cmp?cmp: ($752, $752) -> order : (aa: V,aa: V) -> orderstd/core/types/order: V )result: -> total bool : boolstd/core/types/bool: V - cmp?cmp: ($752, $752) -> order(xx: $752,yy: $752) ==std/core/order/(==): (x : order, y : order) -> bool Ltstd/core/types/Lt: order +pub fun (<)std/core/(<): forall<a> (x : a, y : a, @implicit/cmp : (a, a) -> order) -> bool(xx: $752 : aa: V, yy: $752 : aa: V, @implicit/cmp?cmp: ($752, $752) -> order : (aa: V,aa: V) -> orderstd/core/types/order: V )result: -> total bool : boolstd/core/types/bool: V + cmp?cmp: ($752, $752) -> order(xx: $752,yy: $752) ==std/core/order/(==): (x : order, y : order) -> bool Ltstd/core/types/Lt: order // Generic greater than or equal -pub fun (>=)std/core/(>=): forall<a> (x : a, y : a, @implicit/cmp : (a, a) -> order) -> bool(xx: $814 : aa: V, yy: $814 : aa: V, @implicit/cmp?cmp: ($814, $814) -> order : (aa: V,aa: V) -> orderstd/core/types/order: V )result: -> total bool : boolstd/core/types/bool: V +pub fun (>=)std/core/(>=): forall<a> (x : a, y : a, @implicit/cmp : (a, a) -> order) -> bool(xx: $814 : aa: V, yy: $814 : aa: V, @implicit/cmp?cmp: ($814, $814) -> order : (aa: V,aa: V) -> orderstd/core/types/order: V )result: -> total bool : boolstd/core/types/bool: V yy: $814 <std/core/(<): (x : $814, y : $814, @implicit/cmp : ($814, $814) -> order) -> bool
?cmp=?cmp
xx: $814 // Generic lower than or equal -pub fun (<=)std/core/(<=): forall<a> (x : a, y : a, @implicit/cmp : (a, a) -> order) -> bool(xx: $846 : aa: V, yy: $846 : aa: V, @implicit/cmp?cmp: ($846, $846) -> order : (aa: V,aa: V) -> orderstd/core/types/order: V )result: -> total bool : boolstd/core/types/bool: V +pub fun (<=)std/core/(<=): forall<a> (x : a, y : a, @implicit/cmp : (a, a) -> order) -> bool(xx: $846 : aa: V, yy: $846 : aa: V, @implicit/cmp?cmp: ($846, $846) -> order : (aa: V,aa: V) -> orderstd/core/types/order: V )result: -> total bool : boolstd/core/types/bool: V yy: $846 >std/core/(>): (x : $846, y : $846, @implicit/cmp : ($846, $846) -> order) -> bool
?cmp=?cmp
xx: $846 @@ -231,38 +231,38 @@ // ---------------------------------------------------------------------------- // Used by the compiler to wrap main console applications -pub extern main-consolestd/core/main-console: forall<a,e> (main : () -> e a) -> e a : forall<aa: V,ee: E> ( main : () -> ee: E aa: V ) -> ee: E aa: V +pub extern main-consolestd/core/main-console: forall<a,e> (main : () -> e a) -> e a : forall<aa: V,ee: E> ( main : () -> ee: E aa: V ) -> ee: E aa: V c "kk_main_console" cs inline "Primitive.MainConsole<##1>(#1)" js inline "(#1)()" // Return the host environment: `dotnet`, `browser`, `webworker`, `node`, or `libc`. -pub extern hoststd/core/host: () -> ndet string() : ndetstd/core/types/ndet: X stringstd/core/types/string: V +pub extern hoststd/core/host: () -> ndet string() : ndetstd/core/types/ndet: X stringstd/core/types/string: V c "kk_get_host" cs inline "\"dotnet\"" js inline "$std_core_console._host" // The default exception handler -pub fun @default-exn(actionaction: () -> <exn,console|$1104> () : () -> <exnstd/core/exn/exn: (E, V) -> V,consolestd/core/console/console: X|std/core/types/effect-extend: (X, E) -> Eee: E> (std/core/types/unit: V)std/core/types/unit: V )result: -> <console|1257> () : <consolestd/core/console/console: X|std/core/types/effect-extend: (X, E) -> Eee: E> (std/core/types/unit: V)std/core/types/unit: V +pub fun @default-exn(actionaction: () -> <exn,console|$1104> () : () -> <exnstd/core/exn/exn: (E, V) -> V,consolestd/core/console/console: X|std/core/types/effect-extend: (X, E) -> Eee: E> (std/core/types/unit: V)std/core/types/unit: V )result: -> <console|1257> () : <consolestd/core/console/console: X|std/core/types/effect-extend: (X, E) -> Eee: E> (std/core/types/unit: V)std/core/types/unit: V handlehandler: (() -> <exn,console|$1104> ()) -> <console|$1104> ()( actionaction: () -> <exn,console|$1104> () ) - final ctl throw-exnthrow-exn: (exn : exception) -> <console|$1104> ()( exnexn: exception : exceptionstd/core/exn/exception: V ) - "uncaught exception: "literal: string
count= 20
.printstd/core/console/string/print: (s : string) -> <console|$1104> () - exnexn: exception.printlnstd/core/console/show/println: (x : exception, @implicit/show : (exception) -> string) -> <console|$1104> ()
?show=show
+ final ctl throw-exnthrow-exn: (exn : exception) -> <console|$1104> ()( exnexn: exception : exceptionstd/core/exn/exception: V ) + "uncaught exception: "literal: string
count= 20
.printstd/core/console/string/print: (s : string) -> <console|$1104> () + exnexn: exception.printlnstd/core/console/show/println: (x : exception, @implicit/show : (exception) -> string) -> <console|$1104> ()
?show=show
// ---------------------------------------------------------------------------- // Non determinism // ---------------------------------------------------------------------------- -noinline val unique-countstd/core/unique-count: ref<global,int> : refstd/core/types/ref: (H, V) -> V<globalstd/core/types/global: H,intstd/core/types/int: V> = unsafe-totalstd/core/unsafe/unsafe-total: (action : () -> <alloc<global>|_1278> ref<global,int>) -> ref<global,int>{ refstd/core/types/ref: (value : int) -> <alloc<global>|_1278> ref<global,int>(0literal: int
dec = 0
hex8 = 0x00
bit8 = 0b00000000
)
} +noinline val unique-countstd/core/unique-count: ref<global,int> : refstd/core/types/ref: (H, V) -> V<globalstd/core/types/global: H,intstd/core/types/int: V> = unsafe-totalstd/core/unsafe/unsafe-total: (action : () -> <alloc<global>|_1278> ref<global,int>) -> ref<global,int>{ refstd/core/types/ref: (value : int) -> <alloc<global>|_1278> ref<global,int>(0literal: int
dec = 0
hex8 = 0x00
bit8 = 0b00000000
)
} // Returns a unique integer (modulo 32-bits). -pub fun uniquestd/core/unique: () -> ndet int()result: -> ndet int : ndetstd/core/types/ndet: X intstd/core/types/int: V - unsafe-totalstd/core/unsafe/unsafe-total: (action : () -> <read<global>,write<global>|_1326> int) -> ndet int - val uu: int = !std/core/types/ref/(!): (ref : ref<global,int>) -> <read<global>,write<global>|_1326> intunique-countstd/core/unique-count: ref<global,int> - unique-countstd/core/unique-count: ref<global,int> :=std/core/types/set: (ref : ref<global,int>, assigned : int) -> <write<global>,read<global>|_1326> () uu: int+std/core/int/(+): (x : int, y : int) -> <write<global>,read<global>|_1326> int1literal: int
dec = 1
hex8 = 0x01
bit8 = 0b00000001
+
pub fun uniquestd/core/unique: () -> ndet int()result: -> ndet int : ndetstd/core/types/ndet: X intstd/core/types/int: V + unsafe-totalstd/core/unsafe/unsafe-total: (action : () -> <read<global>,write<global>|_1326> int) -> ndet int + val uu: int = !std/core/types/ref/(!): (ref : ref<global,int>) -> <read<global>,write<global>|_1326> intunique-countstd/core/unique-count: ref<global,int> + unique-countstd/core/unique-count: ref<global,int> :=std/core/types/set: (ref : ref<global,int>, assigned : int) -> <write<global>,read<global>|_1326> () uu: int+std/core/int/(+): (x : int, y : int) -> <write<global>,read<global>|_1326> int1literal: int
dec = 1
hex8 = 0x01
bit8 = 0b00000001
uu: int @@ -271,8 +271,8 @@ // ---------------------------------------------------------------------------- // A `:stream` is a co-inductive type representing an infinite list of elements. -pub co type streamstd/core/stream: V -> V<aa: V> - con Nextstd/core/Next: forall<a> (head : a, tail : stream<a>) -> stream<a>(headstd/core/stream/head: forall<a> (stream : stream<a>) -> a:aa: V, tailstd/core/stream/tail: forall<a> (stream : stream<a>) -> stream<a>: streamstd/core/stream: V -> V<aa: V> ) +pub co type streamstd/core/stream: V -> V<aa: V> + con Nextstd/core/Next: forall<a> (head : a, tail : stream<a>) -> stream<a>(headstd/core/stream/head: forall<a> (stream : stream<a>) -> a:aa: V, tailstd/core/stream/tail: forall<a> (stream : stream<a>) -> stream<a>: streamstd/core/stream: V -> V<aa: V> ) diff --git a/doc/std_core.html b/doc/std_core.html index f3eb4460d..d74ee3f39 100644 --- a/doc/std_core.html +++ b/doc/std_core.html @@ -15,78 +15,78 @@ -

std/core▲toc

+

std/core▲toc

- - - - - - - - - - - - - - - - - - @@ -112,50 +112,50 @@

Core functions.

This module is implicitly imported and all functions and types are always available. Some types and operations are required to be defined for the compiler - to work correctly (i.e. types like exnstd/core/exn/exn: (E, V) -> V or liststd/core/types/list: V -> V). + to work correctly (i.e. types like exnstd/core/exn/exn: (E, V) -> V or liststd/core/types/list: V -> V).

-
+

The blockingstd/core/blocking: X effect signifies that a function may block.

-
+

The fsysstd/core/fsys: X effect signifies a function may access the file system.

-
+

The global-scopestd/core/global-scope: S is a special type constant to denote the global scope.

-
+

The iostd/core/io: E effect is used for functions that perform arbitrary I/O operations.

-
+

The io-noexnstd/core/io-noexn: E effect is used for functions that perform arbitrary I/O operations, but raise no exceptions.

-
+ -
+

The netstd/core/net: X effect signifies a function may access the network.

-
+

The named effect is the default umbrella effect for named effects.

-
+

An alias for pure effects: a pure function always returns the same result when called with the same arguments but may not terminate or raise an exception.

-
+

The scopestd/core/scope: S -> X effect is used to ensure named effects cannot escape the scope of their handler.

-
+

A streamstd/core/stream: V -> V is a co-inductive type representing an infinite list of elements.

con Next(head : atail : streamstd/core/stream: V -> V<a>)
fun stream/head( ^stream : streamstd/core/stream: V -> V<a> ) : a
@@ -165,50 +165,50 @@

Core functions.

Automatically generated. Retrieves the tail constructor field of the streamstd/core/stream: V -> V type.

-
+

The uistd/core/ui: X effect signifies a function may access the graphics system.

-
fun cmp/(==)( x : a, y : a, ?cmp : (a, a) -> orderstd/core/types/order: V ) : boolstd/core/types/bool: V
+
fun cmp/(==)( x : a, y : a, ?cmp : (a, a) -> orderstd/core/types/order: V ) : boolstd/core/types/bool: V

Generic equality if cmp exists.

-
fun range/fold( start : intstd/core/types/int: V, end : intstd/core/types/int: V, init : a, f : (intstd/core/types/int: V, a) -> e a ) : e a
+
fun range/fold( start : intstd/core/types/int: V, end : intstd/core/types/int: V, init : a, f : (intstd/core/types/int: V, a) -> e a ) : e a

Fold over the integers between [start,end] (including end).

-
+
-

Fold over the integers between [start,end] (including end) or until f returns Nothingstd/core/types/Nothing: forall<a> maybe<a>. +

Fold over the integers between [start,end] (including end) or until f returns Nothingstd/core/types/Nothing: forall<a> maybe<a>.

-
fun range/for( ^start : intstd/core/types/int: V, end : intstd/core/types/int: V, action : (intstd/core/types/int: V) -> e () ) : e ()
+
fun range/for( ^start : intstd/core/types/int: V, end : intstd/core/types/int: V, action : (intstd/core/types/int: V) -> e () ) : e ()

Executes action for each integer from start to end (including end ). If start > end the function returns without any call to action .

-
+

Executes action for each integer between start to end (including end ). If start > end the function returns without any call to action . -If action returns Juststd/core/types/Just: forall<a> (value : a) -> maybe<a>, the iteration is stopped and the result returned. +If action returns Juststd/core/types/Just: forall<a> (value : a) -> maybe<a>, the iteration is stopped and the result returned.

-
fun (!=)( x : a, y : a, ?(==) : (a, a) -> boolstd/core/types/bool: V ) : boolstd/core/types/bool: V
+
fun (!=)( x : a, y : a, ?(==) : (a, a) -> boolstd/core/types/bool: V ) : boolstd/core/types/bool: V

Generic inequality.

-
fun (<)( x : a, y : a, ?cmp : (a, a) -> orderstd/core/types/order: V ) : boolstd/core/types/bool: V
+
fun (<)( x : a, y : a, ?cmp : (a, a) -> orderstd/core/types/order: V ) : boolstd/core/types/bool: V

Generic lower than.

-
fun (<=)( x : a, y : a, ?cmp : (a, a) -> orderstd/core/types/order: V ) : boolstd/core/types/bool: V
+
fun (<=)( x : a, y : a, ?cmp : (a, a) -> orderstd/core/types/order: V ) : boolstd/core/types/bool: V

Generic lower than or equal.

-
fun (>)( x : a, y : a, ?cmp : (a, a) -> orderstd/core/types/order: V ) : boolstd/core/types/bool: V
+
fun (>)( x : a, y : a, ?cmp : (a, a) -> orderstd/core/types/order: V ) : boolstd/core/types/bool: V

Generic greater than.

-
fun (>=)( x : a, y : a, ?cmp : (a, a) -> orderstd/core/types/order: V ) : boolstd/core/types/bool: V
+
fun (>=)( x : a, y : a, ?cmp : (a, a) -> orderstd/core/types/order: V ) : boolstd/core/types/bool: V

Generic greater than or equal.

@@ -220,26 +220,26 @@

Core functions.

Return a ‘constant’ function that ignores its argument and always returns the same result.

-
fun fold( upto : intstd/core/types/int: V, init : a, f : (intstd/core/types/int: V, a) -> e a ) : e a
+
fun fold( upto : intstd/core/types/int: V, init : a, f : (intstd/core/types/int: V, a) -> e a ) : e a

Fold over the integers between [0,upto) (excluding upto).

-
+
-

Fold over the integers between [0,n) (excluding n) or until f returns Nothingstd/core/types/Nothing: forall<a> maybe<a>. +

Fold over the integers between [0,n) (excluding n) or until f returns Nothingstd/core/types/Nothing: forall<a> maybe<a>.

-
fun for( ^n : intstd/core/types/int: V, action : (intstd/core/types/int: V) -> e () ) : e ()
+
fun for( ^n : intstd/core/types/int: V, action : (intstd/core/types/int: V) -> e () ) : e ()

Executes action n times for each integer from 0 to malformed identifier: a dash must be preceded by a letter or digit, and followed by a letter. If n <= 0 the function returns without any call to action .

-
+

Executes action for each integer between [0,n) (excluding n ). If n <= 0 the function returns without any call to action . -If action returns Juststd/core/types/Just: forall<a> (value : a) -> maybe<a>, the iteration is stopped and the result returned. +If action returns Juststd/core/types/Just: forall<a> (value : a) -> maybe<a>, the iteration is stopped and the result returned.

-
+

Return the host environment: dotnet, browser, webworker, node, or libc.

@@ -255,7 +255,7 @@

Core functions.

Compose two functions f and g.

-
fun repeat( ^n : intstd/core/types/int: V, action : () -> e () ) : e ()
+
fun repeat( ^n : intstd/core/types/int: V, action : () -> e () ) : e ()

The repeat fun executes action n times.

@@ -263,15 +263,15 @@

Core functions.

Concise way to ensure two expressions have the same type.

-
+

Returns a unique integer (modulo 32-bits).

-
fun while( predicate : () -> <divstd/core/types/div: X|e> boolstd/core/types/bool: V, action : () -> <divstd/core/types/div: X|e> () ) : <divstd/core/types/div: X|e> ()
+ - + diff --git a/doc/std_core_bool-source.html b/doc/std_core_bool-source.html index f30cedddc..2386086f4 100644 --- a/doc/std_core_bool-source.html +++ b/doc/std_core_bool-source.html @@ -25,49 +25,49 @@ // Standard `:bool` functions. // // Booleans are either `True` or `False`. -module std/core/boolstd/core/bool +module std/core/boolstd/core/bool -import std/core/typesstd/core/types +import std/core/typesstd/core/types // ---------------------------------------------------------------------------- // Booleans // ---------------------------------------------------------------------------- -pub fip fun (==)std/core/bool/(==): (x : bool, y : bool) -> bool( xx: bool : boolstd/core/types/bool: V, yy: bool : boolstd/core/types/bool: V)result: -> total bool : boolstd/core/types/bool: V - if xx: bool then yy: bool else !std/core/types/bool/(!): (b : bool) -> boolyy: bool +pub fip fun (==)std/core/bool/(==): (x : bool, y : bool) -> bool( xx: bool : boolstd/core/types/bool: V, yy: bool : boolstd/core/types/bool: V)result: -> total bool : boolstd/core/types/bool: V + if xx: bool then yy: bool else !std/core/types/bool/(!): (b : bool) -> boolyy: bool -pub fip fun (!=)std/core/bool/(!=): (x : bool, y : bool) -> bool( xx: bool : boolstd/core/types/bool: V, yy: bool : boolstd/core/types/bool: V)result: -> total bool : boolstd/core/types/bool: V - if xx: bool then !std/core/types/bool/(!): (b : bool) -> boolyy: bool else yy: bool +pub fip fun (!=)std/core/bool/(!=): (x : bool, y : bool) -> bool( xx: bool : boolstd/core/types/bool: V, yy: bool : boolstd/core/types/bool: V)result: -> total bool : boolstd/core/types/bool: V + if xx: bool then !std/core/types/bool/(!): (b : bool) -> boolyy: bool else yy: bool -pub fip fun (<)std/core/bool/(<): (x : bool, y : bool) -> bool( xx: bool : boolstd/core/types/bool: V, yy: bool : boolstd/core/types/bool: V)result: -> total bool : boolstd/core/types/bool: V - (!std/core/types/bool/(!): (b : bool) -> boolxx: bool &&std/core/types/(&&): (x : bool, y : bool) -> bool yy: bool) +pub fip fun (<)std/core/bool/(<): (x : bool, y : bool) -> bool( xx: bool : boolstd/core/types/bool: V, yy: bool : boolstd/core/types/bool: V)result: -> total bool : boolstd/core/types/bool: V + (!std/core/types/bool/(!): (b : bool) -> boolxx: bool &&std/core/types/(&&): (x : bool, y : bool) -> bool yy: bool) -pub fip fun (<=)std/core/bool/(<=): (x : bool, y : bool) -> bool( xx: bool : boolstd/core/types/bool: V, yy: bool : boolstd/core/types/bool: V)result: -> total bool : boolstd/core/types/bool: V - !std/core/types/bool/(!): (b : bool) -> bool(xx: bool >std/core/bool/(>): (x : bool, y : bool) -> bool yy: bool) +pub fip fun (<=)std/core/bool/(<=): (x : bool, y : bool) -> bool( xx: bool : boolstd/core/types/bool: V, yy: bool : boolstd/core/types/bool: V)result: -> total bool : boolstd/core/types/bool: V + !std/core/types/bool/(!): (b : bool) -> bool(xx: bool >std/core/bool/(>): (x : bool, y : bool) -> bool yy: bool) -pub fip fun (>)std/core/bool/(>): (x : bool, y : bool) -> bool( xx: bool : boolstd/core/types/bool: V, yy: bool : boolstd/core/types/bool: V)result: -> total bool : boolstd/core/types/bool: V - (xx: bool &&std/core/types/(&&): (x : bool, y : bool) -> bool !std/core/types/bool/(!): (b : bool) -> boolyy: bool) +pub fip fun (>)std/core/bool/(>): (x : bool, y : bool) -> bool( xx: bool : boolstd/core/types/bool: V, yy: bool : boolstd/core/types/bool: V)result: -> total bool : boolstd/core/types/bool: V + (xx: bool &&std/core/types/(&&): (x : bool, y : bool) -> bool !std/core/types/bool/(!): (b : bool) -> boolyy: bool) -pub fip fun (>=)std/core/bool/(>=): (x : bool, y : bool) -> bool( xx: bool : boolstd/core/types/bool: V, yy: bool : boolstd/core/types/bool: V)result: -> total bool : boolstd/core/types/bool: V - !std/core/types/bool/(!): (b : bool) -> bool(xx: bool <std/core/bool/(<): (x : bool, y : bool) -> bool yy: bool) +pub fip fun (>=)std/core/bool/(>=): (x : bool, y : bool) -> bool( xx: bool : boolstd/core/types/bool: V, yy: bool : boolstd/core/types/bool: V)result: -> total bool : boolstd/core/types/bool: V + !std/core/types/bool/(!): (b : bool) -> bool(xx: bool <std/core/bool/(<): (x : bool, y : bool) -> bool yy: bool) // Compare two booleans with `False < True`. -pub fip fun cmpstd/core/bool/cmp: (x : bool, y : bool) -> order( xx: bool : boolstd/core/types/bool: V, yy: bool : boolstd/core/types/bool: V)result: -> total order : orderstd/core/types/order: V - if xx: bool <std/core/bool/(<): (x : bool, y : bool) -> bool yy: bool then Ltstd/core/types/Lt: order - elif xx: bool >std/core/bool/(>): (x : bool, y : bool) -> bool yy: bool then Gtstd/core/types/Gt: order - else Eqstd/core/types/Eq: order +pub fip fun cmpstd/core/bool/cmp: (x : bool, y : bool) -> order( xx: bool : boolstd/core/types/bool: V, yy: bool : boolstd/core/types/bool: V)result: -> total order : orderstd/core/types/order: V + if xx: bool <std/core/bool/(<): (x : bool, y : bool) -> bool yy: bool then Ltstd/core/types/Lt: order + elif xx: bool >std/core/bool/(>): (x : bool, y : bool) -> bool yy: bool then Gtstd/core/types/Gt: order + else Eqstd/core/types/Eq: order // Order two booleans in ascending order. -pub fip fun order2std/core/bool/order2: (x : bool, y : bool) -> order2<bool>( xx: bool : boolstd/core/types/bool: V, yy: bool : boolstd/core/types/bool: V )result: -> total order2<bool> : order2std/core/types/order2: V -> V<boolstd/core/types/bool: V> - if (xx: bool==std/core/bool/(==): (x : bool, y : bool) -> boolyy: bool) then Eq2std/core/types/Eq2: forall<a> (eq : a) -> order2<a>(xx: bool) elif (xx: bool <std/core/bool/(<): (x : bool, y : bool) -> bool yy: bool) then Lt2std/core/types/Lt2: forall<a> (lt : a, gt : a) -> order2<a>(xx: bool,yy: bool) else Gt2std/core/types/Gt2: forall<a> (lt : a, gt : a) -> order2<a>(yy: bool,xx: bool) +pub fip fun order2std/core/bool/order2: (x : bool, y : bool) -> order2<bool>( xx: bool : boolstd/core/types/bool: V, yy: bool : boolstd/core/types/bool: V )result: -> total order2<bool> : order2std/core/types/order2: V -> V<boolstd/core/types/bool: V> + if (xx: bool==std/core/bool/(==): (x : bool, y : bool) -> boolyy: bool) then Eq2std/core/types/Eq2: forall<a> (eq : a) -> order2<a>(xx: bool) elif (xx: bool <std/core/bool/(<): (x : bool, y : bool) -> bool yy: bool) then Lt2std/core/types/Lt2: forall<a> (lt : a, gt : a) -> order2<a>(xx: bool,yy: bool) else Gt2std/core/types/Gt2: forall<a> (lt : a, gt : a) -> order2<a>(yy: bool,xx: bool) // Convert a `:bool` to a string -pub fun showstd/core/bool/show: (b : bool) -> string( bb: bool : boolstd/core/types/bool: V )result: -> total string : stringstd/core/types/string: V +pub fun showstd/core/bool/show: (b : bool) -> string( bb: bool : boolstd/core/types/bool: V )result: -> total string : stringstd/core/types/string: V if bb: bool then "True"literal: string
count= 4
else "False"literal: string
count= 5
// Convert a boolean to an `:int` -pub fip fun intstd/core/bool/int: (b : bool) -> int( bb: bool : boolstd/core/types/bool: V )result: -> total int : intstd/core/types/int: V +pub fip fun intstd/core/bool/int: (b : bool) -> int( bb: bool : boolstd/core/types/bool: V )result: -> total int : intstd/core/types/int: V if bb: bool then 1literal: int
dec = 1
hex8 = 0x01
bit8 = 0b00000001
else
0literal: int
dec = 0
hex8 = 0x00
bit8 = 0b00000000
diff --git a/doc/std_core_bool.html b/doc/std_core_bool.html index d25c42fc8..ef3945537 100644 --- a/doc/std_core_bool.html +++ b/doc/std_core_bool.html @@ -15,38 +15,38 @@ -

std/core/bool▲toc

+

std/core/bool▲toc

- - - - - - -
- -

Compare two booleans with Falsestd/core/types/False: bool (<)std/core/bool/(<): (x : bool, y : bool) -> bool Truestd/core/types/True: bool. +

+ + + + + + -
+
-

Convert a boolean to an intstd/core/types/int: V. +

Convert a boolean to an intstd/core/types/int: V.

-
+ -
+ - + diff --git a/doc/std_core_char-source.html b/doc/std_core_char-source.html index f8dd79619..a5e3d0573 100644 --- a/doc/std_core_char-source.html +++ b/doc/std_core_char-source.html @@ -27,106 +27,106 @@ // Characters are unicode _codepoint_\/s. // This is different from a unicode _grapheme_ which represents a single displayed // symbol and can consists of multiple codepoints due to combining characters and marks. -module std/core/charstd/core/char +module std/core/charstd/core/char -import std/core/typesstd/core/types -import std/core/intstd/core/int +import std/core/typesstd/core/types +import std/core/intstd/core/int // ---------------------------------------------------------------------------- // Characters // ---------------------------------------------------------------------------- // Are two characters equal? -pub inline fip extern (==)std/core/char/(==): (char, char) -> bool : (charstd/core/types/char: V,charstd/core/types/char: V) -> boolstd/core/types/bool: V +pub inline fip extern (==)std/core/char/(==): (char, char) -> bool : (charstd/core/types/char: V,charstd/core/types/char: V) -> boolstd/core/types/bool: V inline "(#1 == #2)" js inline "(#1 === #2)" // Are two characters not equal? -pub inline fip extern (!=)std/core/char/(!=): (char, char) -> bool : (charstd/core/types/char: V,charstd/core/types/char: V) -> boolstd/core/types/bool: V +pub inline fip extern (!=)std/core/char/(!=): (char, char) -> bool : (charstd/core/types/char: V,charstd/core/types/char: V) -> boolstd/core/types/bool: V inline "(#1 != #2)" js inline "(#1 !== #2)" // Is a character code point lower or equal to that of another? -pub inline fip extern (<=)std/core/char/(<=): (char, char) -> bool : (charstd/core/types/char: V,charstd/core/types/char: V) -> boolstd/core/types/bool: V +pub inline fip extern (<=)std/core/char/(<=): (char, char) -> bool : (charstd/core/types/char: V,charstd/core/types/char: V) -> boolstd/core/types/bool: V inline "(#1 <= #2)" // Is a character code point greater or equal to that of another? -pub inline fip extern (>=)std/core/char/(>=): (char, char) -> bool : (charstd/core/types/char: V,charstd/core/types/char: V) -> boolstd/core/types/bool: V +pub inline fip extern (>=)std/core/char/(>=): (char, char) -> bool : (charstd/core/types/char: V,charstd/core/types/char: V) -> boolstd/core/types/bool: V inline "(#1 >= #2)" // Is a character code point lower to that of another? -pub inline fip extern (<)std/core/char/(<): (char, char) -> bool : (charstd/core/types/char: V,charstd/core/types/char: V) -> boolstd/core/types/bool: V +pub inline fip extern (<)std/core/char/(<): (char, char) -> bool : (charstd/core/types/char: V,charstd/core/types/char: V) -> boolstd/core/types/bool: V inline "(#1 < #2)" // Is a character code point greater to that of another? -pub inline fip extern (>)std/core/char/(>): (char, char) -> bool : (charstd/core/types/char: V,charstd/core/types/char: V) -> boolstd/core/types/bool: V +pub inline fip extern (>)std/core/char/(>): (char, char) -> bool : (charstd/core/types/char: V,charstd/core/types/char: V) -> boolstd/core/types/bool: V inline "(#1 > #2)" // Compare character code points. -pub fip fun cmpstd/core/char/cmp: (x : char, y : char) -> order( xx: char : charstd/core/types/char: V, yy: char : charstd/core/types/char: V )result: -> total order : orderstd/core/types/order: V - if xx: char <std/core/char/(<): (char, char) -> bool yy: char then Ltstd/core/types/Lt: order - elif xx: char >std/core/char/(>): (char, char) -> bool yy: char then Gtstd/core/types/Gt: order - else Eqstd/core/types/Eq: order +pub fip fun cmpstd/core/char/cmp: (x : char, y : char) -> order( xx: char : charstd/core/types/char: V, yy: char : charstd/core/types/char: V )result: -> total order : orderstd/core/types/order: V + if xx: char <std/core/char/(<): (char, char) -> bool yy: char then Ltstd/core/types/Lt: order + elif xx: char >std/core/char/(>): (char, char) -> bool yy: char then Gtstd/core/types/Gt: order + else Eqstd/core/types/Eq: order // Order two characters in ascending order. -pub fip fun order2std/core/char/order2: (x : char, y : char) -> order2<char>( xx: char : charstd/core/types/char: V, yy: char : charstd/core/types/char: V )result: -> total order2<char> : order2std/core/types/order2: V -> V<charstd/core/types/char: V> - if (xx: char==std/core/char/(==): (char, char) -> boolyy: char) then Eq2std/core/types/Eq2: forall<a> (eq : a) -> order2<a>(xx: char) elif (xx: char <std/core/char/(<): (char, char) -> bool yy: char) then Lt2std/core/types/Lt2: forall<a> (lt : a, gt : a) -> order2<a>(xx: char,yy: char) else Gt2std/core/types/Gt2: forall<a> (lt : a, gt : a) -> order2<a>(yy: char,xx: char) +pub fip fun order2std/core/char/order2: (x : char, y : char) -> order2<char>( xx: char : charstd/core/types/char: V, yy: char : charstd/core/types/char: V )result: -> total order2<char> : order2std/core/types/order2: V -> V<charstd/core/types/char: V> + if (xx: char==std/core/char/(==): (char, char) -> boolyy: char) then Eq2std/core/types/Eq2: forall<a> (eq : a) -> order2<a>(xx: char) elif (xx: char <std/core/char/(<): (char, char) -> bool yy: char) then Lt2std/core/types/Lt2: forall<a> (lt : a, gt : a) -> order2<a>(xx: char,yy: char) else Gt2std/core/types/Gt2: forall<a> (lt : a, gt : a) -> order2<a>(yy: char,xx: char) // Convert a character to its unicode code point -pub inline fip extern intstd/core/char/int: (char) -> int : (charstd/core/types/char: V) -> intstd/core/types/int: V +pub inline fip extern intstd/core/char/int: (char) -> int : (charstd/core/types/char: V) -> intstd/core/types/int: V inline "#1" c "kk_integer_from_int" cs inline "new BigInteger(#1)" // Convert a unicode code point to a character -pub inline fip extern int/charstd/core/char/int/char: (i : int) -> char( i : intstd/core/types/int: V) : charstd/core/types/char: V +pub inline fip extern int/charstd/core/char/int/char: (i : int) -> char( i : intstd/core/types/int: V) : charstd/core/types/char: V inline "(#1)" c "kk_integer_clamp32" cs inline "Primitive.IntToInt32(#1)" // Add two character code points -pub fip fun (+)std/core/char/(+): (c : char, d : char) -> char(cc: char : charstd/core/types/char: V, dd: char : charstd/core/types/char: V)result: -> total char : totalstd/core/types/total: E charstd/core/types/char: V - (cc: char.intstd/core/char/int: (char) -> int +std/core/int/(+): (x : int, y : int) -> int dd: char.intstd/core/char/int: (char) -> int).charstd/core/char/int/char: (i : int) -> char +pub fip fun (+)std/core/char/(+): (c : char, d : char) -> char(cc: char : charstd/core/types/char: V, dd: char : charstd/core/types/char: V)result: -> total char : totalstd/core/types/total: E charstd/core/types/char: V + (cc: char.intstd/core/char/int: (char) -> int +std/core/int/(+): (x : int, y : int) -> int dd: char.intstd/core/char/int: (char) -> int).charstd/core/char/int/char: (i : int) -> char // Subtract two character code points -pub fip fun (-)std/core/char/(-): (c : char, d : char) -> char(cc: char : charstd/core/types/char: V, dd: char : charstd/core/types/char: V)result: -> total char : totalstd/core/types/total: E charstd/core/types/char: V - (cc: char.intstd/core/char/int: (char) -> int -std/core/int/(-): (x : int, y : int) -> int dd: char.intstd/core/char/int: (char) -> int).charstd/core/char/int/char: (i : int) -> char +pub fip fun (-)std/core/char/(-): (c : char, d : char) -> char(cc: char : charstd/core/types/char: V, dd: char : charstd/core/types/char: V)result: -> total char : totalstd/core/types/total: E charstd/core/types/char: V + (cc: char.intstd/core/char/int: (char) -> int -std/core/int/(-): (x : int, y : int) -> int dd: char.intstd/core/char/int: (char) -> int).charstd/core/char/int/char: (i : int) -> char // Is the character a lower-case ASCII character? -pub fip fun is-lowerstd/core/char/is-lower: (c : char) -> bool( cc: char : charstd/core/types/char: V )result: -> total bool : boolstd/core/types/bool: V - cc: char >=std/core/char/(>=): (char, char) -> bool 'a'literal: char
unicode= u0061
&&std/core/types/(&&): (x : bool, y : bool) -> bool cc: char <=std/core/char/(<=): (char, char) -> bool 'z'literal: char
unicode= u007A
+pub fip fun is-lowerstd/core/char/is-lower: (c : char) -> bool( cc: char : charstd/core/types/char: V )result: -> total bool : boolstd/core/types/bool: V + cc: char >=std/core/char/(>=): (char, char) -> bool 'a'literal: char
unicode= u0061
&&std/core/types/(&&): (x : bool, y : bool) -> bool cc: char <=std/core/char/(<=): (char, char) -> bool 'z'literal: char
unicode= u007A
// Is the character an upper-case ASCII character? -pub fip fun is-upperstd/core/char/is-upper: (c : char) -> bool( cc: char : charstd/core/types/char: V )result: -> total bool : boolstd/core/types/bool: V - cc: char >=std/core/char/(>=): (char, char) -> bool 'A'literal: char
unicode= u0041
&&std/core/types/(&&): (x : bool, y : bool) -> bool cc: char <=std/core/char/(<=): (char, char) -> bool 'Z'literal: char
unicode= u005A
+pub fip fun is-upperstd/core/char/is-upper: (c : char) -> bool( cc: char : charstd/core/types/char: V )result: -> total bool : boolstd/core/types/bool: V + cc: char >=std/core/char/(>=): (char, char) -> bool 'A'literal: char
unicode= u0041
&&std/core/types/(&&): (x : bool, y : bool) -> bool cc: char <=std/core/char/(<=): (char, char) -> bool 'Z'literal: char
unicode= u005A
// Is the character an ASCII digit ? -pub fip fun is-digitstd/core/char/is-digit: (c : char) -> bool( cc: char : charstd/core/types/char: V )result: -> total bool : boolstd/core/types/bool: V - cc: char >=std/core/char/(>=): (char, char) -> bool '0'literal: char
unicode= u0030
&&std/core/types/(&&): (x : bool, y : bool) -> bool cc: char <=std/core/char/(<=): (char, char) -> bool '9'literal: char
unicode= u0039
+pub fip fun is-digitstd/core/char/is-digit: (c : char) -> bool( cc: char : charstd/core/types/char: V )result: -> total bool : boolstd/core/types/bool: V + cc: char >=std/core/char/(>=): (char, char) -> bool '0'literal: char
unicode= u0030
&&std/core/types/(&&): (x : bool, y : bool) -> bool cc: char <=std/core/char/(<=): (char, char) -> bool '9'literal: char
unicode= u0039
// Is the character an ASCII hexa-decimal digit? -pub fip fun is-hex-digitstd/core/char/is-hex-digit: (c : char) -> bool( cc: char : charstd/core/types/char: V )result: -> total bool : boolstd/core/types/bool: V - cc: char.is-digitstd/core/char/is-digit: (c : char) -> bool ||std/core/types/(||): (x : bool, y : bool) -> bool (cc: char >=std/core/char/(>=): (char, char) -> bool 'a'literal: char
unicode= u0061
&&std/core/types/(&&): (x : bool, y : bool) -> bool cc: char <=std/core/char/(<=): (char, char) -> bool 'f'literal: char
unicode= u0066
) ||std/core/types/(||): (x : bool, y : bool) -> bool (cc: char >=std/core/char/(>=): (char, char) -> bool 'A'literal: char
unicode= u0041
&&std/core/types/(&&): (x : bool, y : bool) -> bool cc: char <=std/core/char/(<=): (char, char) -> bool 'F'literal: char
unicode= u0046
) +pub fip fun is-hex-digitstd/core/char/is-hex-digit: (c : char) -> bool( cc: char : charstd/core/types/char: V )result: -> total bool : boolstd/core/types/bool: V + cc: char.is-digitstd/core/char/is-digit: (c : char) -> bool ||std/core/types/(||): (x : bool, y : bool) -> bool (cc: char >=std/core/char/(>=): (char, char) -> bool 'a'literal: char
unicode= u0061
&&std/core/types/(&&): (x : bool, y : bool) -> bool cc: char <=std/core/char/(<=): (char, char) -> bool 'f'literal: char
unicode= u0066
) ||std/core/types/(||): (x : bool, y : bool) -> bool (cc: char >=std/core/char/(>=): (char, char) -> bool 'A'literal: char
unicode= u0041
&&std/core/types/(&&): (x : bool, y : bool) -> bool cc: char <=std/core/char/(<=): (char, char) -> bool 'F'literal: char
unicode= u0046
) // Is the character an ASCII letter? -pub fip fun is-alphastd/core/char/is-alpha: (c : char) -> bool( cc: char : charstd/core/types/char: V )result: -> total bool : boolstd/core/types/bool: V - cc: char.is-lowerstd/core/char/is-lower: (c : char) -> bool ||std/core/types/(||): (x : bool, y : bool) -> bool cc: char.is-upperstd/core/char/is-upper: (c : char) -> bool +pub fip fun is-alphastd/core/char/is-alpha: (c : char) -> bool( cc: char : charstd/core/types/char: V )result: -> total bool : boolstd/core/types/bool: V + cc: char.is-lowerstd/core/char/is-lower: (c : char) -> bool ||std/core/types/(||): (x : bool, y : bool) -> bool cc: char.is-upperstd/core/char/is-upper: (c : char) -> bool // Is the character ASCII letter or digit? -pub fip fun is-alpha-numstd/core/char/is-alpha-num: (c : char) -> bool( cc: char : charstd/core/types/char: V )result: -> total bool : boolstd/core/types/bool: V - cc: char.is-alphastd/core/char/is-alpha: (c : char) -> bool ||std/core/types/(||): (x : bool, y : bool) -> bool cc: char.is-digitstd/core/char/is-digit: (c : char) -> bool +pub fip fun is-alpha-numstd/core/char/is-alpha-num: (c : char) -> bool( cc: char : charstd/core/types/char: V )result: -> total bool : boolstd/core/types/bool: V + cc: char.is-alphastd/core/char/is-alpha: (c : char) -> bool ||std/core/types/(||): (x : bool, y : bool) -> bool cc: char.is-digitstd/core/char/is-digit: (c : char) -> bool // Is the character an ASCII character, e.g. `c <= '\x7F'`? -pub fip fun is-asciistd/core/char/is-ascii: (c : char) -> bool( cc: char : charstd/core/types/char: V )result: -> total bool : boolstd/core/types/bool: V +pub fip fun is-asciistd/core/char/is-ascii: (c : char) -> bool( cc: char : charstd/core/types/char: V )result: -> total bool : boolstd/core/types/bool: V cc: char <=std/core/char/(<=): (char, char) -> bool '\DEL'literal: char
unicode= u007F
// Is the character an ASCII control character, e.g. `c < ' '`? -pub fip fun is-controlstd/core/char/is-control: (c : char) -> bool( cc: char : charstd/core/types/char: V )result: -> total bool : boolstd/core/types/bool: V +pub fip fun is-controlstd/core/char/is-control: (c : char) -> bool( cc: char : charstd/core/types/char: V )result: -> total bool : boolstd/core/types/bool: V cc: char <std/core/char/(<): (char, char) -> bool ' 'literal: char
unicode= u0020
// Tests if a character is an element of `" \t\n\r"` -pub fip fun is-whitestd/core/char/is-white: (c : char) -> bool( cc: char : charstd/core/types/char: V )result: -> total bool : boolstd/core/types/bool: V - cc: char ==std/core/char/(==): (char, char) -> bool ' 'literal: char
unicode= u0020
||std/core/types/(||): (x : bool, y : bool) -> bool cc: char ==std/core/char/(==): (char, char) -> bool '\t'literal: char
unicode= u0009
||std/core/types/(||): (x : bool, y : bool) -> bool cc: char ==std/core/char/(==): (char, char) -> bool '\n'literal: char
unicode= u000A
||std/core/types/(||): (x : bool, y : bool) -> bool cc: char ==std/core/char/(==): (char, char) -> bool '\r'literal: char
unicode= u000D
+pub fip fun is-whitestd/core/char/is-white: (c : char) -> bool( cc: char : charstd/core/types/char: V )result: -> total bool : boolstd/core/types/bool: V + cc: char ==std/core/char/(==): (char, char) -> bool ' 'literal: char
unicode= u0020
||std/core/types/(||): (x : bool, y : bool) -> bool cc: char ==std/core/char/(==): (char, char) -> bool '\t'literal: char
unicode= u0009
||std/core/types/(||): (x : bool, y : bool) -> bool cc: char ==std/core/char/(==): (char, char) -> bool '\n'literal: char
unicode= u000A
||std/core/types/(||): (x : bool, y : bool) -> bool cc: char ==std/core/char/(==): (char, char) -> bool '\r'literal: char
unicode= u000D
diff --git a/doc/std_core_char.html b/doc/std_core_char.html index a8fdfce11..10c020bca 100644 --- a/doc/std_core_char.html +++ b/doc/std_core_char.html @@ -15,10 +15,10 @@ -

std/core/char▲toc

+

std/core/char▲toc

-
+

Convert a unicode code point to a character.

-
+ -
+

Add two character code points.

-
+

Subtract two character code points.

-
+

Is a character code point lower to that of another?

-
+

Is a character code point lower or equal to that of another?

-
+ -
+

Is a character code point greater to that of another?

-
+

Is a character code point greater or equal to that of another?

-
+

Compare character code points.

-
+

Convert a character to its unicode code point.

-
+

Is the character an ASCII letter?

-
+

Is the character ASCII letter or digit?

-
+

Is the character an ASCII character, e.g. c <= '\DEL'?

-
+

Is the character an ASCII control character, e.g. c < ' '?

-
+

Is the character an ASCII digit ?

-
+

Is the character an ASCII hexa-decimal digit?

-
+

Is the character a lower-case ASCII character?

-
+

Is the character an upper-case ASCII character?

-
+

Tests if a character is an element of " \t\n\r".

-
+ - + diff --git a/doc/std_core_console-source.html b/doc/std_core_console-source.html index e1aa2e6a8..de730b3fe 100644 --- a/doc/std_core_console-source.html +++ b/doc/std_core_console-source.html @@ -23,79 +23,79 @@ ---------------------------------------------------------------------------*/ // Standard output to the console. -module std/core/consolestd/core/console +module std/core/consolestd/core/console -import std/core/typesstd/core/types -import std/core/unsafestd/core/unsafe -import std/core/hndstd/core/hnd -import std/core/stringstd/core/string -import std/core/showstd/core/show +import std/core/typesstd/core/types +import std/core/unsafestd/core/unsafe +import std/core/hndstd/core/hnd +import std/core/stringstd/core/string +import std/core/showstd/core/show extern import js file "inline/console.js" // The console effect signifies that a function may write to the console. -pub type consolestd/core/console/console: X :: X +pub type consolestd/core/console/console: X :: X // ---------------------------------------------------------------------------- // Print to the console // ---------------------------------------------------------------------------- -noinline val redirectstd/core/console/redirect: ref<global,maybe<(string) -> console ()>> : refstd/core/types/ref: (H, V) -> V<globalstd/core/types/global: H,maybestd/core/types/maybe: V -> V<(stringstd/core/types/string: V) -> consolestd/core/console/console: X (std/core/types/unit: V)std/core/types/unit: V>> = - unsafe-totalstd/core/unsafe/unsafe-total: (action : () -> <alloc<global>|_68> ref<global,maybe<(string) -> console ()>>) -> ref<global,maybe<(string) -> console ()>> { refstd/core/types/ref: (value : maybe<(string) -> console ()>) -> <alloc<global>|_68> ref<global,maybe<(string) -> console ()>>(Nothingstd/core/types/Nothing: forall<a> maybe<a>) } +noinline val redirectstd/core/console/redirect: ref<global,maybe<(string) -> console ()>> : refstd/core/types/ref: (H, V) -> V<globalstd/core/types/global: H,maybestd/core/types/maybe: V -> V<(stringstd/core/types/string: V) -> consolestd/core/console/console: X (std/core/types/unit: V)std/core/types/unit: V>> = + unsafe-totalstd/core/unsafe/unsafe-total: (action : () -> <alloc<global>|_68> ref<global,maybe<(string) -> console ()>>) -> ref<global,maybe<(string) -> console ()>> { refstd/core/types/ref: (value : maybe<(string) -> console ()>) -> <alloc<global>|_68> ref<global,maybe<(string) -> console ()>>(Nothingstd/core/types/Nothing: forall<a> maybe<a>) } // Redirect `print` and `println` calls to a specified function. -noinline fun print-redirectstd/core/console/print-redirect: (print : (msg : string) -> console ()) -> <st<global>,console,ndet> ()( printprint: (msg : string) -> console () : (msg : stringstd/core/types/string: V) -> consolestd/core/console/console: X (std/core/types/unit: V)std/core/types/unit: V )result: -> <st<global>,console,ndet> () : <std/core/types/total: Endetstd/core/types/ndet: X,consolestd/core/console/console: X,ststd/core/types/st: H -> E<globalstd/core/types/global: H>> (std/core/types/unit: V)std/core/types/unit: V - redirectstd/core/console/redirect: ref<global,maybe<(string) -> console ()>> :=std/core/types/set: (ref : ref<global,maybe<(string) -> console ()>>, assigned : maybe<(string) -> console ()>) -> <write<global>,alloc<global>,console,ndet,read<global>> () Juststd/core/types/Just: forall<a> (value : a) -> maybe<a>(printprint: (msg : string) -> console ()) +noinline fun print-redirectstd/core/console/print-redirect: (print : (msg : string) -> console ()) -> <st<global>,console,ndet> ()( printprint: (msg : string) -> console () : (msg : stringstd/core/types/string: V) -> consolestd/core/console/console: X (std/core/types/unit: V)std/core/types/unit: V )result: -> <st<global>,console,ndet> () : <std/core/types/total: Endetstd/core/types/ndet: X,consolestd/core/console/console: X,ststd/core/types/st: H -> E<globalstd/core/types/global: H>> (std/core/types/unit: V)std/core/types/unit: V + redirectstd/core/console/redirect: ref<global,maybe<(string) -> console ()>> :=std/core/types/set: (ref : ref<global,maybe<(string) -> console ()>>, assigned : maybe<(string) -> console ()>) -> <write<global>,alloc<global>,console,ndet,read<global>> () Juststd/core/types/Just: forall<a> (value : a) -> maybe<a>(printprint: (msg : string) -> console ()) // Print a string to the console, including a final newline character. -extern xprintslnstd/core/console/xprintsln: (s : string) -> console ()(ss: string : stringstd/core/types/string: V) : consolestd/core/console/console: X (std/core/types/unit: V)std/core/types/unit: V +extern xprintslnstd/core/console/xprintsln: (s : string) -> console ()(ss: string : stringstd/core/types/string: V) : consolestd/core/console/console: X (std/core/types/unit: V)std/core/types/unit: V c "kk_println" cs "Console.WriteLine" js "_println" // Print a string to the console -extern xprintsstd/core/console/xprints: (s : string) -> console ()( ss: string : stringstd/core/types/string: V) : consolestd/core/console/console: X (std/core/types/unit: V)std/core/types/unit: V +extern xprintsstd/core/console/xprints: (s : string) -> console ()( ss: string : stringstd/core/types/string: V) : consolestd/core/console/console: X (std/core/types/unit: V)std/core/types/unit: V c "kk_print" cs "Console.Write" js "_print" // _Unsafe_. This function removes the state effect from the effect of an action -inline extern unsafe-nostatestd/core/console/unsafe-nostate: forall<a,h> (action : () -> <st<h>,console> a) -> (() -> console a)( action : () -> <std/core/types/total: Eststd/core/types/st: H -> E<hh: H>,consolestd/core/console/console: X> aa: V ) : ((std/core/types/total: E) -> consolestd/core/console/console: X aa: V) +inline extern unsafe-nostatestd/core/console/unsafe-nostate: forall<a,h> (action : () -> <st<h>,console> a) -> (() -> console a)( action : () -> <std/core/types/total: Eststd/core/types/st: H -> E<hh: H>,consolestd/core/console/console: X> aa: V ) : ((std/core/types/total: E) -> consolestd/core/console/console: X aa: V) inline "#1" -noinline fun printsstd/core/console/prints: (s : string) -> console ()( ss: string : stringstd/core/types/string: V )result: -> console () : consolestd/core/console/console: X (std/core/types/unit: V)std/core/types/unit: V +noinline fun printsstd/core/console/prints: (s : string) -> console ()( ss: string : stringstd/core/types/string: V )result: -> console () : consolestd/core/console/console: X (std/core/types/unit: V)std/core/types/unit: V (unsafe-nostatestd/core/console/unsafe-nostate: (action : () -> <st<global>,console> ()) -> console (() -> console ()) - match !std/core/types/ref/(!): (ref : ref<global,maybe<(string) -> console ()>>) -> <read<global>,console,alloc<_87>,write<global>> maybe<(string) -> console ()>redirectstd/core/console/redirect: ref<global,maybe<(string) -> console ()>> - Nothingstd/core/types/Nothing: forall<a> maybe<a> -> xprintsstd/core/console/xprints: (s : string) -> <console,read<global>,alloc<_87>,write<global>> ()(ss: string) - Juststd/core/types/Just: forall<a> (value : a) -> maybe<a>(ff: (string) -> console ()) -> ff: (string) -> <console,read<global>,alloc<_87>,write<global>> ()(ss: string) + match !std/core/types/ref/(!): (ref : ref<global,maybe<(string) -> console ()>>) -> <read<global>,console,alloc<_87>,write<global>> maybe<(string) -> console ()>redirectstd/core/console/redirect: ref<global,maybe<(string) -> console ()>> + Nothingstd/core/types/Nothing: forall<a> maybe<a> -> xprintsstd/core/console/xprints: (s : string) -> <console,read<global>,alloc<_87>,write<global>> ()(ss: string) + Juststd/core/types/Just: forall<a> (value : a) -> maybe<a>(ff: (string) -> console ()) -> ff: (string) -> <console,read<global>,alloc<_87>,write<global>> ()(ss: string) )() -noinline fun printslnstd/core/console/printsln: (s : string) -> console ()( ss: string : stringstd/core/types/string: V )result: -> console () : consolestd/core/console/console: X (std/core/types/unit: V)std/core/types/unit: V +noinline fun printslnstd/core/console/printsln: (s : string) -> console ()( ss: string : stringstd/core/types/string: V )result: -> console () : consolestd/core/console/console: X (std/core/types/unit: V)std/core/types/unit: V (unsafe-nostatestd/core/console/unsafe-nostate: (action : () -> <st<global>,console> ()) -> console (() -> console ()) - match !std/core/types/ref/(!): (ref : ref<global,maybe<(string) -> console ()>>) -> <read<global>,console,alloc<_198>,write<global>> maybe<(string) -> console ()>redirectstd/core/console/redirect: ref<global,maybe<(string) -> console ()>> - Nothingstd/core/types/Nothing: forall<a> maybe<a> -> xprintslnstd/core/console/xprintsln: (s : string) -> <console,read<global>,alloc<_198>,write<global>> ()(ss: string) - Juststd/core/types/Just: forall<a> (value : a) -> maybe<a>(ff: (string) -> console ()) -> { ff: (string) -> <console,read<global>,alloc<_198>,write<global>> ()(ss: string ++std/core/types/(++): (x : string, y : string) -> <console,read<global>,alloc<_198>,write<global>> string "\n"literal: string
count= 1
) } + match !std/core/types/ref/(!): (ref : ref<global,maybe<(string) -> console ()>>) -> <read<global>,console,alloc<_198>,write<global>> maybe<(string) -> console ()>redirectstd/core/console/redirect: ref<global,maybe<(string) -> console ()>> + Nothingstd/core/types/Nothing: forall<a> maybe<a> -> xprintslnstd/core/console/xprintsln: (s : string) -> <console,read<global>,alloc<_198>,write<global>> ()(ss: string) + Juststd/core/types/Just: forall<a> (value : a) -> maybe<a>(ff: (string) -> console ()) -> { ff: (string) -> <console,read<global>,alloc<_198>,write<global>> ()(ss: string ++std/core/types/(++): (x : string, y : string) -> <console,read<global>,alloc<_198>,write<global>> string "\n"literal: string
count= 1
) } )(
) // Print a string to the console. -pub fun string/printstd/core/console/string/print: (s : string) -> console ()(ss: string : stringstd/core/types/string: V)result: -> console () +pub fun string/printstd/core/console/string/print: (s : string) -> console ()(ss: string : stringstd/core/types/string: V)result: -> console () printsstd/core/console/prints: (s : string) -> console ()(ss: string) // Print a value that has a `show` function -pub fun show/printstd/core/console/show/print: forall<a> (x : a, @implicit/show : (a) -> string) -> console ()( xx: $138 : aa: V, @implicit/show?show: ($138) -> string : aa: V -> stringstd/core/types/string: V )result: -> console () : consolestd/core/console/console: X (std/core/types/unit: V)std/core/types/unit: V +pub fun show/printstd/core/console/show/print: forall<a> (x : a, @implicit/show : (a) -> string) -> console ()( xx: $138 : aa: V, @implicit/show?show: ($138) -> string : aa: V -> stringstd/core/types/string: V )result: -> console () : consolestd/core/console/console: X (std/core/types/unit: V)std/core/types/unit: V printsstd/core/console/prints: (s : string) -> console ()(xx: $138.show?show: ($138) -> console string) // Print a string to the console, including a final newline character. -pub fun string/printlnstd/core/console/string/println: (s : string) -> console ()(ss: string : stringstd/core/types/string: V)result: -> console () : consolestd/core/console/console: X (std/core/types/unit: V)std/core/types/unit: V +pub fun string/printlnstd/core/console/string/println: (s : string) -> console ()(ss: string : stringstd/core/types/string: V)result: -> console () : consolestd/core/console/console: X (std/core/types/unit: V)std/core/types/unit: V printslnstd/core/console/printsln: (s : string) -> console ()(ss: string) // Print a value that has a `show` function, including a final newline character. -pub fun show/printlnstd/core/console/show/println: forall<a> (x : a, @implicit/show : (a) -> string) -> console ()( xx: $257 : aa: V, @implicit/show?show: ($257) -> string : aa: V -> stringstd/core/types/string: V )result: -> console () : consolestd/core/console/console: X (std/core/types/unit: V)std/core/types/unit: V +pub fun show/printlnstd/core/console/show/println: forall<a> (x : a, @implicit/show : (a) -> string) -> console ()( xx: $257 : aa: V, @implicit/show?show: ($257) -> string : aa: V -> stringstd/core/types/string: V )result: -> console () : consolestd/core/console/console: X (std/core/types/unit: V)std/core/types/unit: V printslnstd/core/console/printsln: (s : string) -> console ()(xx: $257.show?show: ($257) -> console string) diff --git a/doc/std_core_console.html b/doc/std_core_console.html index 9af951f84..29fc5664e 100644 --- a/doc/std_core_console.html +++ b/doc/std_core_console.html @@ -15,7 +15,7 @@ -

std/core/console▲toc

+

std/core/console▲toc

@@ -26,27 +26,27 @@

Standard output to the console.

.

-
+

The console effect signifies that a function may write to the console.

-
+

Print a value that has a show function.

-
+

Print a value that has a show function, including a final newline character.

-
+

Print a string to the console.

-
+

Print a string to the console, including a final newline character.

- + diff --git a/doc/std_core_debug-source.html b/doc/std_core_debug-source.html index 78d2f9036..b5e1803da 100644 --- a/doc/std_core_debug-source.html +++ b/doc/std_core_debug-source.html @@ -23,13 +23,13 @@ ---------------------------------------------------------------------------*/ // Core debugging functions. -module std/core/debugstd/core/debug +module std/core/debugstd/core/debug -import std/core/typesstd/core/types -import std/core/unsafestd/core/unsafe -import std/core/hndstd/core/hnd -import std/core/stringstd/core/string -import std/core/consolestd/core/console +import std/core/typesstd/core/types +import std/core/unsafestd/core/unsafe +import std/core/hndstd/core/hnd +import std/core/stringstd/core/string +import std/core/consolestd/core/console extern import c file "inline/debug.c" @@ -39,64 +39,64 @@ // ------------------------------------------------------------------------------ // Compilation constant that is replaced with the current file's module name -pub val file/kk-modulestd/core/debug/file/kk-module: string : stringstd/core/types/string: V = ""literal: string
count= 0
+pub val file/kk-modulestd/core/debug/file/kk-module: string : stringstd/core/types/string: V = ""literal: string
count= 0
// Compilation constant that is replaced with the current line number -pub val file/kk-linestd/core/debug/file/kk-line: string : stringstd/core/types/string: V = ""literal: string
count= 0
+pub val file/kk-linestd/core/debug/file/kk-line: string : stringstd/core/types/string: V = ""literal: string
count= 0
// Compilation constant that is replaced with the current file name -pub val file/kk-filestd/core/debug/file/kk-file: string : stringstd/core/types/string: V = ""literal: string
count= 0
+pub val file/kk-filestd/core/debug/file/kk-file: string : stringstd/core/types/string: V = ""literal: string
count= 0
-pub fun file/kk-file-linestd/core/debug/file/kk-file-line: (@implicit/kk-file : string, @implicit/kk-line : string) -> string( @implicit/kk-file?kk-file: string, @implicit/kk-line?kk-line: string )result: -> total string - @implicit/kk-file?kk-file: string ++std/core/types/(++): (x : string, y : string) -> string "("literal: string
count= 1
++std/core/types/(++): (x : string, y : string) -> string @implicit/kk-line?kk-line: string ++std/core/types/(++): (x : string, y : string) -> string ")"literal: string
count= 1
+pub fun file/kk-file-linestd/core/debug/file/kk-file-line: (@implicit/kk-file : string, @implicit/kk-line : string) -> string( @implicit/kk-file?kk-file: string, @implicit/kk-line?kk-line: string )result: -> total string + @implicit/kk-file?kk-file: string ++std/core/types/(++): (x : string, y : string) -> string "("literal: string
count= 1
++std/core/types/(++): (x : string, y : string) -> string @implicit/kk-line?kk-line: string ++std/core/types/(++): (x : string, y : string) -> string ")"literal: string
count= 1
// ---------------------------------------------------------------------------- // Trace, assert, todo // ---------------------------------------------------------------------------- -extern xtracestd/core/debug/xtrace: (message : string) -> () : ( message : stringstd/core/types/string: V ) -> (std/core/types/unit: V)std/core/types/unit: V +extern xtracestd/core/debug/xtrace: (message : string) -> () : ( message : stringstd/core/types/string: V ) -> (std/core/types/unit: V)std/core/types/unit: V c "kk_trace" cs "Primitive.Trace" js "$std_core_console._trace" -extern xtrace-anystd/core/debug/xtrace-any: forall<a> (message : string, x : a) -> () : forall<aa: V> ( message: stringstd/core/types/string: V, x : aa: V ) -> (std/core/types/unit: V)std/core/types/unit: V +extern xtrace-anystd/core/debug/xtrace-any: forall<a> (message : string, x : a) -> () : forall<aa: V> ( message: stringstd/core/types/string: V, x : aa: V ) -> (std/core/types/unit: V)std/core/types/unit: V c "kk_trace_any" cs "Primitive.TraceAny" js "$std_core_console._trace_any" -val trace-enabledstd/core/debug/trace-enabled: ref<global,bool> : refstd/core/types/ref: (H, V) -> V<globalstd/core/types/global: H,boolstd/core/types/bool: V> = unsafe-totalstd/core/unsafe/unsafe-total: (action : () -> <alloc<global>|_122> ref<global,bool>) -> ref<global,bool>{ refstd/core/types/ref: (value : bool) -> <alloc<global>|_122> ref<global,bool>(Truestd/core/types/True: bool) } +val trace-enabledstd/core/debug/trace-enabled: ref<global,bool> : refstd/core/types/ref: (H, V) -> V<globalstd/core/types/global: H,boolstd/core/types/bool: V> = unsafe-totalstd/core/unsafe/unsafe-total: (action : () -> <alloc<global>|_122> ref<global,bool>) -> ref<global,bool>{ refstd/core/types/ref: (value : bool) -> <alloc<global>|_122> ref<global,bool>(Truestd/core/types/True: bool) } // Trace a message used for debug purposes. // The behaviour is system dependent. On a browser and node it uses // `console.log` by default. // Disabled if `notrace` is called. -pub fun tracestd/core/debug/trace: (message : string) -> ()( messagemessage: string : stringstd/core/types/string: V )result: -> total () : (std/core/types/unit: V)std/core/types/unit: V - unsafe-totalstd/core/unsafe/unsafe-total: (action : () -> <read<global>|_150> ()) -> () - if !std/core/types/ref/(!): (ref : ref<global,bool>) -> <read<global>|_150> booltrace-enabledstd/core/debug/trace-enabled: ref<global,bool> then xtracestd/core/debug/xtrace: (message : string) -> <read<global>|_150> ()(messagemessage: string)std/core/types/Unit: () +pub fun tracestd/core/debug/trace: (message : string) -> ()( messagemessage: string : stringstd/core/types/string: V )result: -> total () : (std/core/types/unit: V)std/core/types/unit: V + unsafe-totalstd/core/unsafe/unsafe-total: (action : () -> <read<global>|_150> ()) -> () + if !std/core/types/ref/(!): (ref : ref<global,bool>) -> <read<global>|_150> booltrace-enabledstd/core/debug/trace-enabled: ref<global,bool> then xtracestd/core/debug/xtrace: (message : string) -> <read<global>|_150> ()(messagemessage: string)std/core/types/Unit: () -pub fun trace-infostd/core/debug/trace-info: (message : string, @implicit/kk-file-line : string) -> ()( messagemessage: string : stringstd/core/types/string: V, @implicit/kk-file-line?kk-file-line: string : stringstd/core/types/string: V )result: -> total () : (std/core/types/unit: V)std/core/types/unit: V - tracestd/core/debug/trace: (message : string) -> ()(@implicit/kk-file-line?kk-file-line: string ++std/core/types/(++): (x : string, y : string) -> string ": "literal: string
count= 2
++std/core/types/(++): (x : string, y : string) -> string messagemessage: string
) +pub fun trace-infostd/core/debug/trace-info: (message : string, @implicit/kk-file-line : string) -> ()( messagemessage: string : stringstd/core/types/string: V, @implicit/kk-file-line?kk-file-line: string : stringstd/core/types/string: V )result: -> total () : (std/core/types/unit: V)std/core/types/unit: V + tracestd/core/debug/trace: (message : string) -> ()(@implicit/kk-file-line?kk-file-line: string ++std/core/types/(++): (x : string, y : string) -> string ": "literal: string
count= 2
++std/core/types/(++): (x : string, y : string) -> string messagemessage: string
) -pub fun trace-showstd/core/debug/trace-show: forall<a> (x : a, @implicit/show : (a) -> string, @implicit/kk-file-line : string) -> ()( xx: $185 : aa: V, @implicit/show?show: ($185) -> string : aa: V -> stringstd/core/types/string: V, @implicit/kk-file-line?kk-file-line: string : stringstd/core/types/string: V )result: -> total () : (std/core/types/unit: V)std/core/types/unit: V +pub fun trace-showstd/core/debug/trace-show: forall<a> (x : a, @implicit/show : (a) -> string, @implicit/kk-file-line : string) -> ()( xx: $185 : aa: V, @implicit/show?show: ($185) -> string : aa: V -> stringstd/core/types/string: V, @implicit/kk-file-line?kk-file-line: string : stringstd/core/types/string: V )result: -> total () : (std/core/types/unit: V)std/core/types/unit: V trace-infostd/core/debug/trace-info: (message : string, @implicit/kk-file-line : string) -> ()
?kk-file-line=?kk-file-line
(xx: $185.show?show: ($185) -> string
) -pub fun trace-anystd/core/debug/trace-any: forall<a> (message : string, x : a) -> ()( messagemessage: string : stringstd/core/types/string: V, xx: $211 : aa: V )result: -> total () : (std/core/types/unit: V)std/core/types/unit: V - unsafe-totalstd/core/unsafe/unsafe-total: (action : () -> <read<global>|_237> ()) -> () - if !std/core/types/ref/(!): (ref : ref<global,bool>) -> <read<global>|_237> booltrace-enabledstd/core/debug/trace-enabled: ref<global,bool> then xtrace-anystd/core/debug/xtrace-any: (message : string, x : $211) -> <read<global>|_237> ()(messagemessage: string,xx: $211)std/core/types/Unit: () +pub fun trace-anystd/core/debug/trace-any: forall<a> (message : string, x : a) -> ()( messagemessage: string : stringstd/core/types/string: V, xx: $211 : aa: V )result: -> total () : (std/core/types/unit: V)std/core/types/unit: V + unsafe-totalstd/core/unsafe/unsafe-total: (action : () -> <read<global>|_237> ()) -> () + if !std/core/types/ref/(!): (ref : ref<global,bool>) -> <read<global>|_237> booltrace-enabledstd/core/debug/trace-enabled: ref<global,bool> then xtrace-anystd/core/debug/xtrace-any: (message : string, x : $211) -> <read<global>|_237> ()(messagemessage: string,xx: $211)std/core/types/Unit: () // Disable tracing completely. -pub noinline fun notracestd/core/debug/notrace: () -> (st<global>) ()()result: -> (st<global>) () : ststd/core/types/st: H -> E<globalstd/core/types/global: H> (std/core/types/unit: V)std/core/types/unit: V - trace-enabledstd/core/debug/trace-enabled: ref<global,bool> :=std/core/types/set: (ref : ref<global,bool>, assigned : bool) -> <write<global>,alloc<global>,read<global>> () Falsestd/core/types/False: bool +
pub noinline fun notracestd/core/debug/notrace: () -> (st<global>) ()()result: -> (st<global>) () : ststd/core/types/st: H -> E<globalstd/core/types/global: H> (std/core/types/unit: V)std/core/types/unit: V + trace-enabledstd/core/debug/trace-enabled: ref<global,bool> :=std/core/types/set: (ref : ref<global,bool>, assigned : bool) -> <write<global>,alloc<global>,read<global>> () Falsestd/core/types/False: bool -noinline extern unsafe-assert-failstd/core/debug/unsafe-assert-fail: (msg : string) -> ()( msgmsg: string : stringstd/core/types/string: V ) : (std/core/types/unit: V)std/core/types/unit: V +noinline extern unsafe-assert-failstd/core/debug/unsafe-assert-fail: (msg : string) -> ()( msgmsg: string : stringstd/core/types/string: V ) : (std/core/types/unit: V)std/core/types/unit: V c "kk_assert_fail" js inline "function() { throw new Error(\"assertion failed: \" + #1) }()" -pub fun assertstd/core/debug/assert: (message : string, condition : bool, @implicit/kk-file-line : string) -> ()( messagemessage: string : stringstd/core/types/string: V, conditioncondition: bool : boolstd/core/types/bool: V, @implicit/kk-file-line?kk-file-line: string : stringstd/core/types/string: V )result: -> total () : (std/core/types/unit: V)std/core/types/unit: V // Compiler removes assert calls in optimized builds - if !std/core/types/bool/(!): (b : bool) -> boolconditioncondition: bool then unsafe-assert-failstd/core/debug/unsafe-assert-fail: (msg : string) -> ()(kk-file-line?kk-file-line: string ++std/core/types/(++): (x : string, y : string) -> string ": "literal: string
count= 2
++std/core/types/(++): (x : string, y : string) -> string messagemessage: string
)std/core/types/Unit: () +pub fun assertstd/core/debug/assert: (message : string, condition : bool, @implicit/kk-file-line : string) -> ()( messagemessage: string : stringstd/core/types/string: V, conditioncondition: bool : boolstd/core/types/bool: V, @implicit/kk-file-line?kk-file-line: string : stringstd/core/types/string: V )result: -> total () : (std/core/types/unit: V)std/core/types/unit: V // Compiler removes assert calls in optimized builds + if !std/core/types/bool/(!): (b : bool) -> boolconditioncondition: bool then unsafe-assert-failstd/core/debug/unsafe-assert-fail: (msg : string) -> ()(kk-file-line?kk-file-line: string ++std/core/types/(++): (x : string, y : string) -> string ": "literal: string
count= 2
++std/core/types/(++): (x : string, y : string) -> string messagemessage: string
)std/core/types/Unit: () // Explicitly trigger a breakpoint -pub extern breakpointstd/core/debug/breakpoint: () -> ndet ()() : ndetstd/core/types/ndet: X (std/core/types/unit: V)std/core/types/unit: V { +pub extern breakpointstd/core/debug/breakpoint: () -> ndet ()() : ndetstd/core/types/ndet: X (std/core/types/unit: V)std/core/types/unit: V { c "kk_debugger_break" cs "System.Diagnostics.Debugger.Break" js inline "(function(){ debugger; })()" diff --git a/doc/std_core_debug.html b/doc/std_core_debug.html index 1ea20c9f9..5ec2823fd 100644 --- a/doc/std_core_debug.html +++ b/doc/std_core_debug.html @@ -15,7 +15,7 @@ -

std/core/debug▲toc

+

std/core/debug▲toc

Core debugging functions. @@ -25,39 +25,39 @@

Core debugging functions.

.

-
+

Compilation constant that is replaced with the current file name.

- -
+ +

Compilation constant that is replaced with the current line number.

-
+

Compilation constant that is replaced with the current file's module name.

- -
+ +

Explicitly trigger a breakpoint.

-
+

Disable tracing completely.

-
fun trace( message : stringstd/core/types/string: V ) : ()
+
fun trace( message : stringstd/core/types/string: V ) : ()

Trace a message used for debug purposes. The behaviour is system dependent. On a browser and node it uses console.log by default. Disabled if notracestd/core/debug/notrace: () -> (st<global>) () is called.

-
fun trace-any( message : stringstd/core/types/string: V, x : a ) : ()
- -
fun trace-show( x : a, ?show : (a) -> stringstd/core/types/string: V, ?kk-file-line : stringstd/core/types/string: V ) : ()
- +
fun trace-any( message : stringstd/core/types/string: V, x : a ) : ()
+ +
fun trace-show( x : a, ?show : (a) -> stringstd/core/types/string: V, ?kk-file-line : stringstd/core/types/string: V ) : ()
+ diff --git a/doc/std_core_delayed-source.html b/doc/std_core_delayed-source.html index f01328523..2240901ad 100644 --- a/doc/std_core_delayed-source.html +++ b/doc/std_core_delayed-source.html @@ -23,11 +23,11 @@ ---------------------------------------------------------------------------*/ // Delayed computations. -module std/core/delayedstd/core/delayed +module std/core/delayedstd/core/delayed -import std/core/typesstd/core/types -import std/core/hndstd/core/hnd -import std/core/unsafestd/core/unsafe +import std/core/typesstd/core/types +import std/core/hndstd/core/hnd +import std/core/unsafestd/core/unsafe // ---------------------------------------------------------------------------- // Delayed values @@ -35,40 +35,40 @@ // Delayed (or _lazy_) values are computed (with effect `:e`) only the first time // `force` is called and cached afterwards. -abstract value type delayedstd/core/delayed/delayed: (E, V) -> V<ee: E,aa: V> - con XDelaystd/core/delayed/XDelay: forall<e,a> (dref : ref<global,either<() -> e a,a>>) -> delayed<e,a>( drefstd/core/delayed/delayed/dref: forall<e,a> (delayed : delayed<e,a>) -> ref<global,either<() -> e a,a>> : refstd/core/types/ref: (H, V) -> V<globalstd/core/types/global: H,eitherstd/core/types/either: (V, V) -> V<() -> ee: E aa: V,aa: V>> ) +abstract value type delayedstd/core/delayed/delayed: (E, V) -> V<ee: E,aa: V> + con XDelaystd/core/delayed/XDelay: forall<e,a> (dref : ref<global,either<() -> e a,a>>) -> delayed<e,a>( drefstd/core/delayed/delayed/dref: forall<e,a> (delayed : delayed<e,a>) -> ref<global,either<() -> e a,a>> : refstd/core/types/ref: (H, V) -> V<globalstd/core/types/global: H,eitherstd/core/types/either: (V, V) -> V<() -> ee: E aa: V,aa: V>> ) // Create a new `:delayed` value. -pub fun delaystd/core/delayed/delay: forall<a,e> (action : () -> e a) -> delayed<e,a>( actionaction: () -> $125 $124 : () -> ee: E aa: V )result: -> total delayed<176,175> : delayedstd/core/delayed/delayed: (E, V) -> V<ee: E,aa: V> - unsafe-totalstd/core/unsafe/unsafe-total: (action : () -> <alloc<global>|_143> delayed<$125,$124>) -> delayed<$125,$124> - val rr: ref<global,either<() -> $125 $124,$124>> : refstd/core/types/ref: (H, V) -> V<globalstd/core/types/global: H,eitherstd/core/types/either: (V, V) -> V<__w-l28-c31: V,__w-l28-c33: V>> = refstd/core/types/ref: (value : either<() -> $125 $124,$124>) -> <alloc<global>|_143> ref<global,either<() -> $125 $124,$124>>(Leftstd/core/types/Left: forall<a,b> (left : a) -> either<a,b>(actionaction: () -> $125 $124)) +pub fun delaystd/core/delayed/delay: forall<a,e> (action : () -> e a) -> delayed<e,a>( actionaction: () -> $125 $124 : () -> ee: E aa: V )result: -> total delayed<176,175> : delayedstd/core/delayed/delayed: (E, V) -> V<ee: E,aa: V> + unsafe-totalstd/core/unsafe/unsafe-total: (action : () -> <alloc<global>|_143> delayed<$125,$124>) -> delayed<$125,$124> + val rr: ref<global,either<() -> $125 $124,$124>> : refstd/core/types/ref: (H, V) -> V<globalstd/core/types/global: H,eitherstd/core/types/either: (V, V) -> V<__w-l28-c31: V,__w-l28-c33: V>> = refstd/core/types/ref: (value : either<() -> $125 $124,$124>) -> <alloc<global>|_143> ref<global,either<() -> $125 $124,$124>>(Leftstd/core/types/Left: forall<a,b> (left : a) -> either<a,b>(actionaction: () -> $125 $124)) XDelaystd/core/delayed/XDelay: forall<e,a> (dref : ref<global,either<() -> e a,a>>) -> delayed<e,a>(rr: ref<global,either<() -> $125 $124,$124>>) // Force a delayed value; the value is computed only on the first // call to `force` and cached afterwards. -pub fun forcestd/core/delayed/force: forall<a,e> (delayed : delayed<e,a>) -> e a( delayeddelayed: delayed<$185,$184> : delayedstd/core/delayed/delayed: (E, V) -> V<ee: E,aa: V> )result: -> 293 292 : ee: E aa: V - unsafe-totalstd/core/unsafe/unsafe-total: (action : () -> <alloc<global>,div,read<global>,write<global>|$185> $184) -> $185 $184 +pub fun forcestd/core/delayed/force: forall<a,e> (delayed : delayed<e,a>) -> e a( delayeddelayed: delayed<$185,$184> : delayedstd/core/delayed/delayed: (E, V) -> V<ee: E,aa: V> )result: -> 293 292 : ee: E aa: V + unsafe-totalstd/core/unsafe/unsafe-total: (action : () -> <alloc<global>,div,read<global>,write<global>|$185> $184) -> $185 $184 val rr: ref<global,either<() -> $185 $184,$184>> = delayeddelayed: delayed<$185,$184>.drefstd/core/delayed/delayed/dref: (delayed : delayed<$185,$184>) -> <alloc<global>,div,read<global>,write<global>|$185> ref<global,either<() -> $185 $184,$184>> - match !std/core/types/ref/(!): (ref : ref<global,either<() -> $185 $184,$184>>) -> <read<global>,div,alloc<global>,write<global>|$185> either<() -> $185 $184,$184>rr: ref<global,either<() -> $185 $184,$184>> - Rightstd/core/types/Right: forall<a,b> (right : b) -> either<a,b>(xx: $184) -> xx: $184 - Leftstd/core/types/Left: forall<a,b> (left : a) -> either<a,b>(actionaction: () -> $185 $184) -> - val xx: $184 = mask-ststd/core/types/mask-st: (() -> <div|$185> $184) -> <alloc<global>,div,read<global>,write<global>|$185> (() -> <st<global>,div|$185> $184){ mask<divstd/core/types/div: X>(actionaction: () -> $185 $184) }() - rr: ref<global,either<() -> $185 $184,$184>> :=std/core/types/set: (ref : ref<global,either<() -> $185 $184,$184>>, assigned : either<() -> $185 $184,$184>) -> <write<global>,alloc<_245>,div,read<_245>|$185> () Rightstd/core/types/Right: forall<a,b> (right : b) -> either<a,b>(xx: $184) + match !std/core/types/ref/(!): (ref : ref<global,either<() -> $185 $184,$184>>) -> <read<global>,div,alloc<global>,write<global>|$185> either<() -> $185 $184,$184>rr: ref<global,either<() -> $185 $184,$184>> + Rightstd/core/types/Right: forall<a,b> (right : b) -> either<a,b>(xx: $184) -> xx: $184 + Leftstd/core/types/Left: forall<a,b> (left : a) -> either<a,b>(actionaction: () -> $185 $184) -> + val xx: $184 = mask-ststd/core/types/mask-st: (() -> <div|$185> $184) -> <alloc<global>,div,read<global>,write<global>|$185> (() -> <st<global>,div|$185> $184){ mask<divstd/core/types/div: X>(actionaction: () -> $185 $184) }() + rr: ref<global,either<() -> $185 $184,$184>> :=std/core/types/set: (ref : ref<global,either<() -> $185 $184,$184>>, assigned : either<() -> $185 $184,$184>) -> <write<global>,alloc<_245>,div,read<_245>|$185> () Rightstd/core/types/Right: forall<a,b> (right : b) -> either<a,b>(xx: $184) xx: $184 // Given a total function to calculate a value `:a`, return // a total function that only calculates the value once and then // returns the cached result. -pub fun oncestd/core/delayed/once: forall<a> (calc : () -> a) -> (() -> a)( calccalc: () -> $300 : () -> astd/core/types/total: E )result: -> total () -> 396 : ((std/core/types/total: E) -> astd/core/types/total: E) - unsafe-totalstd/core/unsafe/unsafe-total: (action : () -> <alloc<_318>|_319> (() -> $300)) -> (() -> $300) - val rr: ref<_318,maybe<$300>> = refstd/core/types/ref: (value : maybe<$300>) -> <alloc<_318>|_319> ref<_318,maybe<$300>>(Nothingstd/core/types/Nothing: forall<a> maybe<a>) +pub fun oncestd/core/delayed/once: forall<a> (calc : () -> a) -> (() -> a)( calccalc: () -> $300 : () -> astd/core/types/total: E )result: -> total () -> 396 : ((std/core/types/total: E) -> astd/core/types/total: E) + unsafe-totalstd/core/unsafe/unsafe-total: (action : () -> <alloc<_318>|_319> (() -> $300)) -> (() -> $300) + val rr: ref<_318,maybe<$300>> = refstd/core/types/ref: (value : maybe<$300>) -> <alloc<_318>|_319> ref<_318,maybe<$300>>(Nothingstd/core/types/Nothing: forall<a> maybe<a>) returnreturn: () -> $300 fnfn: () -> $300() - unsafe-totalstd/core/unsafe/unsafe-total: (action : () -> <read<_318>,write<_318>,div|_388> $300) -> $300 - match !std/core/types/ref/(!): (ref : ref<_318,maybe<$300>>) -> <read<_318>,write<_318>,div|_388> maybe<$300>rr: ref<_318,maybe<$300>> - Juststd/core/types/Just: forall<a> (value : a) -> maybe<a>(xx: $300) -> xx: $300 - Nothingstd/core/types/Nothing: forall<a> maybe<a> -> + unsafe-totalstd/core/unsafe/unsafe-total: (action : () -> <read<_318>,write<_318>,div|_388> $300) -> $300 + match !std/core/types/ref/(!): (ref : ref<_318,maybe<$300>>) -> <read<_318>,write<_318>,div|_388> maybe<$300>rr: ref<_318,maybe<$300>> + Juststd/core/types/Just: forall<a> (value : a) -> maybe<a>(xx: $300) -> xx: $300 + Nothingstd/core/types/Nothing: forall<a> maybe<a> -> val xx: $300 = calccalc: () -> <write<_318>,read<_318>,div|_388> $300() - rr: ref<_318,maybe<$300>> :=std/core/types/set: (ref : ref<_318,maybe<$300>>, assigned : maybe<$300>) -> <write<_318>,read<_318>,div|_388> () Juststd/core/types/Just: forall<a> (value : a) -> maybe<a>(xx: $300) + rr: ref<_318,maybe<$300>> :=std/core/types/set: (ref : ref<_318,maybe<$300>>, assigned : maybe<$300>) -> <write<_318>,read<_318>,div|_388> () Juststd/core/types/Just: forall<a> (value : a) -> maybe<a>(xx: $300) xx: $300 diff --git a/doc/std_core_delayed.html b/doc/std_core_delayed.html index 97fc00b91..d9c388495 100644 --- a/doc/std_core_delayed.html +++ b/doc/std_core_delayed.html @@ -15,7 +15,7 @@ -

std/core/delayed▲toc

+

std/core/delayed▲toc

@@ -26,7 +26,7 @@

Delayed computations.

.

-
+

Delayed (or lazy) values are computed (with effect e) only the first time forcestd/core/delayed/force: forall<a,e> (delayed : delayed<e,a>) -> e a is called and cached afterwards. @@ -44,7 +44,7 @@

Delayed computations. a total function that only calculates the value once and then returns the cached result.

- + diff --git a/doc/std_core_either-source.html b/doc/std_core_either-source.html index 2ec0e4fe2..3a9105ef4 100644 --- a/doc/std_core_either-source.html +++ b/doc/std_core_either-source.html @@ -23,29 +23,29 @@ ---------------------------------------------------------------------------*/ // Standard `:either` functions. -module std/core/eitherstd/core/either +module std/core/eitherstd/core/either -import std/core/typesstd/core/types -import std/core/hndstd/core/hnd +import std/core/typesstd/core/types +import std/core/hndstd/core/hnd // Convert a `:either` to a `:maybe` type discarding the value of the `Left` constructor // and using `Just` for the `Right` constructor. -pub fun maybestd/core/either/maybe: forall<a,b> (e : either<a,b>) -> maybe<b>( ee: either<$43,$44> : eitherstd/core/types/either: (V, V) -> V<aa: V,bb: V> )result: -> total maybe<78> : maybestd/core/types/maybe: V -> V<bb: V> +pub fun maybestd/core/either/maybe: forall<a,b> (e : either<a,b>) -> maybe<b>( ee: either<$43,$44> : eitherstd/core/types/either: (V, V) -> V<aa: V,bb: V> )result: -> total maybe<78> : maybestd/core/types/maybe: V -> V<bb: V> match ee: either<$43,$44> - Leftstd/core/types/Left: forall<a,b> (left : a) -> either<a,b> -> Nothingstd/core/types/Nothing: forall<a> maybe<a> - Rightstd/core/types/Right: forall<a,b> (right : b) -> either<a,b>(xx: $44) -> Juststd/core/types/Just: forall<a> (value : a) -> maybe<a>(xx: $44) + Leftstd/core/types/Left: forall<a,b> (left : a) -> either<a,b> -> Nothingstd/core/types/Nothing: forall<a> maybe<a> + Rightstd/core/types/Right: forall<a,b> (right : b) -> either<a,b>(xx: $44) -> Juststd/core/types/Just: forall<a> (value : a) -> maybe<a>(xx: $44) // Map over the `Right` component of an `:either` type. -pub fun mapstd/core/either/map: forall<a,b,c,e> (e : either<a,b>, f : (b) -> e c) -> e either<a,c>( ee: either<$86,$87> : eitherstd/core/types/either: (V, V) -> V<aa: V,bb: V>, ff: ($87) -> $89 $88 : bb: V -> ee: E cc: V )result: -> 145 either<142,144> : ee: E eitherstd/core/types/either: (V, V) -> V<aa: V,cc: V> +pub fun mapstd/core/either/map: forall<a,b,c,e> (e : either<a,b>, f : (b) -> e c) -> e either<a,c>( ee: either<$86,$87> : eitherstd/core/types/either: (V, V) -> V<aa: V,bb: V>, ff: ($87) -> $89 $88 : bb: V -> ee: E cc: V )result: -> 145 either<142,144> : ee: E eitherstd/core/types/either: (V, V) -> V<aa: V,cc: V> match ee: either<$86,$87> - Rightstd/core/types/Right: forall<a,b> (right : b) -> either<a,b>(xx: $87) -> Rightstd/core/types/Right: forall<a,b> (right : b) -> either<a,b>(ff: ($87) -> $89 $88(xx: $87)) - Leftstd/core/types/Left: forall<a,b> (left : a) -> either<a,b>(xx: $86) -> Leftstd/core/types/Left: forall<a,b> (left : a) -> either<a,b>(xx: $86) + Rightstd/core/types/Right: forall<a,b> (right : b) -> either<a,b>(xx: $87) -> Rightstd/core/types/Right: forall<a,b> (right : b) -> either<a,b>(ff: ($87) -> $89 $88(xx: $87)) + Leftstd/core/types/Left: forall<a,b> (left : a) -> either<a,b>(xx: $86) -> Leftstd/core/types/Left: forall<a,b> (left : a) -> either<a,b>(xx: $86) // Show an `:either` type -pub fun showstd/core/either/show: forall<a,b,e> (e : either<a,b>, @implicit/left/show : (a) -> e string, @implicit/right/show : (b) -> e string) -> e string( ee: either<$158,$159> : eitherstd/core/types/either: (V, V) -> V<aa: V,bb: V>, @implicit/left/show?left/show: ($158) -> $160 string : aa: V -> ee: E stringstd/core/types/string: V, @implicit/right/show?right/show: ($159) -> $160 string : bb: V -> ee: E stringstd/core/types/string: V )result: -> 238 string : ee: E stringstd/core/types/string: V +pub fun showstd/core/either/show: forall<a,b,e> (e : either<a,b>, @implicit/left/show : (a) -> e string, @implicit/right/show : (b) -> e string) -> e string( ee: either<$158,$159> : eitherstd/core/types/either: (V, V) -> V<aa: V,bb: V>, @implicit/left/show?left/show: ($158) -> $160 string : aa: V -> ee: E stringstd/core/types/string: V, @implicit/right/show?right/show: ($159) -> $160 string : bb: V -> ee: E stringstd/core/types/string: V )result: -> 238 string : ee: E stringstd/core/types/string: V match ee: either<$158,$159> - Rightstd/core/types/Right: forall<a,b> (right : b) -> either<a,b>(xx: $159) -> "Right("literal: string
count= 6
++std/core/types/(++): (x : string, y : string) -> $160 string xx: $159.show?right/show: ($159) -> $160 string ++std/core/types/(++): (x : string, y : string) -> $160 string ")"literal: string
count= 1
- Leftstd/core/types/Left: forall<a,b> (left : a) -> either<a,b>(yy: $158) -> "Left("literal: string
count= 5
++std/core/types/(++): (x : string, y : string) -> $160 string yy: $158.show?left/show: ($158) -> $160 string ++std/core/types/(++): (x : string, y : string) -> $160 string ")"literal: string
count= 1
+ Rightstd/core/types/Right: forall<a,b> (right : b) -> either<a,b>(xx: $159) -> "Right("literal: string
count= 6
++std/core/types/(++): (x : string, y : string) -> $160 string xx: $159.show?right/show: ($159) -> $160 string ++std/core/types/(++): (x : string, y : string) -> $160 string ")"literal: string
count= 1
+ Leftstd/core/types/Left: forall<a,b> (left : a) -> either<a,b>(yy: $158) -> "Left("literal: string
count= 5
++std/core/types/(++): (x : string, y : string) -> $160 string yy: $158.show?left/show: ($158) -> $160 string ++std/core/types/(++): (x : string, y : string) -> $160 string ")"literal: string
count= 1
diff --git a/doc/std_core_either.html b/doc/std_core_either.html index d98762001..7e5b5ab54 100644 --- a/doc/std_core_either.html +++ b/doc/std_core_either.html @@ -15,30 +15,30 @@ -

std/core/either▲toc

+

std/core/either▲toc

-
+ -
+ -
+ - + diff --git a/doc/std_core_exn-source.html b/doc/std_core_exn-source.html index 8f78199a1..932d6bef4 100644 --- a/doc/std_core_exn-source.html +++ b/doc/std_core_exn-source.html @@ -23,10 +23,10 @@ ---------------------------------------------------------------------------*/ // Standard exception (`:exn`) effect. -module std/core/exnstd/core/exn +module std/core/exnstd/core/exn -import std/core/typesstd/core/types -import std/core/hndstd/core/hnd +import std/core/typesstd/core/types +import std/core/hndstd/core/hnd extern import c file "inline/exn" @@ -34,84 +34,84 @@ // Exceptions -pubstd/core/exn/exn: (E, V) -> V effect exnstd/core/exn/exn: (E, V) -> V +pubstd/core/exn/exn: (E, V) -> V effect exnstd/core/exn/exn: (E, V) -> V // Throw an exception final ctl throw-exn( exnexn: exception : exceptionstd/core/exn/exception: V ) : aa: V // Raise a pattern match exception. This is function is used internally by the // compiler to generate error messages on pattern match failures. -pub fun error-patternstd/core/exn/error-pattern: forall<a> (location : string, definition : string) -> exn a(locationlocation: string : stringstd/core/types/string: V, definitiondefinition: string : stringstd/core/types/string: V)result: -> exn 576 : exnstd/core/exn/exn: (E, V) -> V aa: V - throwstd/core/exn/throw: (message : string, info : ? exception-info) -> exn $530(locationlocation: string ++std/core/types/(++): (x : string, y : string) -> exn string ": "literal: string
count= 2
++std/core/types/(++): (x : string, y : string) -> exn string definitiondefinition: string ++std/core/types/(++): (x : string, y : string) -> exn string ": pattern match failure"literal: string
count= 23
, +
pub fun error-patternstd/core/exn/error-pattern: forall<a> (location : string, definition : string) -> exn a(locationlocation: string : stringstd/core/types/string: V, definitiondefinition: string : stringstd/core/types/string: V)result: -> exn 576 : exnstd/core/exn/exn: (E, V) -> V aa: V + throwstd/core/exn/throw: (message : string, info : ? exception-info) -> exn $530(locationlocation: string ++std/core/types/(++): (x : string, y : string) -> exn string ": "literal: string
count= 2
++std/core/types/(++): (x : string, y : string) -> exn string definitiondefinition: string ++std/core/types/(++): (x : string, y : string) -> exn string ": pattern match failure"literal: string
count= 23
, ExnPatternstd/core/exn/ExnPattern: (location : string, definition : string) -> exception-info(locationlocation: string,definitiondefinition: string)
) // The exception data type -pub value struct exceptionstd/core/exn/exception: V( messagestd/core/exn/exception/message: (exception : exception) -> string :stringstd/core/types/string: V, infostd/core/exn/exception/info: (exception : exception) -> exception-info :exception-infostd/core/exn/exception-info: V ) +pub value struct exceptionstd/core/exn/exception: V( messagestd/core/exn/exception/message: (exception : exception) -> string :stringstd/core/types/string: V, infostd/core/exn/exception/info: (exception : exception) -> exception-info :exception-infostd/core/exn/exception-info: V ) // Exception information -pub open type exception-infostd/core/exn/exception-info: V - ExnErrorstd/core/exn/ExnError: exception-info // Generic error - ExnAssertstd/core/exn/ExnAssert: exception-info - ExnTodostd/core/exn/ExnTodo: exception-info - ExnRangestd/core/exn/ExnRange: exception-info - ExnPatternstd/core/exn/ExnPattern: (location : string, definition : string) -> exception-info( location : stringstd/core/types/string: V, definition : stringstd/core/types/string: V ) - ExnSystemstd/core/exn/ExnSystem: (errno : int) -> exception-info( errno : intstd/core/types/int: V ) - ExnInternalstd/core/exn/ExnInternal: (name : string) -> exception-info( name : stringstd/core/types/string: V ) +pub open type exception-infostd/core/exn/exception-info: V + ExnErrorstd/core/exn/ExnError: exception-info // Generic error + ExnAssertstd/core/exn/ExnAssert: exception-info + ExnTodostd/core/exn/ExnTodo: exception-info + ExnRangestd/core/exn/ExnRange: exception-info + ExnPatternstd/core/exn/ExnPattern: (location : string, definition : string) -> exception-info( location : stringstd/core/types/string: V, definition : stringstd/core/types/string: V ) + ExnSystemstd/core/exn/ExnSystem: (errno : int) -> exception-info( errno : intstd/core/types/int: V ) + ExnInternalstd/core/exn/ExnInternal: (name : string) -> exception-info( name : stringstd/core/types/string: V ) // Show the exception message -pub fun showstd/core/exn/show: (exn : exception) -> string( exnexn: exception : exceptionstd/core/exn/exception: V )result: -> total string : stringstd/core/types/string: V +pub fun showstd/core/exn/show: (exn : exception) -> string( exnexn: exception : exceptionstd/core/exn/exception: V )result: -> total string : stringstd/core/types/string: V exnexn: exception.messagestd/core/exn/exception/message: (exception : exception) -> string // Throw an exception with a specified message. -pub fun throwstd/core/exn/throw: forall<a> (message : string, info : ? exception-info) -> exn a( messagemessage: string: stringstd/core/types/string: V, infoinfo: ? exception-info : exception-infostd/core/exn/exception-info: V = ExnErrorstd/core/exn/ExnError: exception-info )result: -> exn 525 : exnstd/core/exn/exn: (E, V) -> V aa: V +pub fun throwstd/core/exn/throw: forall<a> (message : string, info : ? exception-info) -> exn a( messagemessage: string: stringstd/core/types/string: V, infoinfo: ? exception-info : exception-infostd/core/exn/exception-info: V = ExnErrorstd/core/exn/ExnError: exception-info )result: -> exn 525 : exnstd/core/exn/exn: (E, V) -> V aa: V throw-exnstd/core/exn/throw-exn: (exn : exception) -> exn $503(Exceptionstd/core/exn/Exception: (message : string, info : exception-info) -> exception(messagemessage: string,infoinfo: exception-info)) // Catch any exception raised in `action` and handle it. // Use `on-exn` or `on-exit` when appropriate. -pub fun exn/trystd/core/exn/exn/try: forall<a,e> (action : () -> <exn|e> a, hndl : (exception) -> e a) -> e a( actionaction: () -> <exn|$589> $588 : () -> <exnstd/core/exn/exn: (E, V) -> V|std/core/types/effect-extend: (X, E) -> Eee: E> aa: V, hndlhndl: (exception) -> $589 $588: exceptionstd/core/exn/exception: V -> ee: E aa: V )result: -> 669 668 : ee: E aa: V +pub fun exn/trystd/core/exn/exn/try: forall<a,e> (action : () -> <exn|e> a, hndl : (exception) -> e a) -> e a( actionaction: () -> <exn|$589> $588 : () -> <exnstd/core/exn/exn: (E, V) -> V|std/core/types/effect-extend: (X, E) -> Eee: E> aa: V, hndlhndl: (exception) -> $589 $588: exceptionstd/core/exn/exception: V -> ee: E aa: V )result: -> 669 668 : ee: E aa: V withhandler: (() -> <exn|$589> $588) -> $589 $588 final ctl throw-exnthrow-exn: (exn : exception) -> $589 $588(exnexn: exception) hndlhndl: (exception) -> $589 $588(exnexn: exception) actionaction: () -> <exn|$589> $588() // _Deprecated_; use `try` instead. Catch an exception raised by `throw` and handle it. // Use `on-exn` or `on-exit` when appropriate. -pub fun catchstd/core/exn/catch: forall<a,e> (action : () -> <exn|e> a, hndl : (exception) -> e a) -> e a( actionaction: () -> <exn|$725> $724 : () -> <exnstd/core/exn/exn: (E, V) -> V|std/core/types/effect-extend: (X, E) -> Eee: E> aa: V, hndlhndl: (exception) -> $725 $724: exceptionstd/core/exn/exception: V -> ee: E aa: V)result: -> 747 746 : ee: E aa: V +pub fun catchstd/core/exn/catch: forall<a,e> (action : () -> <exn|e> a, hndl : (exception) -> e a) -> e a( actionaction: () -> <exn|$725> $724 : () -> <exnstd/core/exn/exn: (E, V) -> V|std/core/types/effect-extend: (X, E) -> Eee: E> aa: V, hndlhndl: (exception) -> $725 $724: exceptionstd/core/exn/exception: V -> ee: E aa: V)result: -> 747 746 : ee: E aa: V trystd/core/exn/exn/try: (action : () -> <exn|$725> $724, hndl : (exception) -> $725 $724) -> $725 $724(actionaction: () -> <exn|$725> $724,hndlhndl: (exception) -> $725 $724) // An `:error` type represents a first-class exception result. -pub value type errorstd/core/exn/error: V -> V<aa: V> - Errorstd/core/exn/Error: forall<a> (exception : exception) -> error<a>( exception : exceptionstd/core/exn/exception: V ) - Okstd/core/exn/Ok: forall<a> (result : a) -> error<a>( result : aa: V ) +pub value type errorstd/core/exn/error: V -> V<aa: V> + Errorstd/core/exn/Error: forall<a> (exception : exception) -> error<a>( exception : exceptionstd/core/exn/exception: V ) + Okstd/core/exn/Ok: forall<a> (result : a) -> error<a>( result : aa: V ) // Transform an exception effect to an `:error` type. -pub fun trystd/core/exn/try: forall<a,e> (action : () -> <exn|e> a) -> e error<a>( actionaction: () -> <exn|$677> $676 : () -> <exnstd/core/exn/exn: (E, V) -> V|std/core/types/effect-extend: (X, E) -> Eee: E> aa: V )result: -> 713 error<712> : ee: E errorstd/core/exn/error: V -> V<aa: V> +pub fun trystd/core/exn/try: forall<a,e> (action : () -> <exn|e> a) -> e error<a>( actionaction: () -> <exn|$677> $676 : () -> <exnstd/core/exn/exn: (E, V) -> V|std/core/types/effect-extend: (X, E) -> Eee: E> aa: V )result: -> 713 error<712> : ee: E errorstd/core/exn/error: V -> V<aa: V> trystd/core/exn/exn/try: (action : () -> <exn|$677> error<$676>, hndl : (exception) -> $677 error<$676>) -> $677 error<$676>({ Okstd/core/exn/Ok: forall<a> (result : a) -> error<a>(actionaction: () -> <exn|$677> $676()) }, fnfn: (exn : exception) -> $677 error<$676>(exnexn: exception){ Errorstd/core/exn/Error: forall<a> (exception : exception) -> error<a>(exnexn: exception) }) // Transform an `:error` type back to an `exn` effect. -pub fun untrystd/core/exn/untry: forall<a> (err : error<a>) -> exn a( errerr: error<$754> : errorstd/core/exn/error: V -> V<aa: V> )result: -> exn 779 : exnstd/core/exn/exn: (E, V) -> V aa: V +pub fun untrystd/core/exn/untry: forall<a> (err : error<a>) -> exn a( errerr: error<$754> : errorstd/core/exn/error: V -> V<aa: V> )result: -> exn 779 : exnstd/core/exn/exn: (E, V) -> V aa: V match errerr: error<$754> Errorstd/core/exn/Error: forall<a> (exception : exception) -> error<a>(exnexn: exception) -> throw-exnstd/core/exn/throw-exn: (exn : exception) -> exn $754(exnexn: exception) Okstd/core/exn/Ok: forall<a> (result : a) -> error<a>(xx: $754) -> xx: $754 // Transform an `:error` type back to an `exn` effect. -pub fun exnstd/core/exn/exn: forall<a> (err : error<a>) -> exn a( errerr: error<$784> : errorstd/core/exn/error: V -> V<aa: V> )result: -> exn 798 : exnstd/core/exn/exn: (E, V) -> V aa: V +pub fun exnstd/core/exn/exn: forall<a> (err : error<a>) -> exn a( errerr: error<$784> : errorstd/core/exn/error: V -> V<aa: V> )result: -> exn 798 : exnstd/core/exn/exn: (E, V) -> V aa: V untrystd/core/exn/untry: (err : error<$784>) -> exn $784(errerr: error<$784>) // Use default value `def` in case of an error. -pub fun defaultstd/core/exn/default: forall<a> (t : error<a>, def : a) -> a( tt: error<$803> : errorstd/core/exn/error: V -> V<aa: V>, defdef: $803 : aa: V )result: -> total 821 : astd/core/types/total: E +pub fun defaultstd/core/exn/default: forall<a> (t : error<a>, def : a) -> a( tt: error<$803> : errorstd/core/exn/error: V -> V<aa: V>, defdef: $803 : aa: V )result: -> total 821 : astd/core/types/total: E match tt: error<$803> Errorstd/core/exn/Error: forall<a> (exception : exception) -> error<a> -> defdef: $803 Okstd/core/exn/Ok: forall<a> (result : a) -> error<a>(xx: $803) -> xx: $803 // Transform an `:error` type to a `:maybe` value. -pub fun maybestd/core/exn/maybe: forall<a> (t : error<a>) -> maybe<a>( tt: error<$826> : errorstd/core/exn/error: V -> V<aa: V> )result: -> total maybe<852> : maybestd/core/types/maybe: V -> V<aa: V> +pub fun maybestd/core/exn/maybe: forall<a> (t : error<a>) -> maybe<a>( tt: error<$826> : errorstd/core/exn/error: V -> V<aa: V> )result: -> total maybe<852> : maybestd/core/types/maybe: V -> V<aa: V> match tt: error<$826> - Errorstd/core/exn/Error: forall<a> (exception : exception) -> error<a> -> Nothingstd/core/types/Nothing: forall<a> maybe<a> - Okstd/core/exn/Ok: forall<a> (result : a) -> error<a>(xx: $826) -> Juststd/core/types/Just: forall<a> (value : a) -> maybe<a>(xx: $826) + Errorstd/core/exn/Error: forall<a> (exception : exception) -> error<a> -> Nothingstd/core/types/Nothing: forall<a> maybe<a> + Okstd/core/exn/Ok: forall<a> (result : a) -> error<a>(xx: $826) -> Juststd/core/types/Just: forall<a> (value : a) -> maybe<a>(xx: $826) // Transform an `:error` type to an `:either` value. -pub fun eitherstd/core/exn/either: forall<a> (t : error<a>) -> either<exception,a>( tt: error<$857> : errorstd/core/exn/error: V -> V<aa: V> )result: -> total either<exception,894> : eitherstd/core/types/either: (V, V) -> V<exceptionstd/core/exn/exception: V,aa: V> +pub fun eitherstd/core/exn/either: forall<a> (t : error<a>) -> either<exception,a>( tt: error<$857> : errorstd/core/exn/error: V -> V<aa: V> )result: -> total either<exception,894> : eitherstd/core/types/either: (V, V) -> V<exceptionstd/core/exn/exception: V,aa: V> match tt: error<$857> - Errorstd/core/exn/Error: forall<a> (exception : exception) -> error<a>(exnexn: exception) -> Leftstd/core/types/Left: forall<a,b> (left : a) -> either<a,b>(exnexn: exception) - Okstd/core/exn/Ok: forall<a> (result : a) -> error<a>(xx: $857) -> Rightstd/core/types/Right: forall<a,b> (right : b) -> either<a,b>(xx: $857) + Errorstd/core/exn/Error: forall<a> (exception : exception) -> error<a>(exnexn: exception) -> Leftstd/core/types/Left: forall<a,b> (left : a) -> either<a,b>(exnexn: exception) + Okstd/core/exn/Ok: forall<a> (result : a) -> error<a>(xx: $857) -> Rightstd/core/types/Right: forall<a,b> (right : b) -> either<a,b>(xx: $857) /* // Set a `hndler` that is called only when an exception is raised in the `action` block. @@ -123,10 +123,10 @@ */ // Set a `hndler` that is always called when the `action` finishes (either normally or with an exception). -pub fun on-exitstd/core/exn/on-exit: forall<a,e> (hndler : () -> e (), action : () -> e a) -> e a( hndlerhndler: () -> $900 () : () -> ee: E (std/core/types/unit: V)std/core/types/unit: V, actionaction: () -> $900 $899 : () -> ee: E aa: V )result: -> 920 919 : ee: E aa: V - finallystd/core/hnd/finally: (fin : () -> $900 (), action : () -> $900 $899) -> $900 $899(hndlerhndler: () -> $900 (),actionaction: () -> $900 $899) +pub fun on-exitstd/core/exn/on-exit: forall<a,e> (hndler : () -> e (), action : () -> e a) -> e a( hndlerhndler: () -> $900 () : () -> ee: E (std/core/types/unit: V)std/core/types/unit: V, actionaction: () -> $900 $899 : () -> ee: E aa: V )result: -> 920 919 : ee: E aa: V + finallystd/core/hnd/finally: (fin : () -> $900 (), action : () -> $900 $899) -> $900 $899(hndlerhndler: () -> $900 (),actionaction: () -> $900 $899) -pub fun exn-error-rangestd/core/exn/exn-error-range: forall<a> () -> exn a()result: -> exn 948 : exnstd/core/exn/exn: (E, V) -> V aa: V +pub fun exn-error-rangestd/core/exn/exn-error-range: forall<a> () -> exn a()result: -> exn 948 : exnstd/core/exn/exn: (E, V) -> V aa: V throwstd/core/exn/throw: (message : string, info : ? exception-info) -> exn $927("index out-of-range"literal: string
count= 18
, ExnRangestd/core/exn/ExnRange: exception-info
) diff --git a/doc/std_core_exn.html b/doc/std_core_exn.html index 10395f4af..43a33a199 100644 --- a/doc/std_core_exn.html +++ b/doc/std_core_exn.html @@ -15,7 +15,7 @@ -

std/core/exn▲toc

+

std/core/exn▲toc

-
+

An errorstd/core/exn/error: V -> V type represents a first-class exception result.

con Ok(result : a)
fun default( t : errorstd/core/exn/error: V -> V<a>, def : a ) : a

Use default value def in case of an error. -

Transform an exception effect to an errorstd/core/exn/error: V -> V type. @@ -54,16 +54,16 @@

Standard exception (Transform an errorstd/core/exn/error: V -> V type back to an exnstd/core/exn/exn: forall<a> (err : error<a>) -> exn a effect.

-
+ -
+

Exception information.

Generic error. -

con ExnTodo
con ExnTodo
-
+ -
+

Raise a pattern match exception. This is function is used internally by the compiler to generate error messages on pattern match failures. @@ -133,11 +133,11 @@

Standard exception (Set a hndler that is always called when the action finishes (either normally or with an exception).

-
+

Throw an exception with a specified message.

- + diff --git a/doc/std_core_hnd-source.html b/doc/std_core_hnd-source.html index 345084043..843366046 100644 --- a/doc/std_core_hnd-source.html +++ b/doc/std_core_hnd-source.html @@ -117,10 +117,10 @@ (this is also explained in detail in the generalized evidence paper). */ -module std/core/hndstd/core/hnd +module std/core/hndstd/core/hnd -import std/core/typesstd/core/types -import std/core/undivstd/core/undiv +import std/core/typesstd/core/types +import std/core/undivstd/core/undiv extern import c file "inline/hnd" @@ -131,30 +131,30 @@ // ------------------------------------------- // The tag of a handler identifies the type at runtime (e.g. `"exn/core/std"`). -abstract value type htagstd/core/hnd/htag: ((E, V) -> V) -> V<hh: (E, V) -> V::(E,V)->V> - Htagstd/core/hnd/Htag: forall<a> (tagname : string) -> htag<a>(tagnamestd/core/hnd/htag/tagname: forall<a> (htag : htag<a>) -> string:stringstd/core/types/string: V) +abstract value type htagstd/core/hnd/htag: ((E, V) -> V) -> V<hh: (E, V) -> V::(E,V)->V> + Htagstd/core/hnd/Htag: forall<a> (tagname : string) -> htag<a>(tagnamestd/core/hnd/htag/tagname: forall<a> (htag : htag<a>) -> string:stringstd/core/types/string: V) // _Internal_ hidden constructor for creating handler tags -pub fun @new-htag( tagtag: string : stringstd/core/types/string: V )result: -> total htag<2786> : htagstd/core/hnd/htag: ((E, V) -> V) -> V<hh: (E, V) -> V> +pub fun @new-htag( tagtag: string : stringstd/core/types/string: V )result: -> total htag<2786> : htagstd/core/hnd/htag: ((E, V) -> V) -> V<hh: (E, V) -> V> Htagstd/core/hnd/Htag: forall<a> (tagname : string) -> htag<a>(tagtag: string) // Show a handler tag. -pub fun htag/showstd/core/hnd/htag/show: forall<a> (htag<a>) -> string( Htagstd/core/hnd/Htag: forall<a> (tagname : string) -> htag<a>(tagtag: string) : htagstd/core/hnd/htag: ((E, V) -> V) -> V<hh: (E, V) -> V> )result: -> total string : stringstd/core/types/string: V +pub fun htag/showstd/core/hnd/htag/show: forall<a> (htag<a>) -> string( Htagstd/core/hnd/Htag: forall<a> (tagname : string) -> htag<a>(tagtag: string) : htagstd/core/hnd/htag: ((E, V) -> V) -> V<hh: (E, V) -> V> )result: -> total string : stringstd/core/types/string: V tagtag: string // Effect handler evidence of a handler `:h` in the context. -abstract type evstd/core/hnd/ev: ((E, V) -> V) -> V<hh: (E, V) -> V> - con Evstd/core/hnd/Ev: forall<a,e,b> (htag : htag<a>, marker : marker<e,b>, hnd : a<e,b>, hevv : evv<e>) -> ev<a><ee: E,rr: V>(htagstd/core/hnd/ev/htag: forall<a> (ev : ev<a>) -> htag<a>:htagstd/core/hnd/htag: ((E, V) -> V) -> V<hh: (E, V) -> V>, marker:markerstd/core/hnd/marker: (E, V) -> V<ee: E,rr: V>, hnd:hh: (E, V) -> V<ee: E,rr: V>, hevv:evvstd/core/hnd/evv: E -> V<ee: E>) +abstract type evstd/core/hnd/ev: ((E, V) -> V) -> V<hh: (E, V) -> V> + con Evstd/core/hnd/Ev: forall<a,e,b> (htag : htag<a>, marker : marker<e,b>, hnd : a<e,b>, hevv : evv<e>) -> ev<a><ee: E,rr: V>(htagstd/core/hnd/ev/htag: forall<a> (ev : ev<a>) -> htag<a>:htagstd/core/hnd/htag: ((E, V) -> V) -> V<hh: (E, V) -> V>, marker:markerstd/core/hnd/marker: (E, V) -> V<ee: E,rr: V>, hnd:hh: (E, V) -> V<ee: E,rr: V>, hevv:evvstd/core/hnd/evv: E -> V<ee: E>) // Abstract type of Evidence vectors -type evvstd/core/hnd/evv: E -> V<ee: E::E> +type evvstd/core/hnd/evv: E -> V<ee: E::E> // Index into an evidence vector -pub alias ev-indexstd/core/hnd/ev-index: V = ssize_tstd/core/types/ssize_t: V +pub alias ev-indexstd/core/hnd/ev-index: V = ssize_tstd/core/types/ssize_t: V // Evidence equality compares the markers. -pub fun ev/(==)std/core/hnd/ev/(==): forall<a> (ev<a>, ev<a>) -> bool( Evstd/core/hnd/Ev: forall<a,e,b> (htag : htag<a>, marker : marker<e,b>, hnd : a<e,b>, hevv : evv<e>) -> ev<a>(_,m1m1: marker<$2872,$2873>) : evstd/core/hnd/ev: ((E, V) -> V) -> V<hh: (E, V) -> V>, Evstd/core/hnd/Ev: forall<a,e,b> (htag : htag<a>, marker : marker<e,b>, hnd : a<e,b>, hevv : evv<e>) -> ev<a>(_,m2m2: marker<$2885,$2886>) : evstd/core/hnd/ev: ((E, V) -> V) -> V<hh: (E, V) -> V> )result: -> total bool : boolstd/core/types/bool: V +pub fun ev/(==)std/core/hnd/ev/(==): forall<a> (ev<a>, ev<a>) -> bool( Evstd/core/hnd/Ev: forall<a,e,b> (htag : htag<a>, marker : marker<e,b>, hnd : a<e,b>, hevv : evv<e>) -> ev<a>(_,m1m1: marker<$2872,$2873>) : evstd/core/hnd/ev: ((E, V) -> V) -> V<hh: (E, V) -> V>, Evstd/core/hnd/Ev: forall<a,e,b> (htag : htag<a>, marker : marker<e,b>, hnd : a<e,b>, hevv : evv<e>) -> ev<a>(_,m2m2: marker<$2885,$2886>) : evstd/core/hnd/ev: ((E, V) -> V) -> V<hh: (E, V) -> V> )result: -> total bool : boolstd/core/types/bool: V eq-markerstd/core/hnd/eq-marker: (x : marker<$2872,$2873>, y : marker<$2885,$2886>) -> bool(m1m1: marker<$2872,$2873>,m2m2: marker<$2885,$2886>) @@ -164,17 +164,17 @@ // _Internal_. The type of handler markers (usually `:int32_t`). // Needed for effect handlers in `module std/core/hnd`. -value type markerstd/core/hnd/marker: (E, V) -> V<ee: E::E,aa: V> +value type markerstd/core/hnd/marker: (E, V) -> V<ee: E::E,aa: V> // Are two markers equal? -extern eq-markerstd/core/hnd/eq-marker: forall<a,b,e,e1> (x : marker<e,a>, y : marker<e1,b>) -> bool( xx: marker<$2812,$2810> : markerstd/core/hnd/marker: (E, V) -> V<e1e1: E,a1a1: V>, yy: marker<$2813,$2811> : markerstd/core/hnd/marker: (E, V) -> V<e2e2: E,a2a2: V> ) : boolstd/core/types/bool: V +extern eq-markerstd/core/hnd/eq-marker: forall<a,b,e,e1> (x : marker<e,a>, y : marker<e1,b>) -> bool( xx: marker<$2812,$2810> : markerstd/core/hnd/marker: (E, V) -> V<e1e1: E,a1a1: V>, yy: marker<$2813,$2811> : markerstd/core/hnd/marker: (E, V) -> V<e2e2: E,a2a2: V> ) : boolstd/core/types/bool: V inline "#1==#2" -extern fresh-markerstd/core/hnd/fresh-marker: forall<a,e> () -> marker<e,a>() : markerstd/core/hnd/marker: (E, V) -> V<ee: E,aa: V> +extern fresh-markerstd/core/hnd/fresh-marker: forall<a,e> () -> marker<e,a>() : markerstd/core/hnd/marker: (E, V) -> V<ee: E,aa: V> c inline "kk_marker_unique(kk_context())" js inline "$marker_unique++" -extern fresh-marker-namedstd/core/hnd/fresh-marker-named: forall<a,e> () -> marker<e,a>() : markerstd/core/hnd/marker: (E, V) -> V<ee: E,aa: V> +extern fresh-marker-namedstd/core/hnd/fresh-marker-named: forall<a,e> () -> marker<e,a>() : markerstd/core/hnd/marker: (E, V) -> V<ee: E,aa: V> c inline "-kk_marker_unique(kk_context())" js inline "-($marker_unique++)" @@ -188,18 +188,18 @@ // ------------------------------------------- // Insert new evidence into the given evidence vector. -extern evv-insertstd/core/hnd/evv-insert: forall<e,e1,a> (evv : evv<e>, ev : ev<a>) -> e evv<e1>( evvevv: evv<$2987> : evvstd/core/hnd/evv: E -> V<e1e1: E>, evev: ev<$2989> : evstd/core/hnd/ev: ((E, V) -> V) -> V<hh: (E, V) -> V> ) : e1e1: E evvstd/core/hnd/evv: E -> V<e2e2: E> +extern evv-insertstd/core/hnd/evv-insert: forall<e,e1,a> (evv : evv<e>, ev : ev<a>) -> e evv<e1>( evvevv: evv<$2987> : evvstd/core/hnd/evv: E -> V<e1e1: E>, evev: ev<$2989> : evstd/core/hnd/ev: ((E, V) -> V) -> V<hh: (E, V) -> V> ) : e1e1: E evvstd/core/hnd/evv: E -> V<e2e2: E> c "kk_evv_insert" js "_evv_insert" // show evidence for debug purposes -extern evv-showstd/core/hnd/evv-show: forall<e> (evv : evv<e>) -> string( evvevv: evv<$3027> : evvstd/core/hnd/evv: E -> V<ee: E> ) : stringstd/core/types/string: V +extern evv-showstd/core/hnd/evv-show: forall<e> (evv : evv<e>) -> string( evvevv: evv<$3027> : evvstd/core/hnd/evv: E -> V<ee: E> ) : stringstd/core/types/string: V c "kk_evv_show" js "_evv_show" // Is an evidence vector unchanged? (i.e. as pointer equality). // This is used to avoid copying in common cases. -extern evv-eqstd/core/hnd/evv-eq: forall<e> (evv0 : evv<e>, evv1 : evv<e>) -> bool(evv0evv0: evv<$3046> : evvstd/core/hnd/evv: E -> V<ee: E>, evv1evv1: evv<$3046> : evvstd/core/hnd/evv: E -> V<ee: E> ) : boolstd/core/types/bool: V +extern evv-eqstd/core/hnd/evv-eq: forall<e> (evv0 : evv<e>, evv1 : evv<e>) -> bool(evv0evv0: evv<$3046> : evvstd/core/hnd/evv: E -> V<ee: E>, evv1evv1: evv<$3046> : evvstd/core/hnd/evv: E -> V<ee: E> ) : boolstd/core/types/bool: V c "kk_evv_eq" js inline "(#1) === (#2)" @@ -224,12 +224,12 @@ inline "#1+#2" // Get the current evidence vector. -extern evv-getstd/core/hnd/evv-get: forall<e> () -> e evv<e>() : ee: E evvstd/core/hnd/evv: E -> V<ee: E> +extern evv-getstd/core/hnd/evv-get: forall<e> () -> e evv<e>() : ee: E evvstd/core/hnd/evv: E -> V<ee: E> c "kk_evv_get" js "$std_core_hnd._evv_get" // Set the current evidence vector. -inline extern evv-setstd/core/hnd/evv-set: forall<e,e1> (w : evv<e1>) -> e ()<e1,e>( w : evvstd/core/hnd/evv: E -> V<e1e1: E> ) : ee: E (std/core/types/unit: V)std/core/types/unit: V +inline extern evv-setstd/core/hnd/evv-set: forall<e,e1> (w : evv<e1>) -> e ()<e1,e>( w : evvstd/core/hnd/evv: E -> V<e1e1: E> ) : ee: E (std/core/types/unit: V)std/core/types/unit: V c "kk_evv_set" js "$std_core_hnd._evv_set" @@ -247,7 +247,7 @@ // | // 3: multi: resumes never, once, or multiple times // -pub extern @evv-is-affine() : boolstd/core/types/bool: V +pub extern @evv-is-affine() : boolstd/core/types/bool: V c inline "kk_evv_is_affine(kk_context())" js inline "$std_core_hnd._evv_is_affine_()" @@ -258,31 +258,31 @@ // ----------------------------------------------------------------------------------- // Swap the current evidence vector with `w` -inline extern evv-swapstd/core/hnd/evv-swap: forall<e,e1,e2> (w : evv<e1>) -> e evv<e2><e1,e2>( w : evvstd/core/hnd/evv: E -> V<e1e1: E> ) : ee: E evvstd/core/hnd/evv: E -> V<e2e2: E> +inline extern evv-swapstd/core/hnd/evv-swap: forall<e,e1,e2> (w : evv<e1>) -> e evv<e2><e1,e2>( w : evvstd/core/hnd/evv: E -> V<e1e1: E> ) : ee: E evvstd/core/hnd/evv: E -> V<e2e2: E> c "kk_evv_swap" js "$std_core_hnd._evv_swap" // Remove evidence at index `i` of the current evidence vector, and return the old one. // (used by `mask`) -extern evv-swap-deletestd/core/hnd/evv-swap-delete: forall<e,e1> (i : ev-index, behind : bool) -> e1 evv<e>( ii: ev-index : ev-indexstd/core/hnd/ev-index: V, behindbehind: bool : boolstd/core/types/bool: V ) : e1e1: E evvstd/core/hnd/evv: E -> V<ee: E> +extern evv-swap-deletestd/core/hnd/evv-swap-delete: forall<e,e1> (i : ev-index, behind : bool) -> e1 evv<e>( ii: ev-index : ev-indexstd/core/hnd/ev-index: V, behindbehind: bool : boolstd/core/types/bool: V ) : e1e1: E evvstd/core/hnd/evv: E -> V<ee: E> c "kk_evv_swap_delete" js "_evv_swap_delete" // Swap the current evidence vector with an empty vector. // (this is used in open calls to switch to a total context) -inline extern evv-swap-create0std/core/hnd/evv-swap-create0: forall<e> () -> e evv<e>() : ee: E evvstd/core/hnd/evv: E -> V<ee: E> //not quite the right effect type but avoids unbound effect types +inline extern evv-swap-create0std/core/hnd/evv-swap-create0: forall<e> () -> e evv<e>() : ee: E evvstd/core/hnd/evv: E -> V<ee: E> //not quite the right effect type but avoids unbound effect types c "kk_evv_swap_create0" js "$std_core_hnd._evv_swap_create0" // Swap the current evidence vector with a singleton vector (with the evidence at current index `i`). // (this is common in open calls to switch to a singleton effect context when calling operations) -inline extern evv-swap-create1std/core/hnd/evv-swap-create1: forall<e> (i : ev-index) -> e evv<e>( i : ev-indexstd/core/hnd/ev-index: V ) : ee: E evvstd/core/hnd/evv: E -> V<ee: E> //not quite the right effect type but avoids unbound effect types +inline extern evv-swap-create1std/core/hnd/evv-swap-create1: forall<e> (i : ev-index) -> e evv<e>( i : ev-indexstd/core/hnd/ev-index: V ) : ee: E evvstd/core/hnd/evv: E -> V<ee: E> //not quite the right effect type but avoids unbound effect types c "kk_evv_swap_create1" js "$std_core_hnd._evv_swap_create1" // Swap the current evidence vector with a new vector consisting of evidence // at indices `indices` in the current vector. -extern evv-swap-createstd/core/hnd/evv-swap-create: forall<e> (indices : vector<ev-index>) -> e evv<e>( indicesindices: vector<ev-index> : vectorstd/core/types/vector: V -> V<ev-indexstd/core/hnd/ev-index: V> ) : ee: E evvstd/core/hnd/evv: E -> V<ee: E> //not quite the right effect type but avoids unbound effect types +extern evv-swap-createstd/core/hnd/evv-swap-create: forall<e> (indices : vector<ev-index>) -> e evv<e>( indicesindices: vector<ev-index> : vectorstd/core/types/vector: V -> V<ev-indexstd/core/hnd/ev-index: V> ) : ee: E evvstd/core/hnd/evv: E -> V<ee: E> //not quite the right effect type but avoids unbound effect types c "kk_evv_swap_create" js "_evv_swap_create" @@ -292,58 +292,58 @@ // Internal multi-prompt delimited control // ------------------------------------------- -pub inline extern yieldingstd/core/hnd/yielding: () -> bool() : boolstd/core/types/bool: V +pub inline extern yieldingstd/core/hnd/yielding: () -> bool() : boolstd/core/types/bool: V c "kk_yielding" js "$std_core_hnd._yielding" -pub inline extern yielding-non-finalstd/core/hnd/yielding-non-final: () -> bool() : boolstd/core/types/bool: V +pub inline extern yielding-non-finalstd/core/hnd/yielding-non-final: () -> bool() : boolstd/core/types/bool: V c "kk_yielding_non_final" js "$std_core_hnd._yielding_non_final" -pub noinline extern yield-extendstd/core/hnd/yield-extend: forall<a,b,e> (next : (a) -> e b) -> e b(nextnext: ($3156) -> $3158 $3157 : aa: V -> ee: E bb: V ) : ee: E bb: V +pub noinline extern yield-extendstd/core/hnd/yield-extend: forall<a,b,e> (next : (a) -> e b) -> e b(nextnext: ($3156) -> $3158 $3157 : aa: V -> ee: E bb: V ) : ee: E bb: V c "kk_yield_extend" js "_yield_extend" -pub inline fun yield-bindstd/core/hnd/yield-bind: forall<a,b,e> (x : a, next : (a) -> e b) -> e b( xx: $3195 : aa: V, nextnext: ($3195) -> $3197 $3196 : aa: V -> ee: E bb: V )result: -> 3232 3231 : ee: E bb: V +pub inline fun yield-bindstd/core/hnd/yield-bind: forall<a,b,e> (x : a, next : (a) -> e b) -> e b( xx: $3195 : aa: V, nextnext: ($3195) -> $3197 $3196 : aa: V -> ee: E bb: V )result: -> 3232 3231 : ee: E bb: V if yieldingstd/core/hnd/yielding: () -> $3197 bool() then yield-extendstd/core/hnd/yield-extend: (next : ($3195) -> $3197 $3196) -> $3197 $3196(nextnext: ($3195) -> $3197 $3196) else nextnext: ($3195) -> $3197 $3196(xx: $3195) -pub inline fun yield-bind2std/core/hnd/yield-bind2: forall<a,b,e> (x : a, extend : (a) -> e b, next : (a) -> e b) -> e b( xx: $3242 : aa: V, extendextend: ($3242) -> $3244 $3243 : aa: V -> ee: E bb: V, nextnext: ($3242) -> $3244 $3243 : aa: V -> ee: E bb: V )result: -> 3279 3278 : ee: E bb: V +pub inline fun yield-bind2std/core/hnd/yield-bind2: forall<a,b,e> (x : a, extend : (a) -> e b, next : (a) -> e b) -> e b( xx: $3242 : aa: V, extendextend: ($3242) -> $3244 $3243 : aa: V -> ee: E bb: V, nextnext: ($3242) -> $3244 $3243 : aa: V -> ee: E bb: V )result: -> 3279 3278 : ee: E bb: V if yieldingstd/core/hnd/yielding: () -> $3244 bool() then yield-extendstd/core/hnd/yield-extend: (next : ($3242) -> $3244 $3243) -> $3244 $3243(extendextend: ($3242) -> $3244 $3243) else nextnext: ($3242) -> $3244 $3243(xx: $3242) -extern yield-contstd/core/hnd/yield-cont: forall<a,e,b> (f : forall<c> ((c) -> e a, c) -> e b) -> e b(ff: forall<a> ((a) -> $3290 $3289, a) -> $3290 $3291 : forall<bb: V> (bb: V -> ee: E aa: V, bb: V) -> ee: E rr: V ) : ee: E rr: V // make hidden pub? +extern yield-contstd/core/hnd/yield-cont: forall<a,e,b> (f : forall<c> ((c) -> e a, c) -> e b) -> e b(ff: forall<a> ((a) -> $3290 $3289, a) -> $3290 $3291 : forall<bb: V> (bb: V -> ee: E aa: V, bb: V) -> ee: E rr: V ) : ee: E rr: V // make hidden pub? c "kk_yield_cont" js "_yield_cont" -inline extern keep-yielding-finalstd/core/hnd/keep-yielding-final: forall<e,a> () -> e a() : ee: E rr: V +inline extern keep-yielding-finalstd/core/hnd/keep-yielding-final: forall<e,a> () -> e a() : ee: E rr: V c "kk_box_any" js inline "undefined" -extern yield-promptstd/core/hnd/yield-prompt: forall<a,e,b> (m : marker<e,b>) -> yld<e,a,b>( mm: marker<$3338,$3339>: markerstd/core/hnd/marker: (E, V) -> V<ee: E,rr: V> ) : yldstd/core/hnd/yld: (E, V, V) -> V<ee: E,aa: V,rr: V> +extern yield-promptstd/core/hnd/yield-prompt: forall<a,e,b> (m : marker<e,b>) -> yld<e,a,b>( mm: marker<$3338,$3339>: markerstd/core/hnd/marker: (E, V) -> V<ee: E,rr: V> ) : yldstd/core/hnd/yld: (E, V, V) -> V<ee: E,aa: V,rr: V> c "kk_yield_prompt" js "_yield_prompt" -extern yield-to-primstd/core/hnd/yield-to-prim: forall<a,e,e1,b> (m : marker<e1,b>, clause : ((resume-result<a,b>) -> e1 b) -> e1 b) -> e (() -> a)( mm: marker<$3382,$3383> : markerstd/core/hnd/marker: (E, V) -> V<e1e1: E,rr: V>, clauseclause: ((resume-result<$3380,$3383>) -> $3382 $3383) -> $3382 $3383 : (resume-resultstd/core/hnd/resume-result: (V, V) -> V<bb: V,rr: V> -> e1e1: E rr: V) -> e1e1: E rr: V ) : ee: E (() -> bstd/core/types/total: E) +extern yield-to-primstd/core/hnd/yield-to-prim: forall<a,e,e1,b> (m : marker<e1,b>, clause : ((resume-result<a,b>) -> e1 b) -> e1 b) -> e (() -> a)( mm: marker<$3382,$3383> : markerstd/core/hnd/marker: (E, V) -> V<e1e1: E,rr: V>, clauseclause: ((resume-result<$3380,$3383>) -> $3382 $3383) -> $3382 $3383 : (resume-resultstd/core/hnd/resume-result: (V, V) -> V<bb: V,rr: V> -> e1e1: E rr: V) -> e1e1: E rr: V ) : ee: E (() -> bstd/core/types/total: E) c "kk_yield_to" js "$std_core_hnd._yield_to" -extern yield-to-finalstd/core/hnd/yield-to-final: forall<a,e,e1,b> (m : marker<e1,b>, clause : ((resume-result<a,b>) -> e1 b) -> e1 b) -> e a( mm: marker<$3437,$3438> : markerstd/core/hnd/marker: (E, V) -> V<e1e1: E,rr: V>, clauseclause: ((resume-result<$3435,$3438>) -> $3437 $3438) -> $3437 $3438 : (resume-resultstd/core/hnd/resume-result: (V, V) -> V<bb: V,rr: V> -> e1e1: E rr: V) -> e1e1: E rr: V ) : ee: E bb: V +extern yield-to-finalstd/core/hnd/yield-to-final: forall<a,e,e1,b> (m : marker<e1,b>, clause : ((resume-result<a,b>) -> e1 b) -> e1 b) -> e a( mm: marker<$3437,$3438> : markerstd/core/hnd/marker: (E, V) -> V<e1e1: E,rr: V>, clauseclause: ((resume-result<$3435,$3438>) -> $3437 $3438) -> $3437 $3438 : (resume-resultstd/core/hnd/resume-result: (V, V) -> V<bb: V,rr: V> -> e1e1: E rr: V) -> e1e1: E rr: V ) : ee: E bb: V c "kk_yield_final" js "$std_core_hnd._yield_final" -noinline fun yield-tostd/core/hnd/yield-to: forall<a,e,b> (m : marker<e,b>, clause : ((resume-result<a,b>) -> e b) -> e b) -> e a( mm: marker<$3488,$3489> : markerstd/core/hnd/marker: (E, V) -> V<e1e1: E,rr: V>, clauseclause: ((resume-result<$3487,$3489>) -> $3488 $3489) -> $3488 $3489 : (resume-resultstd/core/hnd/resume-result: (V, V) -> V<bb: V,rr: V> -> e1e1: E rr: V) -> e1e1: E rr: V )result: -> 3536 3535 : e1e1: E bb: V +noinline fun yield-tostd/core/hnd/yield-to: forall<a,e,b> (m : marker<e,b>, clause : ((resume-result<a,b>) -> e b) -> e b) -> e a( mm: marker<$3488,$3489> : markerstd/core/hnd/marker: (E, V) -> V<e1e1: E,rr: V>, clauseclause: ((resume-result<$3487,$3489>) -> $3488 $3489) -> $3488 $3489 : (resume-resultstd/core/hnd/resume-result: (V, V) -> V<bb: V,rr: V> -> e1e1: E rr: V) -> e1e1: E rr: V )result: -> 3536 3535 : e1e1: E bb: V //val w0 = evv-get() val gg: () -> $3487 : () -> _b_b: V = yield-to-primstd/core/hnd/yield-to-prim: (m : marker<$3488,$3489>, clause : ((resume-result<$3487,$3489>) -> $3488 $3489) -> $3488 $3489) -> $3488 (() -> $3487)(mm: marker<$3488,$3489>, clauseclause: ((resume-result<$3487,$3489>) -> $3488 $3489) -> $3488 $3489) yield-extendstd/core/hnd/yield-extend: (next : (() -> $3488 $3487) -> $3488 $3487) -> $3488 $3487 fnfn: (f : () -> $3488 $3487) -> $3488 $3487(ff: () -> $3488 $3487) // val keep1 = guard(w0) // check the evidence is correctly restored ff: () -> $3488 $3487() -pub type yield-infostd/core/hnd/yield-info: V +pub type yield-infostd/core/hnd/yield-info: V -extern yield-capturestd/core/hnd/yield-capture: forall<e> () -> e yield-info() : ee: E yield-infostd/core/hnd/yield-info: V +extern yield-capturestd/core/hnd/yield-capture: forall<e> () -> e yield-info() : ee: E yield-infostd/core/hnd/yield-info: V c "kk_yield_capture" js "_yield_capture" -pub extern unsafe-reyieldstd/core/hnd/unsafe-reyield: forall<a,e> (yld : yield-info) -> e a(yldyld: yield-info : yield-infostd/core/hnd/yield-info: V) : ee: E aa: V +pub extern unsafe-reyieldstd/core/hnd/unsafe-reyield: forall<a,e> (yld : yield-info) -> e a(yldyld: yield-info : yield-infostd/core/hnd/yield-info: V) : ee: E aa: V c "kk_yield_reyield" js "_reyield" @@ -352,44 +352,44 @@ // // ------------------------------------------- -inline extern cast-ev0std/core/hnd/cast-ev0: forall<a,e,e1> (f : () -> e1 a) -> (() -> e a)( f:() -> e1e1: E bb: V) : ((std/core/types/total: E) -> e0e0: E bb: V) +inline extern cast-ev0std/core/hnd/cast-ev0: forall<a,e,e1> (f : () -> e1 a) -> (() -> e a)( f:() -> e1e1: E bb: V) : ((std/core/types/total: E) -> e0e0: E bb: V) inline "#1" -inline extern cast-ev1std/core/hnd/cast-ev1: forall<a,b,e,e1> (f : (a) -> e1 b) -> ((a) -> e b)( f:(a1a1: V) -> e1e1: E bb: V) : ((std/core/types/total: Ea1a1: V) -> e0e0: E bb: V) +inline extern cast-ev1std/core/hnd/cast-ev1: forall<a,b,e,e1> (f : (a) -> e1 b) -> ((a) -> e b)( f:(a1a1: V) -> e1e1: E bb: V) : ((std/core/types/total: Ea1a1: V) -> e0e0: E bb: V) inline "#1" -inline extern cast-ev2std/core/hnd/cast-ev2: forall<a,b,c,e,e1> (f : (a, b) -> e1 c) -> ((a, b) -> e c)( f:(a1a1: V,a2a2: V) -> e1e1: E bb: V) : ((std/core/types/total: Ea1a1: V,a2a2: V) -> e0e0: E bb: V) +inline extern cast-ev2std/core/hnd/cast-ev2: forall<a,b,c,e,e1> (f : (a, b) -> e1 c) -> ((a, b) -> e c)( f:(a1a1: V,a2a2: V) -> e1e1: E bb: V) : ((std/core/types/total: Ea1a1: V,a2a2: V) -> e0e0: E bb: V) inline "#1" -inline extern cast-ev3std/core/hnd/cast-ev3: forall<a,b,c,d,e,e1> (f : (a, b, c) -> e1 d) -> ((a, b, c) -> e d)( f:(a1a1: V,a2a2: V,a3a3: V) -> e1e1: E bb: V) : ((std/core/types/total: Ea1a1: V,a2a2: V,a3a3: V) -> e0e0: E bb: V) +inline extern cast-ev3std/core/hnd/cast-ev3: forall<a,b,c,d,e,e1> (f : (a, b, c) -> e1 d) -> ((a, b, c) -> e d)( f:(a1a1: V,a2a2: V,a3a3: V) -> e1e1: E bb: V) : ((std/core/types/total: Ea1a1: V,a2a2: V,a3a3: V) -> e0e0: E bb: V) inline "#1" -inline extern cast-ev4std/core/hnd/cast-ev4: forall<a,b,c,d,a1,e,e1> (f : (a, b, c, d) -> e1 a1) -> ((a, b, c, d) -> e a1)( f:(a1a1: V,a2a2: V,a3a3: V,a4a4: V) -> e1e1: E bb: V) : ((std/core/types/total: Ea1a1: V,a2a2: V,a3a3: V,a4a4: V) -> e0e0: E bb: V) +inline extern cast-ev4std/core/hnd/cast-ev4: forall<a,b,c,d,a1,e,e1> (f : (a, b, c, d) -> e1 a1) -> ((a, b, c, d) -> e a1)( f:(a1a1: V,a2a2: V,a3a3: V,a4a4: V) -> e1e1: E bb: V) : ((std/core/types/total: Ea1a1: V,a2a2: V,a3a3: V,a4a4: V) -> e0e0: E bb: V) inline "#1" -inline extern cast-ev5std/core/hnd/cast-ev5: forall<a,b,c,d,a1,b1,e,e1> (f : (a, b, c, d, a1) -> e1 b1) -> ((a, b, c, d, a1) -> e b1)( f:(a1a1: V,a2a2: V,a3a3: V,a4a4: V,a5a5: V) -> e1e1: E bb: V) : ((std/core/types/total: Ea1a1: V,a2a2: V,a3a3: V,a4a4: V,a5a5: V) -> e0e0: E bb: V) +inline extern cast-ev5std/core/hnd/cast-ev5: forall<a,b,c,d,a1,b1,e,e1> (f : (a, b, c, d, a1) -> e1 b1) -> ((a, b, c, d, a1) -> e b1)( f:(a1a1: V,a2a2: V,a3a3: V,a4a4: V,a5a5: V) -> e1e1: E bb: V) : ((std/core/types/total: Ea1a1: V,a2a2: V,a3a3: V,a4a4: V,a5a5: V) -> e0e0: E bb: V) inline "#1" -value type resume-resultstd/core/hnd/resume-result: (V, V) -> V<bb: V,rr: V> - Deepstd/core/hnd/Deep: forall<a,b> (result : a) -> resume-result<a,b>( result: bb: V ) - Shallowstd/core/hnd/Shallow: forall<a,b> (result : a) -> resume-result<a,b>( result: bb: V ) - Finalizestd/core/hnd/Finalize: forall<a,b> (result : b) -> resume-result<a,b>( result : rr: V ) +value type resume-resultstd/core/hnd/resume-result: (V, V) -> V<bb: V,rr: V> + Deepstd/core/hnd/Deep: forall<a,b> (result : a) -> resume-result<a,b>( result: bb: V ) + Shallowstd/core/hnd/Shallow: forall<a,b> (result : a) -> resume-result<a,b>( result: bb: V ) + Finalizestd/core/hnd/Finalize: forall<a,b> (result : b) -> resume-result<a,b>( result : rr: V ) -value type yldstd/core/hnd/yld: (E, V, V) -> V<ee: E,aa: V,rr: V> - Purestd/core/hnd/Pure: forall<e,a,b> yld<e,a,b> - YieldingFinalstd/core/hnd/YieldingFinal: forall<e,a,b> yld<e,a,b> - Yieldingstd/core/hnd/Yielding: forall<e,a,b> yld<e,a,b> - Yieldstd/core/hnd/Yield: forall<e,a,b,c> (clause : ((resume-result<c,b>) -> e b) -> e b, cont : (() -> c) -> e a) -> yld<e,a,b><bb: V>(clause : (resume-resultstd/core/hnd/resume-result: (V, V) -> V<bb: V,rr: V> -> ee: E rr: V) -> ee: E rr: V, cont : (() -> bstd/core/types/total: E) -> ee: E aa: V) +value type yldstd/core/hnd/yld: (E, V, V) -> V<ee: E,aa: V,rr: V> + Purestd/core/hnd/Pure: forall<e,a,b> yld<e,a,b> + YieldingFinalstd/core/hnd/YieldingFinal: forall<e,a,b> yld<e,a,b> + Yieldingstd/core/hnd/Yielding: forall<e,a,b> yld<e,a,b> + Yieldstd/core/hnd/Yield: forall<e,a,b,c> (clause : ((resume-result<c,b>) -> e b) -> e b, cont : (() -> c) -> e a) -> yld<e,a,b><bb: V>(clause : (resume-resultstd/core/hnd/resume-result: (V, V) -> V<bb: V,rr: V> -> ee: E rr: V) -> ee: E rr: V, cont : (() -> bstd/core/types/total: E) -> ee: E aa: V) -extern guardstd/core/hnd/guard: forall<e> (w : evv<e>) -> e ()(ww: evv<$3588> : evvstd/core/hnd/evv: E -> V<ee: E> ) : ee: E (std/core/types/unit: V)std/core/types/unit: V +extern guardstd/core/hnd/guard: forall<e> (w : evv<e>) -> e ()(ww: evv<$3588> : evvstd/core/hnd/evv: E -> V<ee: E> ) : ee: E (std/core/types/unit: V)std/core/types/unit: V c inline "kk_evv_guard(#1,kk_context())" js "_guard" -extern resume-finalstd/core/hnd/resume-final: forall<a> () -> a() : astd/core/types/total: E +extern resume-finalstd/core/hnd/resume-final: forall<a> () -> a() : astd/core/types/total: E c inline "kk_fatal_resume_final(kk_context())" js "_throw_resume_final" -fun promptstd/core/hnd/prompt: forall<a,e,b,c> (w0 : evv<e>, w1 : evv<e>, ev : ev<b>, m : marker<e,c>, ret : (a) -> e c, result : a) -> e c( w0w0: evv<$3622> : evvstd/core/hnd/evv: E -> V<e0e0: E>, w1w1: evv<$3622> : evvstd/core/hnd/evv: E -> V<e0e0: E>, evev: ev<$3623> : evstd/core/hnd/ev: ((E, V) -> V) -> V<hh: (E, V) -> V>, mm: marker<$3622,$3624> : markerstd/core/hnd/marker: (E, V) -> V<e0e0: E,rr: V>, retret: ($3621) -> $3622 $3624: aa: V -> e0e0: E rr: V, resultresult: $3621 : aa: V )result: -> 3973 3975 : e0e0: E rr: V +fun promptstd/core/hnd/prompt: forall<a,e,b,c> (w0 : evv<e>, w1 : evv<e>, ev : ev<b>, m : marker<e,c>, ret : (a) -> e c, result : a) -> e c( w0w0: evv<$3622> : evvstd/core/hnd/evv: E -> V<e0e0: E>, w1w1: evv<$3622> : evvstd/core/hnd/evv: E -> V<e0e0: E>, evev: ev<$3623> : evstd/core/hnd/ev: ((E, V) -> V) -> V<hh: (E, V) -> V>, mm: marker<$3622,$3624> : markerstd/core/hnd/marker: (E, V) -> V<e0e0: E,rr: V>, retret: ($3621) -> $3622 $3624: aa: V -> e0e0: E rr: V, resultresult: $3621 : aa: V )result: -> 3973 3975 : e0e0: E rr: V guardstd/core/hnd/guard: (w : evv<$3622>) -> $3622 ()(w1w1: evv<$3622>) evv-setstd/core/hnd/evv-set: (w : evv<$3622>) -> $3622 ()(w0w0: evv<$3622>) // restore the previous evidence vector match yield-promptstd/core/hnd/yield-prompt: (m : marker<$3622,$3624>) -> $3622 yld<$3622,$3621,$3624>(mm: marker<$3622,$3624>) @@ -406,7 +406,7 @@ val w0'w0': evv<$3622> = evv-getstd/core/hnd/evv-get: () -> $3622 evv<$3622>() // if not using scoped resumptions, w0' may be different from w0 val w1'w1': evv<$3622> = if (evv-eqstd/core/hnd/evv-eq: (evv0 : evv<$3622>, evv1 : evv<$3622>) -> $3622 bool(w0w0: evv<$3622>,w0'w0': evv<$3622>)) then w1w1: evv<$3622> else evv-insertstd/core/hnd/evv-insert: (evv : evv<$3622>, ev : ev<$3623>) -> $3622 evv<$3622>(w0'w0': evv<$3622>,evev: ev<$3623>) evv-setstd/core/hnd/evv-set: (w : evv<$3622>) -> $3622 ()(w1'w1': evv<$3622>) - promptstd/core/hnd/prompt: (w0 : evv<$3622>, w1 : evv<$3622>, ev : ev<$3623>, m : marker<$3622,$3624>, ret : ($3621) -> $3622 $3624, result : $3621) -> $3622 $3624(w0'w0': evv<$3622>,w1'w1': evv<$3622>,evev: ev<$3623>,pretend-decreasingstd/core/undiv/pretend-decreasing: (x : marker<$3622,$3624>) -> $3622 marker<$3622,$3624>(mm: marker<$3622,$3624>),retret: ($3621) -> $3622 $3624,contcont: ($3683) -> $3622 $3621(resres: $3683)); + promptstd/core/hnd/prompt: (w0 : evv<$3622>, w1 : evv<$3622>, ev : ev<$3623>, m : marker<$3622,$3624>, ret : ($3621) -> $3622 $3624, result : $3621) -> $3622 $3624(w0'w0': evv<$3622>,w1'w1': evv<$3622>,evev: ev<$3623>,pretend-decreasingstd/core/undiv/pretend-decreasing: (x : marker<$3622,$3624>) -> $3622 marker<$3622,$3624>(mm: marker<$3622,$3624>),retret: ($3621) -> $3622 $3624,contcont: ($3683) -> $3622 $3621(resres: $3683)); Yieldstd/core/hnd/Yield: forall<e,a,b,c> (clause : ((resume-result<c,b>) -> e b) -> e b, cont : (() -> c) -> e a) -> yld<e,a,b>(clauseclause: ((resume-result<$3757,$3624>) -> $3622 $3624) -> $3622 $3624,contcont: (() -> $3757) -> $3622 $3621) -> // yielded to the operation `clause` in our handler fun resumeresume: (r : resume-result<$3757,$3624>) -> $3622 $3624(rr: resume-result<$3757,$3624>)result: -> $3622 $3624 @@ -415,17 +415,17 @@ val w0'w0': evv<$3622> = evv-getstd/core/hnd/evv-get: () -> $3622 evv<$3622>() // if not using scoped resumptions, w0' may be different from w0 val w1'w1': evv<$3622> = if evv-eqstd/core/hnd/evv-eq: (evv0 : evv<$3622>, evv1 : evv<$3622>) -> $3622 bool(w0w0: evv<$3622>,w0'w0': evv<$3622>) then w1w1: evv<$3622> else evv-insertstd/core/hnd/evv-insert: (evv : evv<$3622>, ev : ev<$3623>) -> $3622 evv<$3622>(w0'w0': evv<$3622>,evev: ev<$3623>) evv-setstd/core/hnd/evv-set: (w : evv<$3622>) -> $3622 ()(w1'w1': evv<$3622>) - promptstd/core/hnd/prompt: (w0 : evv<$3622>, w1 : evv<$3622>, ev : ev<$3623>, m : marker<$3622,$3624>, ret : ($3621) -> $3622 $3624, result : $3621) -> $3622 $3624(w0'w0': evv<$3622>,w1'w1': evv<$3622>,evev: ev<$3623>,pretend-decreasingstd/core/undiv/pretend-decreasing: (x : marker<$3622,$3624>) -> $3622 marker<$3622,$3624>(mm: marker<$3622,$3624>),retret: ($3621) -> $3622 $3624,contcont: (() -> $3757) -> $3622 $3621({xx: $3757})) + promptstd/core/hnd/prompt: (w0 : evv<$3622>, w1 : evv<$3622>, ev : ev<$3623>, m : marker<$3622,$3624>, ret : ($3621) -> $3622 $3624, result : $3621) -> $3622 $3624(w0'w0': evv<$3622>,w1'w1': evv<$3622>,evev: ev<$3623>,pretend-decreasingstd/core/undiv/pretend-decreasing: (x : marker<$3622,$3624>) -> $3622 marker<$3622,$3624>(mm: marker<$3622,$3624>),retret: ($3621) -> $3622 $3624,contcont: (() -> $3757) -> $3622 $3621({xx: $3757})) Shallowstd/core/hnd/Shallow: forall<a,b> (result : a) -> resume-result<a,b>(xx: $3757) -> yield-bindstd/core/hnd/yield-bind: (x : $3621, next : ($3621) -> $3622 $3624) -> $3622 $3624( contcont: (() -> $3757) -> $3622 $3621({xx: $3757}), fnfn: (y : $3621) -> $3622 $3624(yy: $3621) retret: ($3621) -> $3622 $3624(yy: $3621) ) Finalizestd/core/hnd/Finalize: forall<a,b> (result : b) -> resume-result<a,b>(xx: $3624) -> val w0'w0': evv<$3622> = evv-getstd/core/hnd/evv-get: () -> $3622 evv<$3622>() // if not using scoped resumptions, w0' may be different from w0 val w1'w1': evv<$3622> = if evv-eqstd/core/hnd/evv-eq: (evv0 : evv<$3622>, evv1 : evv<$3622>) -> $3622 bool(w0w0: evv<$3622>,w0'w0': evv<$3622>) then w1w1: evv<$3622> else evv-insertstd/core/hnd/evv-insert: (evv : evv<$3622>, ev : ev<$3623>) -> $3622 evv<$3622>(w0'w0': evv<$3622>,evev: ev<$3623>) evv-setstd/core/hnd/evv-set: (w : evv<$3622>) -> $3622 ()(w1'w1': evv<$3622>) - promptstd/core/hnd/prompt: (w0 : evv<$3622>, w1 : evv<$3622>, ev : ev<$3623>, m : marker<$3622,$3624>, ret : ($3621) -> $3622 $3624, result : $3621) -> $3622 $3624(w0'w0': evv<$3622>,w1'w1': evv<$3622>,evev: ev<$3623>,pretend-decreasingstd/core/undiv/pretend-decreasing: (x : marker<$3622,$3624>) -> $3622 marker<$3622,$3624>(mm: marker<$3622,$3624>),retret: ($3621) -> $3622 $3624,contcont: (() -> $3757) -> $3622 $3621({ yield-to-finalstd/core/hnd/yield-to-final: (m : marker<$3622,$3624>, clause : ((resume-result<$3757,$3624>) -> $3622 $3624) -> $3622 $3624) -> $3757(mm: marker<$3622,$3624>, fnfn: ((resume-result<$3757,$3624>) -> $3622 $3624) -> $3622 $3624(_k) xx: $3624) })) + promptstd/core/hnd/prompt: (w0 : evv<$3622>, w1 : evv<$3622>, ev : ev<$3623>, m : marker<$3622,$3624>, ret : ($3621) -> $3622 $3624, result : $3621) -> $3622 $3624(w0'w0': evv<$3622>,w1'w1': evv<$3622>,evev: ev<$3623>,pretend-decreasingstd/core/undiv/pretend-decreasing: (x : marker<$3622,$3624>) -> $3622 marker<$3622,$3624>(mm: marker<$3622,$3624>),retret: ($3621) -> $3622 $3624,contcont: (() -> $3757) -> $3622 $3621({ yield-to-finalstd/core/hnd/yield-to-final: (m : marker<$3622,$3624>, clause : ((resume-result<$3757,$3624>) -> $3622 $3624) -> $3622 $3624) -> $3757(mm: marker<$3622,$3624>, fnfn: ((resume-result<$3757,$3624>) -> $3622 $3624) -> $3622 $3624(_k) xx: $3624) })) clauseclause: ((resume-result<$3757,$3624>) -> $3622 $3624) -> $3622 $3624(resumeresume: (r : resume-result<$3757,$3624>) -> $3622 $3624) // TODO: we should exit prompt first, and then execute clause to use constant stack space when resuming -pub noinline fun @hhandle( tagtag: htag<$3991>:htagstd/core/hnd/htag: ((E, V) -> V) -> V<hh: (E, V) -> V>, hh: $3991<$3989,$3992> : hh: (E, V) -> V<ee: E,rr: V>, retret: ($3988) -> $3989 $3992: aa: V -> ee: E rr: V, actionaction: () -> $3990 $3988 : () -> e1e1: E aa: V )result: -> 4095 4098 : ee: E rr: V +pub noinline fun @hhandle( tagtag: htag<$3991>:htagstd/core/hnd/htag: ((E, V) -> V) -> V<hh: (E, V) -> V>, hh: $3991<$3989,$3992> : hh: (E, V) -> V<ee: E,rr: V>, retret: ($3988) -> $3989 $3992: aa: V -> ee: E rr: V, actionaction: () -> $3990 $3988 : () -> e1e1: E aa: V )result: -> 4095 4098 : ee: E rr: V // insert new evidence for our handler val w0w0: evv<$3989> = evv-getstd/core/hnd/evv-get: () -> $3989 evv<$3989>() val mm: marker<$3989,$3992> = fresh-markerstd/core/hnd/fresh-marker: () -> $3989 marker<$3989,$3992>() @@ -440,7 +440,7 @@ // (which is not inserted into the evidence vector) // ------------------------------------------- -pub noinline fun @named-handle( tagtag: htag<$4117>:htagstd/core/hnd/htag: ((E, V) -> V) -> V<hh: (E, V) -> V>, hh: $4117<$4115,$4118> : hh: (E, V) -> V<ee: E,rr: V>, retret: ($4114) -> $4115 $4118: aa: V -> ee: E rr: V, actionaction: (ev<$4117>) -> $4116 $4114 : evstd/core/hnd/ev: ((E, V) -> V) -> V<hh: (E, V) -> V> -> e1e1: E aa: V )result: -> 4205 4208 : ee: E rr: V +pub noinline fun @named-handle( tagtag: htag<$4117>:htagstd/core/hnd/htag: ((E, V) -> V) -> V<hh: (E, V) -> V>, hh: $4117<$4115,$4118> : hh: (E, V) -> V<ee: E,rr: V>, retret: ($4114) -> $4115 $4118: aa: V -> ee: E rr: V, actionaction: (ev<$4117>) -> $4116 $4114 : evstd/core/hnd/ev: ((E, V) -> V) -> V<hh: (E, V) -> V> -> e1e1: E aa: V )result: -> 4205 4208 : ee: E rr: V val mm: marker<$4115,$4118> = fresh-marker-namedstd/core/hnd/fresh-marker-named: () -> $4115 marker<$4115,$4118>() // unique (negative) marker, but never gets inserted into the evidence vector val w0w0: evv<$4115> = evv-getstd/core/hnd/evv-get: () -> $4115 evv<$4115>() val evev: ev<$4117> = Evstd/core/hnd/Ev: forall<a,e,b> (htag : htag<a>, marker : marker<e,b>, hnd : a<e,b>, hevv : evv<e>) -> ev<a>(tagtag: htag<$4117>,mm: marker<$4115,$4118>,hh: $4117<$4115,$4118>,w0w0: evv<$4115>) @@ -451,18 +451,18 @@ // mask // ------------------------------------------- -fun mask-at1std/core/hnd/mask-at1: forall<a,b,e,e1> (i : ev-index, behind : bool, action : (a) -> e b, x : a) -> e1 b( ii: ev-index : ev-indexstd/core/hnd/ev-index: V, behindbehind: bool : boolstd/core/types/bool: V, actionaction: ($4224) -> $4226 $4225 : (aa: V) -> e1e1: E bb: V, xx: $4224 : aa: V )result: -> 4336 4334 : e2e2: E bb: V +fun mask-at1std/core/hnd/mask-at1: forall<a,b,e,e1> (i : ev-index, behind : bool, action : (a) -> e b, x : a) -> e1 b( ii: ev-index : ev-indexstd/core/hnd/ev-index: V, behindbehind: bool : boolstd/core/types/bool: V, actionaction: ($4224) -> $4226 $4225 : (aa: V) -> e1e1: E bb: V, xx: $4224 : aa: V )result: -> 4336 4334 : e2e2: E bb: V val w0w0: evv<_4233> = evv-swap-deletestd/core/hnd/evv-swap-delete: (i : ev-index, behind : bool) -> $4227 evv<_4233>(ii: ev-index,behindbehind: bool) val yy: $4225 = cast-ev1std/core/hnd/cast-ev1: (f : ($4224) -> $4226 $4225) -> $4227 (($4224) -> $4227 $4225)(actionaction: ($4224) -> $4226 $4225)(xx: $4224) evv-setstd/core/hnd/evv-set: (w : evv<_4233>) -> $4227 ()(w0w0: evv<_4233>) - if yieldingstd/core/hnd/yielding: () -> $4227 bool() returnreturn: $4225 yield-contstd/core/hnd/yield-cont: (f : forall<a> ((a) -> $4227 $4225, a) -> $4227 $4225) -> $4227 $4225( fnfn: forall<a,b,e> (cont : (a) -> e b, res : a) -> e b(contcont: ($4277) -> $4227 $4225,resres: $4277) mask-at1std/core/hnd/mask-at1: (i : ev-index, behind : bool, action : ($4277) -> $4227 $4225, x : $4277) -> $4227 $4225(pretend-decreasingstd/core/undiv/pretend-decreasing: (x : ev-index) -> $4227 ev-index(ii: ev-index),behindbehind: bool,contcont: ($4277) -> $4227 $4225,resres: $4277) )std/core/types/Unit: () + if yieldingstd/core/hnd/yielding: () -> $4227 bool() returnreturn: $4225 yield-contstd/core/hnd/yield-cont: (f : forall<a> ((a) -> $4227 $4225, a) -> $4227 $4225) -> $4227 $4225( fnfn: forall<a,b,e> (cont : (a) -> e b, res : a) -> e b(contcont: ($4277) -> $4227 $4225,resres: $4277) mask-at1std/core/hnd/mask-at1: (i : ev-index, behind : bool, action : ($4277) -> $4227 $4225, x : $4277) -> $4227 $4225(pretend-decreasingstd/core/undiv/pretend-decreasing: (x : ev-index) -> $4227 ev-index(ii: ev-index),behindbehind: bool,contcont: ($4277) -> $4227 $4225,resres: $4277) )std/core/types/Unit: () yy: $4225 -pub fun @mask-at<aa: V,e1e1: E,e2e2: E>( ii: ev-index : ev-indexstd/core/hnd/ev-index: V, behindbehind: bool : boolstd/core/types/bool: V, actionaction: () -> $4350 $4349 : () -> e1e1: E aa: V )result: -> 4445 4443 : e2e2: E aa: V +pub fun @mask-at<aa: V,e1e1: E,e2e2: E>( ii: ev-index : ev-indexstd/core/hnd/ev-index: V, behindbehind: bool : boolstd/core/types/bool: V, actionaction: () -> $4350 $4349 : () -> e1e1: E aa: V )result: -> 4445 4443 : e2e2: E aa: V val w0w0: evv<_4357> = evv-swap-deletestd/core/hnd/evv-swap-delete: (i : ev-index, behind : bool) -> $4351 evv<_4357>(ii: ev-index,behindbehind: bool) val xx: $4349 = cast-ev0std/core/hnd/cast-ev0: (f : () -> $4350 $4349) -> $4351 (() -> $4351 $4349)(actionaction: () -> $4350 $4349)() evv-setstd/core/hnd/evv-set: (w : evv<_4357>) -> $4351 ()(w0w0: evv<_4357>) - if yieldingstd/core/hnd/yielding: () -> $4351 bool() returnreturn: $4349 yield-contstd/core/hnd/yield-cont: (f : forall<a> ((a) -> $4351 $4349, a) -> $4351 $4349) -> $4351 $4349( fnfn: forall<a,b,e> (cont : (a) -> e b, res : a) -> e b(contcont: ($4397) -> $4351 $4349,resres: $4397) mask-at1std/core/hnd/mask-at1: (i : ev-index, behind : bool, action : ($4397) -> $4351 $4349, x : $4397) -> $4351 $4349(ii: ev-index,behindbehind: bool,contcont: ($4397) -> $4351 $4349,resres: $4397) )std/core/types/Unit: () + if yieldingstd/core/hnd/yielding: () -> $4351 bool() returnreturn: $4349 yield-contstd/core/hnd/yield-cont: (f : forall<a> ((a) -> $4351 $4349, a) -> $4351 $4349) -> $4351 $4349( fnfn: forall<a,b,e> (cont : (a) -> e b, res : a) -> e b(contcont: ($4397) -> $4351 $4349,resres: $4397) mask-at1std/core/hnd/mask-at1: (i : ev-index, behind : bool, action : ($4397) -> $4351 $4349, x : $4397) -> $4351 $4349(ii: ev-index,behindbehind: bool,contcont: ($4397) -> $4351 $4349,resres: $4397) )std/core/types/Unit: () xx: $4349 // mask for builtin effects without a handler or evidence (like `:st` or `:local`) @@ -474,14 +474,14 @@ // Local variables // ------------------------------------------- -fun prompt-local-varstd/core/hnd/prompt-local-var: forall<a,b,h> (loc : local-var<h,a>, res : b) -> <div,local<h>> b(locloc: local-var<$4499,$4496>:local-varstd/core/types/local-var: (H, V) -> V<ss: H,aa: V>, resres: $4497 : bb: V )result: -> <div,local<4604>|4603> 4602 : <divstd/core/types/div: X,localstd/core/types/local: H -> X<ss: H>|std/core/types/effect-extend: (X, E) -> Eee: E> bb: V - if !std/core/types/bool/(!): (b : bool) -> <div,local<$4499>|$4498> boolyieldingstd/core/hnd/yielding: () -> <div,local<$4499>|$4498> bool() returnreturn: $4497 resres: $4497; +fun prompt-local-varstd/core/hnd/prompt-local-var: forall<a,b,h> (loc : local-var<h,a>, res : b) -> <div,local<h>> b(locloc: local-var<$4499,$4496>:local-varstd/core/types/local-var: (H, V) -> V<ss: H,aa: V>, resres: $4497 : bb: V )result: -> <div,local<4604>|4603> 4602 : <divstd/core/types/div: X,localstd/core/types/local: H -> X<ss: H>|std/core/types/effect-extend: (X, E) -> Eee: E> bb: V + if !std/core/types/bool/(!): (b : bool) -> <div,local<$4499>|$4498> boolyieldingstd/core/hnd/yielding: () -> <div,local<$4499>|$4498> bool() returnreturn: $4497 resres: $4497; val vv: $4496 = locloc: $4496 - yield-contstd/core/hnd/yield-cont: (f : forall<a> ((a) -> <div,local<$4499>|$4498> $4497, a) -> <div,local<$4499>|$4498> $4497) -> <div,local<$4499>|$4498> $4497(fnfn: forall<a,e> (cont : (a) -> <div,local<$4499>|e> $4497, x : a) -> <div,local<$4499>|e> $4497(contcont: ($4545) -> <div,local<$4499>|$4498> $4497,xx: $4545){ locloc: local-var<$4499,$4496> :=std/core/types/local-set: (v : local-var<$4499,$4496>, assigned : $4496) -> <local<$4499>,div|$4498> () vv: $4496; prompt-local-varstd/core/hnd/prompt-local-var: (loc : local-var<$4499,$4496>, res : $4497) -> <div,local<$4499>|$4498> $4497(@byref(locloc: local-var<$4499,$4496>),contcont: ($4545) -> <div,local<$4499>|$4498> $4497(xx: $4545)) } ) // restore state early before the resume + yield-contstd/core/hnd/yield-cont: (f : forall<a> ((a) -> <div,local<$4499>|$4498> $4497, a) -> <div,local<$4499>|$4498> $4497) -> <div,local<$4499>|$4498> $4497(fnfn: forall<a,e> (cont : (a) -> <div,local<$4499>|e> $4497, x : a) -> <div,local<$4499>|e> $4497(contcont: ($4545) -> <div,local<$4499>|$4498> $4497,xx: $4545){ locloc: local-var<$4499,$4496> :=std/core/types/local-set: (v : local-var<$4499,$4496>, assigned : $4496) -> <local<$4499>,div|$4498> () vv: $4496; prompt-local-varstd/core/hnd/prompt-local-var: (loc : local-var<$4499,$4496>, res : $4497) -> <div,local<$4499>|$4498> $4497(@byref(locloc: local-var<$4499,$4496>),contcont: ($4545) -> <div,local<$4499>|$4498> $4497(xx: $4545)) } ) // restore state early before the resume -pub inline fun local-varstd/core/hnd/local-var: forall<a,b,e,h> (init : a, action : (l : local-var<h,a>) -> <local<h>|e> b) -> <local<h>|e> b(initinit: $4638:aa: V, actionaction: (l : local-var<$4641,$4638>) -> <local<$4641>|$4640> $4639: (l:local-varstd/core/types/local-var: (H, V) -> V<ss: H,aa: V>) -> <localstd/core/types/local: H -> X<ss: H>|std/core/types/effect-extend: (X, E) -> Eee: E> bb: V )result: -> <local<4714>|4713> 4712 : <localstd/core/types/local: H -> X<ss: H>|std/core/types/effect-extend: (X, E) -> Eee: E> bb: V - pretend-no-divstd/core/undiv/pretend-no-div: (action : () -> <div,local<$4641>|$4640> $4639) -> <local<$4641>|$4640> $4639 - val locloc: local-var<$4641,$4638> : local-varstd/core/types/local-var: (H, V) -> V<__w-l468-c25: H,__w-l468-c27: V> = local-newstd/core/types/local-new: (value : $4638) -> <local<$4641>,div|$4640> local-var<$4641,$4638>(initinit: $4638) +pub inline fun local-varstd/core/hnd/local-var: forall<a,b,e,h> (init : a, action : (l : local-var<h,a>) -> <local<h>|e> b) -> <local<h>|e> b(initinit: $4638:aa: V, actionaction: (l : local-var<$4641,$4638>) -> <local<$4641>|$4640> $4639: (l:local-varstd/core/types/local-var: (H, V) -> V<ss: H,aa: V>) -> <localstd/core/types/local: H -> X<ss: H>|std/core/types/effect-extend: (X, E) -> Eee: E> bb: V )result: -> <local<4714>|4713> 4712 : <localstd/core/types/local: H -> X<ss: H>|std/core/types/effect-extend: (X, E) -> Eee: E> bb: V + pretend-no-divstd/core/undiv/pretend-no-div: (action : () -> <div,local<$4641>|$4640> $4639) -> <local<$4641>|$4640> $4639 + val locloc: local-var<$4641,$4638> : local-varstd/core/types/local-var: (H, V) -> V<__w-l468-c25: H,__w-l468-c27: V> = local-newstd/core/types/local-new: (value : $4638) -> <local<$4641>,div|$4640> local-var<$4641,$4638>(initinit: $4638) val resres: $4639 = cast-ev1std/core/hnd/cast-ev1: (f : (local-var<$4641,$4638>) -> <local<$4641>|$4640> $4639) -> <div,local<$4641>|$4640> ((local-var<$4641,$4638>) -> <div,local<$4641>|$4640> $4639)(actionaction: (l : local-var<$4641,$4638>) -> <local<$4641>|$4640> $4639)(@byref(locloc: local-var<$4641,$4638>)) prompt-local-varstd/core/hnd/prompt-local-var: (loc : local-var<$4641,$4638>, res : $4639) -> <div,local<$4641>|$4640> $4639(@byref(locloc: local-var<$4641,$4638>),resres: $4639) @@ -490,19 +490,19 @@ // Finally // ------------------------------------------- -pub fun finallystd/core/hnd/finally: forall<a,e> (fin : () -> e (), action : () -> e a) -> e a( finfin: () -> $4846 () : () -> ee: E (std/core/types/unit: V)std/core/types/unit: V, actionaction: () -> $4846 $4845 : () -> ee: E aa: V )result: -> 4866 4865 : ee: E aa: V +pub fun finallystd/core/hnd/finally: forall<a,e> (fin : () -> e (), action : () -> e a) -> e a( finfin: () -> $4846 () : () -> ee: E (std/core/types/unit: V)std/core/types/unit: V, actionaction: () -> $4846 $4845 : () -> ee: E aa: V )result: -> 4866 4865 : ee: E aa: V finally-promptstd/core/hnd/finally-prompt: (fin : () -> $4846 (), res : $4845) -> $4846 $4845(finfin: () -> $4846 (), actionaction: () -> $4846 $4845()); -fun finally-promptstd/core/hnd/finally-prompt: forall<a,e> (fin : () -> e (), res : a) -> e a(finfin: () -> $4728 () : () -> ee: E (std/core/types/unit: V)std/core/types/unit: V, resres: $4727 : aa: V )result: -> 4838 4837 : ee: E aa: V - if !std/core/types/bool/(!): (b : bool) -> $4728 boolyieldingstd/core/hnd/yielding: () -> $4728 bool() then +fun finally-promptstd/core/hnd/finally-prompt: forall<a,e> (fin : () -> e (), res : a) -> e a(finfin: () -> $4728 () : () -> ee: E (std/core/types/unit: V)std/core/types/unit: V, resres: $4727 : aa: V )result: -> 4838 4837 : ee: E aa: V + if !std/core/types/bool/(!): (b : bool) -> $4728 boolyieldingstd/core/hnd/yielding: () -> $4728 bool() then finfin: () -> $4728 ()() resres: $4727 elif yielding-non-finalstd/core/hnd/yielding-non-final: () -> $4728 bool() then - yield-contstd/core/hnd/yield-cont: (f : forall<a> ((a) -> $4728 $4727, a) -> $4728 $4727) -> $4728 $4727(fnfn: forall<a> (cont : (a) -> $4728 $4727, x : a) -> $4728 $4727(contcont: ($4762) -> $4728 $4727,xx: $4762){ finally-promptstd/core/hnd/finally-prompt: (fin : () -> $4728 (), res : $4727) -> $4728 $4727(pretend-decreasingstd/core/undiv/pretend-decreasing: (x : () -> $4728 ()) -> $4728 (() -> $4728 ())(finfin: () -> $4728 ()),contcont: ($4762) -> $4728 $4727(xx: $4762)) }) + yield-contstd/core/hnd/yield-cont: (f : forall<a> ((a) -> $4728 $4727, a) -> $4728 $4727) -> $4728 $4727(fnfn: forall<a> (cont : (a) -> $4728 $4727, x : a) -> $4728 $4727(contcont: ($4762) -> $4728 $4727,xx: $4762){ finally-promptstd/core/hnd/finally-prompt: (fin : () -> $4728 (), res : $4727) -> $4728 $4727(pretend-decreasingstd/core/undiv/pretend-decreasing: (x : () -> $4728 ()) -> $4728 (() -> $4728 ())(finfin: () -> $4728 ()),contcont: ($4762) -> $4728 $4727(xx: $4762)) }) else val yldyld: yield-info = yield-capturestd/core/hnd/yield-capture: () -> $4728 yield-info() finfin: () -> $4728 ()() - if yieldingstd/core/hnd/yielding: () -> $4728 bool() returnreturn: $4727 yield-extendstd/core/hnd/yield-extend: (next : (_4802) -> $4728 $4727) -> $4728 $4727( fnfn: (_4802) -> $4728 $4727(_x) unsafe-reyieldstd/core/hnd/unsafe-reyield: (yld : yield-info) -> $4728 $4727(yldyld: yield-info) )std/core/types/Unit: () + if yieldingstd/core/hnd/yielding: () -> $4728 bool() returnreturn: $4727 yield-extendstd/core/hnd/yield-extend: (next : (_4802) -> $4728 $4727) -> $4728 $4727( fnfn: (_4802) -> $4728 $4727(_x) unsafe-reyieldstd/core/hnd/unsafe-reyield: (yld : yield-info) -> $4728 $4727(yldyld: yield-info) )std/core/types/Unit: () unsafe-reyieldstd/core/hnd/unsafe-reyield: (yld : yield-info) -> $4728 $4727(yldyld: yield-info) /* @@ -517,34 +517,34 @@ // ------------------------------------------- // add integers -inline extern addstd/core/hnd/add: (i : int, j : int) -> int(i : intstd/core/types/int: V, j : intstd/core/types/int: V) : intstd/core/types/int: V +inline extern addstd/core/hnd/add: (i : int, j : int) -> int(i : intstd/core/types/int: V, j : intstd/core/types/int: V) : intstd/core/types/int: V c "kk_integer_add" cs inline "(#1 + #2)" js inline "(#1 + #2)" // "$std_core_types._int_add" // are two integers equal? -inline extern eqstd/core/hnd/eq: (x : int, y : int) -> bool( ^x : intstd/core/types/int: V, ^y : intstd/core/types/int: V) : boolstd/core/types/bool: V +inline extern eqstd/core/hnd/eq: (x : int, y : int) -> bool( ^x : intstd/core/types/int: V, ^y : intstd/core/types/int: V) : boolstd/core/types/bool: V c "kk_integer_eq_borrow" cs inline "(#1 == #2)" js inline "(#1 == #2)" // $std_core_types._int_eq" -pub fun initiallystd/core/hnd/initially: forall<a,e> (init : (int) -> e (), action : () -> e a) -> e a(initinit: (int) -> $5058 () : (intstd/core/types/int: V) -> ee: E (std/core/types/unit: V)std/core/types/unit: V, actionaction: () -> $5058 $5057 : () -> ee: E aa: V )result: -> 5108 5107 : ee: E aa: V +pub fun initiallystd/core/hnd/initially: forall<a,e> (init : (int) -> e (), action : () -> e a) -> e a(initinit: (int) -> $5058 () : (intstd/core/types/int: V) -> ee: E (std/core/types/unit: V)std/core/types/unit: V, actionaction: () -> $5058 $5057 : () -> ee: E aa: V )result: -> 5108 5107 : ee: E aa: V initinit: (int) -> $5058 ()(0literal: int
dec = 0
hex8 = 0x00
bit8 = 0b00000000
) - if yieldingstd/core/hnd/yielding: () -> $5058 bool() returnreturn: $5057 yield-extendstd/core/hnd/yield-extend: (next : (()) -> $5058 $5057) -> $5058 $5057(fnfn: (()) -> $5058 $5057(_ret:(std/core/types/unit: V)std/core/types/unit: V) initially-promptstd/core/hnd/initially-prompt: (init : (int) -> $5058 (), res : $5057) -> $5058 $5057(initinit: (int) -> $5058 (),actionaction: () -> $5058 $5057()) )std/core/types/Unit: () + if yieldingstd/core/hnd/yielding: () -> $5058 bool() returnreturn: $5057 yield-extendstd/core/hnd/yield-extend: (next : (()) -> $5058 $5057) -> $5058 $5057(fnfn: (()) -> $5058 $5057(_ret:(std/core/types/unit: V)std/core/types/unit: V) initially-promptstd/core/hnd/initially-prompt: (init : (int) -> $5058 (), res : $5057) -> $5058 $5057(initinit: (int) -> $5058 (),actionaction: () -> $5058 $5057()) )std/core/types/Unit: () initially-promptstd/core/hnd/initially-prompt: (init : (int) -> $5058 (), res : $5057) -> $5058 $5057(initinit: (int) -> $5058 (), actionaction: () -> $5058 $5057()
) -fun initially-promptstd/core/hnd/initially-prompt: forall<a,e> (init : (int) -> e (), res : a) -> e a( initinit: (int) -> $4874 () : (intstd/core/types/int: V) -> ee: E (std/core/types/unit: V)std/core/types/unit: V, resres: $4873 : aa: V )result: -> 5050 5049 : ee: E aa: V +fun initially-promptstd/core/hnd/initially-prompt: forall<a,e> (init : (int) -> e (), res : a) -> e a( initinit: (int) -> $4874 () : (intstd/core/types/int: V) -> ee: E (std/core/types/unit: V)std/core/types/unit: V, resres: $4873 : aa: V )result: -> 5050 5049 : ee: E aa: V if yielding-non-finalstd/core/hnd/yielding-non-final: () -> $4874 bool() then - val countcount: ref<global,int> = unsafe-ststd/core/hnd/unsafe-st: (f : () -> <st<global>|$4874> ref<global,int>) -> $4874 (() -> $4874 ref<global,int>){refstd/core/types/ref: (value : int) -> <alloc<global>,read<global>,write<global>|$4874> ref<global,int>(0literal: int
dec = 0
hex8 = 0x00
bit8 = 0b00000000
)}() + val countcount: ref<global,int> = unsafe-ststd/core/hnd/unsafe-st: (f : () -> <st<global>|$4874> ref<global,int>) -> $4874 (() -> $4874 ref<global,int>){refstd/core/types/ref: (value : int) -> <alloc<global>,read<global>,write<global>|$4874> ref<global,int>(0literal: int
dec = 0
hex8 = 0x00
bit8 = 0b00000000
)}() yield-contstd/core/hnd/yield-cont: (f : forall<a> ((a) -> $4874 $4873, a) -> $4874 $4873) -> $4874 $4873(fnfn: forall<a> (cont : (a) -> $4874 $4873, x : a) -> $4874 $4873(contcont: ($4911) -> $4874 $4873,xx: $4911) - val cntcnt: int = unsafe-ststd/core/hnd/unsafe-st: (f : () -> <st<global>|$4874> int) -> $4874 (() -> $4874 int){ !std/core/types/ref/(!): (ref : ref<global,int>) -> <read<global>,alloc<global>,write<global>|$4874> intcountcount: ref<global,int> }() // increase counter on every resumption - unsafe-ststd/core/hnd/unsafe-st: (f : () -> <st<global>|$4874> ()) -> $4874 (() -> $4874 ()){ countcount: ref<global,int> :=std/core/types/set: (ref : ref<global,int>, assigned : int) -> <write<global>,alloc<global>,read<global>|$4874> () addstd/core/hnd/add: (i : int, j : int) -> <write<global>,alloc<global>,read<global>|$4874> int(cntcnt: int,1literal: int
dec = 1
hex8 = 0x01
bit8 = 0b00000001
) }() - if eqstd/core/hnd/eq: (x : int, y : int) -> $4874 bool(cntcnt: int,0literal: int
dec = 0
hex8 = 0x00
bit8 = 0b00000000
) then (std/core/types/Unit: ())std/core/types/Unit: () else // for every resume after the first, run the initializer + val cntcnt: int = unsafe-ststd/core/hnd/unsafe-st: (f : () -> <st<global>|$4874> int) -> $4874 (() -> $4874 int){ !std/core/types/ref/(!): (ref : ref<global,int>) -> <read<global>,alloc<global>,write<global>|$4874> intcountcount: ref<global,int> }() // increase counter on every resumption + unsafe-ststd/core/hnd/unsafe-st: (f : () -> <st<global>|$4874> ()) -> $4874 (() -> $4874 ()){ countcount: ref<global,int> :=std/core/types/set: (ref : ref<global,int>, assigned : int) -> <write<global>,alloc<global>,read<global>|$4874> () addstd/core/hnd/add: (i : int, j : int) -> <write<global>,alloc<global>,read<global>|$4874> int(cntcnt: int,1literal: int
dec = 1
hex8 = 0x01
bit8 = 0b00000001
) }() + if eqstd/core/hnd/eq: (x : int, y : int) -> $4874 bool(cntcnt: int,0literal: int
dec = 0
hex8 = 0x00
bit8 = 0b00000000
) then (std/core/types/Unit: ())std/core/types/Unit: () else // for every resume after the first, run the initializer val rr: () = initinit: (int) -> $4874 ()(cntcnt: int) if yieldingstd/core/hnd/yielding: () -> $4874 bool() - then { yield-extendstd/core/hnd/yield-extend: (next : (_4990) -> $4874 $4873) -> $4874 $4873( fnfn: (_4990) -> $4874 $4873(_ret) initially-promptstd/core/hnd/initially-prompt: (init : (int) -> $4874 (), res : $4873) -> $4874 $4873(pretend-decreasingstd/core/undiv/pretend-decreasing: (x : (int) -> $4874 ()) -> $4874 ((int) -> $4874 ())(initinit: (int) -> $4874 ()), contcont: ($4911) -> $4874 $4873(xx: $4911)) ); (std/core/types/Unit: ())std/core/types/Unit: () }std/core/types/Unit: () - initially-promptstd/core/hnd/initially-prompt: (init : (int) -> $4874 (), res : $4873) -> $4874 $4873(pretend-decreasingstd/core/undiv/pretend-decreasing: (x : (int) -> $4874 ()) -> $4874 ((int) -> $4874 ())(initinit: (int) -> $4874 ()), contcont: ($4911) -> $4874 $4873(xx: $4911)) + then { yield-extendstd/core/hnd/yield-extend: (next : (_4990) -> $4874 $4873) -> $4874 $4873( fnfn: (_4990) -> $4874 $4873(_ret) initially-promptstd/core/hnd/initially-prompt: (init : (int) -> $4874 (), res : $4873) -> $4874 $4873(pretend-decreasingstd/core/undiv/pretend-decreasing: (x : (int) -> $4874 ()) -> $4874 ((int) -> $4874 ())(initinit: (int) -> $4874 ()), contcont: ($4911) -> $4874 $4873(xx: $4911)) ); (std/core/types/Unit: ())std/core/types/Unit: () }std/core/types/Unit: () + initially-promptstd/core/hnd/initially-prompt: (init : (int) -> $4874 (), res : $4873) -> $4874 $4873(pretend-decreasingstd/core/undiv/pretend-decreasing: (x : (int) -> $4874 ()) -> $4874 ((int) -> $4874 ())(initinit: (int) -> $4874 ()), contcont: ($4911) -> $4874 $4873(xx: $4911)) ) else resres: $4873
@@ -553,16 +553,16 @@ // Resume context // -------------------------------------------
-abstract value struct resume-contextstd/core/hnd/resume-context: (V, E, E, V) -> V<bb: V,ee: E::E,e0e0: E::E,rr: V>( kresult: -> total (resume-result<2565,2568>) -> 2566 2568 : resume-resultstd/core/hnd/resume-result: (V, V) -> V<bb: V,rr: V> -> ee: E rr: V ) +abstract value struct resume-contextstd/core/hnd/resume-context: (V, E, E, V) -> V<bb: V,ee: E::E,e0e0: E::E,rr: V>( kresult: -> total (resume-result<2565,2568>) -> 2566 2568 : resume-resultstd/core/hnd/resume-result: (V, V) -> V<bb: V,rr: V> -> ee: E rr: V ) -pub fun resumestd/core/hnd/resume: forall<a,e,e1,b> (r : resume-context<a,e,e1,b>, x : a) -> e b( rr: resume-context<$5115,$5116,$5117,$5118> : resume-contextstd/core/hnd/resume-context: (V, E, E, V) -> V<bb: V,ee: E,e0e0: E,rr: V>, xx: $5115 : bb: V )result: -> 5163 5165 : ee: E rr: V +pub fun resumestd/core/hnd/resume: forall<a,e,e1,b> (r : resume-context<a,e,e1,b>, x : a) -> e b( rr: resume-context<$5115,$5116,$5117,$5118> : resume-contextstd/core/hnd/resume-context: (V, E, E, V) -> V<bb: V,ee: E,e0e0: E,rr: V>, xx: $5115 : bb: V )result: -> 5163 5165 : ee: E rr: V (rr: resume-context<$5115,$5116,$5117,$5118>.kstd/core/hnd/resume-context/k: (resume-context<$5115,$5116,$5117,$5118>) -> $5116 ((resume-result<$5115,$5118>) -> $5116 $5118))(Deepstd/core/hnd/Deep: forall<a,b> (result : a) -> resume-result<a,b>(xx: $5115)) -pub fun resume-shallowstd/core/hnd/resume-shallow: forall<a,e,e1,b> (r : resume-context<a,e,e1,b>, x : a) -> e1 b( rr: resume-context<$5178,$5179,$5180,$5181> : resume-contextstd/core/hnd/resume-context: (V, E, E, V) -> V<bb: V,ee: E,e0e0: E,rr: V>, xx: $5178 : bb: V )result: -> 5242 5243 : e0e0: E rr: V +pub fun resume-shallowstd/core/hnd/resume-shallow: forall<a,e,e1,b> (r : resume-context<a,e,e1,b>, x : a) -> e1 b( rr: resume-context<$5178,$5179,$5180,$5181> : resume-contextstd/core/hnd/resume-context: (V, E, E, V) -> V<bb: V,ee: E,e0e0: E,rr: V>, xx: $5178 : bb: V )result: -> 5242 5243 : e0e0: E rr: V cast-ev1std/core/hnd/cast-ev1: (f : (resume-result<$5178,$5181>) -> $5179 $5181) -> $5180 ((resume-result<$5178,$5181>) -> $5180 $5181)(rr: resume-context<$5178,$5179,$5180,$5181>.kstd/core/hnd/resume-context/k: (resume-context<$5178,$5179,$5180,$5181>) -> $5180 ((resume-result<$5178,$5181>) -> $5179 $5181))(Shallowstd/core/hnd/Shallow: forall<a,b> (result : a) -> resume-result<a,b>(xx: $5178)) -pub fun finalizestd/core/hnd/finalize: forall<a,e,e1,b> (r : resume-context<a,e,e1,b>, x : b) -> e b( rr: resume-context<$5256,$5257,$5258,$5259> : resume-contextstd/core/hnd/resume-context: (V, E, E, V) -> V<bb: V,ee: E,e0e0: E,rr: V>, xx: $5259 : rr: V )result: -> 5304 5306 : ee: E rr: V +pub fun finalizestd/core/hnd/finalize: forall<a,e,e1,b> (r : resume-context<a,e,e1,b>, x : b) -> e b( rr: resume-context<$5256,$5257,$5258,$5259> : resume-contextstd/core/hnd/resume-context: (V, E, E, V) -> V<bb: V,ee: E,e0e0: E,rr: V>, xx: $5259 : rr: V )result: -> 5304 5306 : ee: E rr: V //finalize(r.k,x) (rr: resume-context<$5256,$5257,$5258,$5259>.kstd/core/hnd/resume-context/k: (resume-context<$5256,$5257,$5258,$5259>) -> $5257 ((resume-result<$5256,$5259>) -> $5257 $5259))(Finalizestd/core/hnd/Finalize: forall<a,b> (result : b) -> resume-result<a,b>(xx: $5259)) @@ -570,76 +570,76 @@ // Clauses // ------------------------------------------- -abstract value type clause1std/core/hnd/clause1: (V, V, (E, V) -> V, E, V) -> V<aa: V::V,bb: V::V,hh: (E, V) -> V::(E,V)->V,ee: E::E,rr: V::V> - Clause1std/core/hnd/Clause1: forall<a,b,c,e,d> (clause : (marker<e,d>, ev<c>, a) -> e b) -> clause1<a,b,c,e,d>( clausestd/core/hnd/clause1/clause: forall<a,b,c,e,d> (clause1 : clause1<a,b,c,e,d>) -> ((marker<e,d>, ev<c>, a) -> e b): (markerstd/core/hnd/marker: (E, V) -> V<ee: E,rr: V>, evstd/core/hnd/ev: ((E, V) -> V) -> V<hh: (E, V) -> V>, aa: V) -> ee: E bb: V ) +abstract value type clause1std/core/hnd/clause1: (V, V, (E, V) -> V, E, V) -> V<aa: V::V,bb: V::V,hh: (E, V) -> V::(E,V)->V,ee: E::E,rr: V::V> + Clause1std/core/hnd/Clause1: forall<a,b,c,e,d> (clause : (marker<e,d>, ev<c>, a) -> e b) -> clause1<a,b,c,e,d>( clausestd/core/hnd/clause1/clause: forall<a,b,c,e,d> (clause1 : clause1<a,b,c,e,d>) -> ((marker<e,d>, ev<c>, a) -> e b): (markerstd/core/hnd/marker: (E, V) -> V<ee: E,rr: V>, evstd/core/hnd/ev: ((E, V) -> V) -> V<hh: (E, V) -> V>, aa: V) -> ee: E bb: V ) -inline extern cast-clause0std/core/hnd/cast-clause0: forall<a,e,e1,b,c> (f : (marker<e1,c>, ev<b>) -> e1 a) -> e ((marker<e1,c>, ev<b>) -> e a)( f : (markerstd/core/hnd/marker: (E, V) -> V<e1e1: E,rr: V>,evstd/core/hnd/ev: ((E, V) -> V) -> V<hh: (E, V) -> V>) -> e1e1: E bb: V) : ee: E ((markerstd/core/hnd/marker: (E, V) -> V<e1e1: E,rr: V>,evstd/core/hnd/ev: ((E, V) -> V) -> V<hh: (E, V) -> V>) -> ee: E bb: V) +inline extern cast-clause0std/core/hnd/cast-clause0: forall<a,e,e1,b,c> (f : (marker<e1,c>, ev<b>) -> e1 a) -> e ((marker<e1,c>, ev<b>) -> e a)( f : (markerstd/core/hnd/marker: (E, V) -> V<e1e1: E,rr: V>,evstd/core/hnd/ev: ((E, V) -> V) -> V<hh: (E, V) -> V>) -> e1e1: E bb: V) : ee: E ((markerstd/core/hnd/marker: (E, V) -> V<e1e1: E,rr: V>,evstd/core/hnd/ev: ((E, V) -> V) -> V<hh: (E, V) -> V>) -> ee: E bb: V) inline "#1" -inline extern cast-clause1std/core/hnd/cast-clause1: forall<a,b,e,e1,c,d> (f : (marker<e1,d>, ev<c>, a) -> e1 b) -> e ((marker<e1,d>, ev<c>, a) -> e b)( f : (markerstd/core/hnd/marker: (E, V) -> V<e1e1: E,rr: V>,evstd/core/hnd/ev: ((E, V) -> V) -> V<hh: (E, V) -> V>,aa: V) -> e1e1: E bb: V) : ee: E ((markerstd/core/hnd/marker: (E, V) -> V<e1e1: E,rr: V>,evstd/core/hnd/ev: ((E, V) -> V) -> V<hh: (E, V) -> V>,aa: V) -> ee: E bb: V) +inline extern cast-clause1std/core/hnd/cast-clause1: forall<a,b,e,e1,c,d> (f : (marker<e1,d>, ev<c>, a) -> e1 b) -> e ((marker<e1,d>, ev<c>, a) -> e b)( f : (markerstd/core/hnd/marker: (E, V) -> V<e1e1: E,rr: V>,evstd/core/hnd/ev: ((E, V) -> V) -> V<hh: (E, V) -> V>,aa: V) -> e1e1: E bb: V) : ee: E ((markerstd/core/hnd/marker: (E, V) -> V<e1e1: E,rr: V>,evstd/core/hnd/ev: ((E, V) -> V) -> V<hh: (E, V) -> V>,aa: V) -> ee: E bb: V) inline "#1" -inline extern cast-clause2std/core/hnd/cast-clause2: forall<a,b,c,e,e1,d,a1> (f : (marker<e1,a1>, ev<d>, a, b) -> e1 c) -> e ((marker<e1,a1>, ev<d>, a, b) -> e c)( f : (markerstd/core/hnd/marker: (E, V) -> V<e1e1: E,rr: V>,evstd/core/hnd/ev: ((E, V) -> V) -> V<hh: (E, V) -> V>,a1a1: V,a2a2: V) -> e1e1: E bb: V) : ee: E ((markerstd/core/hnd/marker: (E, V) -> V<e1e1: E,rr: V>,evstd/core/hnd/ev: ((E, V) -> V) -> V<hh: (E, V) -> V>,a1a1: V,a2a2: V) -> ee: E bb: V) +inline extern cast-clause2std/core/hnd/cast-clause2: forall<a,b,c,e,e1,d,a1> (f : (marker<e1,a1>, ev<d>, a, b) -> e1 c) -> e ((marker<e1,a1>, ev<d>, a, b) -> e c)( f : (markerstd/core/hnd/marker: (E, V) -> V<e1e1: E,rr: V>,evstd/core/hnd/ev: ((E, V) -> V) -> V<hh: (E, V) -> V>,a1a1: V,a2a2: V) -> e1e1: E bb: V) : ee: E ((markerstd/core/hnd/marker: (E, V) -> V<e1e1: E,rr: V>,evstd/core/hnd/ev: ((E, V) -> V) -> V<hh: (E, V) -> V>,a1a1: V,a2a2: V) -> ee: E bb: V) inline "#1" -pub inline fun @perform1<aa: V,bb: V,hh: (E, V) -> V>( evev: ev<$5321> : evstd/core/hnd/ev: ((E, V) -> V) -> V<hh: (E, V) -> V>, opop: forall<e,a> ($5321<e,a>) -> clause1<$5319,$5320,$5321,e,a> : (forall<e1e1: E,rr: V> hh: (E, V) -> V<e1e1: E,rr: V> -> clause1std/core/hnd/clause1: (V, V, (E, V) -> V, E, V) -> V<aa: V,bb: V,hh: (E, V) -> V,e1e1: E,rr: V>), xx: $5319 : aa: V )result: -> 5407 5405 : ee: E bb: V +pub inline fun @perform1<aa: V,bb: V,hh: (E, V) -> V>( evev: ev<$5321> : evstd/core/hnd/ev: ((E, V) -> V) -> V<hh: (E, V) -> V>, opop: forall<e,a> ($5321<e,a>) -> clause1<$5319,$5320,$5321,e,a> : (forall<e1e1: E,rr: V> hh: (E, V) -> V<e1e1: E,rr: V> -> clause1std/core/hnd/clause1: (V, V, (E, V) -> V, E, V) -> V<aa: V,bb: V,hh: (E, V) -> V,e1e1: E,rr: V>), xx: $5319 : aa: V )result: -> 5407 5405 : ee: E bb: V match evev: ev<$5321> Evstd/core/hnd/Ev: forall<a,e,b> (htag : htag<a>, marker : marker<e,b>, hnd : a<e,b>, hevv : evv<e>) -> ev<a>(_tag,mm: marker<$5328,$5329>,hh: $5321<$5328,$5329>,_w) -> match hh: $5321<$5328,$5329>.opop: ($5321<$5328,$5329>) -> $5322 clause1<$5319,$5320,$5321,$5328,$5329> Clause1std/core/hnd/Clause1: forall<a,b,c,e,d> (clause : (marker<e,d>, ev<c>, a) -> e b) -> clause1<a,b,c,e,d>(ff: (marker<$5328,$5329>, ev<$5321>, $5319) -> $5328 $5320) -> cast-clause1std/core/hnd/cast-clause1: (f : (marker<$5328,$5329>, ev<$5321>, $5319) -> $5328 $5320) -> $5322 ((marker<$5328,$5329>, ev<$5321>, $5319) -> $5322 $5320)(ff: (marker<$5328,$5329>, ev<$5321>, $5319) -> $5328 $5320)(mm: marker<$5328,$5329>,evev: ev<$5321>,xx: $5319) -fun evv-swap-withstd/core/hnd/evv-swap-with: forall<a,e> (ev : ev<a>) -> evv<e>(evev: ev<$5422> : evstd/core/hnd/ev: ((E, V) -> V) -> V<hh: (E, V) -> V>)result: -> total evv<5462> +fun evv-swap-withstd/core/hnd/evv-swap-with: forall<a,e> (ev : ev<a>) -> evv<e>(evev: ev<$5422> : evstd/core/hnd/ev: ((E, V) -> V) -> V<hh: (E, V) -> V>)result: -> total evv<5462> match(evev: ev<$5422>) Evstd/core/hnd/Ev: forall<a,e,b> (htag : htag<a>, marker : marker<e,b>, hnd : a<e,b>, hevv : evv<e>) -> ev<a>(_tag,_m,_h,ww: evv<$5428>) -> evv-swapstd/core/hnd/evv-swap: (w : evv<$5428>) -> evv<_5445>(ww: evv<$5428>) -inline fun under1std/core/hnd/under1: forall<a,b,e,c> (ev : ev<c>, op : (a) -> e b, x : a) -> e b( evev: ev<$5583> : evstd/core/hnd/ev: ((E, V) -> V) -> V<hh: (E, V) -> V>, opop: ($5580) -> $5582 $5581 : aa: V -> ee: E bb: V, xx: $5580 : aa: V )result: -> 5676 5675 : ee: E bb: V +inline fun under1std/core/hnd/under1: forall<a,b,e,c> (ev : ev<c>, op : (a) -> e b, x : a) -> e b( evev: ev<$5583> : evstd/core/hnd/ev: ((E, V) -> V) -> V<hh: (E, V) -> V>, opop: ($5580) -> $5582 $5581 : aa: V -> ee: E bb: V, xx: $5580 : aa: V )result: -> 5676 5675 : ee: E bb: V val w0w0: evv<_5591> = evv-swap-withstd/core/hnd/evv-swap-with: (ev : ev<$5583>) -> $5582 evv<_5591>(evev: ev<$5583>) val yy: $5581 = opop: ($5580) -> $5582 $5581(xx: $5580) // evv-set(w0) // only needed before yielding for evidence expected check in prompt - if yieldingstd/core/hnd/yielding: () -> $5582 bool() returnreturn: $5581 yield-contstd/core/hnd/yield-cont: (f : forall<a> ((a) -> $5582 $5581, a) -> $5582 $5581) -> $5582 $5581( fnfn: forall<a,b,e> (cont : (a) -> e b, res : a) -> e b(contcont: ($5611) -> $5582 $5581,resres: $5611) under1xstd/core/hnd/under1x: (ev : ev<$5583>, op : ($5611) -> $5582 $5581, x : $5611) -> $5582 $5581(pretend-decreasingstd/core/undiv/pretend-decreasing: (x : ev<$5583>) -> $5582 ev<$5583>(evev: ev<$5583>),contcont: ($5611) -> $5582 $5581,resres: $5611) )std/core/types/Unit: () + if yieldingstd/core/hnd/yielding: () -> $5582 bool() returnreturn: $5581 yield-contstd/core/hnd/yield-cont: (f : forall<a> ((a) -> $5582 $5581, a) -> $5582 $5581) -> $5582 $5581( fnfn: forall<a,b,e> (cont : (a) -> e b, res : a) -> e b(contcont: ($5611) -> $5582 $5581,resres: $5611) under1xstd/core/hnd/under1x: (ev : ev<$5583>, op : ($5611) -> $5582 $5581, x : $5611) -> $5582 $5581(pretend-decreasingstd/core/undiv/pretend-decreasing: (x : ev<$5583>) -> $5582 ev<$5583>(evev: ev<$5583>),contcont: ($5611) -> $5582 $5581,resres: $5611) )std/core/types/Unit: () evv-setstd/core/hnd/evv-set: (w : evv<_5591>) -> $5582 ()(w0w0: evv<_5591>) yy: $5581 // extra under1x to make under1 inlineable -noinline fun under1xstd/core/hnd/under1x: forall<a,b,e,c> (ev : ev<c>, op : (a) -> e b, x : a) -> e b( evev: ev<$5473> : evstd/core/hnd/ev: ((E, V) -> V) -> V<hh: (E, V) -> V>, opop: ($5470) -> $5472 $5471 : aa: V -> ee: E bb: V, xx: $5470 : aa: V )result: -> 5566 5565 : ee: E bb: V +noinline fun under1xstd/core/hnd/under1x: forall<a,b,e,c> (ev : ev<c>, op : (a) -> e b, x : a) -> e b( evev: ev<$5473> : evstd/core/hnd/ev: ((E, V) -> V) -> V<hh: (E, V) -> V>, opop: ($5470) -> $5472 $5471 : aa: V -> ee: E bb: V, xx: $5470 : aa: V )result: -> 5566 5565 : ee: E bb: V val w0w0: evv<_5481> = evv-swap-withstd/core/hnd/evv-swap-with: (ev : ev<$5473>) -> $5472 evv<_5481>(evev: ev<$5473>) val yy: $5471 = opop: ($5470) -> $5472 $5471(xx: $5470) // evv-set(w0) // only needed before yielding for evidence expected check in prompt - if yieldingstd/core/hnd/yielding: () -> $5472 bool() returnreturn: $5471 yield-contstd/core/hnd/yield-cont: (f : forall<a> ((a) -> $5472 $5471, a) -> $5472 $5471) -> $5472 $5471( fnfn: forall<a,b,e> (cont : (a) -> e b, res : a) -> e b(contcont: ($5501) -> $5472 $5471,resres: $5501) under1xstd/core/hnd/under1x: (ev : ev<$5473>, op : ($5501) -> $5472 $5471, x : $5501) -> $5472 $5471(pretend-decreasingstd/core/undiv/pretend-decreasing: (x : ev<$5473>) -> $5472 ev<$5473>(evev: ev<$5473>),contcont: ($5501) -> $5472 $5471,resres: $5501) )std/core/types/Unit: () + if yieldingstd/core/hnd/yielding: () -> $5472 bool() returnreturn: $5471 yield-contstd/core/hnd/yield-cont: (f : forall<a> ((a) -> $5472 $5471, a) -> $5472 $5471) -> $5472 $5471( fnfn: forall<a,b,e> (cont : (a) -> e b, res : a) -> e b(contcont: ($5501) -> $5472 $5471,resres: $5501) under1xstd/core/hnd/under1x: (ev : ev<$5473>, op : ($5501) -> $5472 $5471, x : $5501) -> $5472 $5471(pretend-decreasingstd/core/undiv/pretend-decreasing: (x : ev<$5473>) -> $5472 ev<$5473>(evev: ev<$5473>),contcont: ($5501) -> $5472 $5471,resres: $5501) )std/core/types/Unit: () evv-setstd/core/hnd/evv-set: (w : evv<_5481>) -> $5472 ()(w0w0: evv<_5481>) yy: $5471 -pub fun clause-control-raw1std/core/hnd/clause-control-raw1: forall<a,b,e,e1,c,d> (op : (x : a, r : resume-context<b,e,e1,d>) -> e d) -> clause1<a,b,c,e,d>( opop: (x : $5690, r : resume-context<$5691,$5692,$5693,$5695>) -> $5692 $5695 : (x:aa: V, r: resume-contextstd/core/hnd/resume-context: (V, E, E, V) -> V<bb: V,ee: E,e0e0: E,rr: V>) -> ee: E rr: V )result: -> total clause1<5771,5772,5775,5773,5776> : clause1std/core/hnd/clause1: (V, V, (E, V) -> V, E, V) -> V<aa: V,bb: V,hh: (E, V) -> V,ee: E,rr: V> +pub fun clause-control-raw1std/core/hnd/clause-control-raw1: forall<a,b,e,e1,c,d> (op : (x : a, r : resume-context<b,e,e1,d>) -> e d) -> clause1<a,b,c,e,d>( opop: (x : $5690, r : resume-context<$5691,$5692,$5693,$5695>) -> $5692 $5695 : (x:aa: V, r: resume-contextstd/core/hnd/resume-context: (V, E, E, V) -> V<bb: V,ee: E,e0e0: E,rr: V>) -> ee: E rr: V )result: -> total clause1<5771,5772,5775,5773,5776> : clause1std/core/hnd/clause1: (V, V, (E, V) -> V, E, V) -> V<aa: V,bb: V,hh: (E, V) -> V,ee: E,rr: V> Clause1std/core/hnd/Clause1: forall<a,b,c,e,d> (clause : (marker<e,d>, ev<c>, a) -> e b) -> clause1<a,b,c,e,d>(fnfn: (m : marker<$5692,$5695>, ev<$5694>, x : $5690) -> $5692 $5691(mm: marker<$5692,$5695>,_ev,xx: $5690){ yield-tostd/core/hnd/yield-to: (m : marker<$5692,$5695>, clause : ((resume-result<$5691,$5695>) -> $5692 $5695) -> $5692 $5695) -> $5692 $5691(mm: marker<$5692,$5695>, fnfn: (k : (resume-result<$5691,$5695>) -> $5692 $5695) -> $5692 $5695(kk: (resume-result<$5691,$5695>) -> $5692 $5695){ opop: (x : $5690, r : resume-context<$5691,$5692,$5693,$5695>) -> $5692 $5695(xx: $5690,Resume-contextstd/core/hnd/Resume-context: forall<a,e,e1,b> (k : (resume-result<a,b>) -> e b) -> resume-context<a,e,e1,b>(kk: (resume-result<$5691,$5695>) -> $5692 $5695)) } ) } ) -fun getstd/core/hnd/get: forall<a,h> (ref : ref<h,a>) -> <read<h>,div> a( refref: ref<$5797,$5796>: refstd/core/types/ref: (H, V) -> V<hh: H,aa: V>)result: -> <read<5824>,div> 5823 : <std/core/types/total: Ereadstd/core/types/read: H -> X<hh: H>,divstd/core/types/div: X> aa: V - !std/core/types/ref/(!): (ref : ref<$5797,$5796>) -> <read<$5797>,div> $5796refref: ref<$5797,$5796> +fun getstd/core/hnd/get: forall<a,h> (ref : ref<h,a>) -> <read<h>,div> a( refref: ref<$5797,$5796>: refstd/core/types/ref: (H, V) -> V<hh: H,aa: V>)result: -> <read<5824>,div> 5823 : <std/core/types/total: Ereadstd/core/types/read: H -> X<hh: H>,divstd/core/types/div: X> aa: V + !std/core/types/ref/(!): (ref : ref<$5797,$5796>) -> <read<$5797>,div> $5796refref: ref<$5797,$5796> -inline extern unsafe-ststd/core/hnd/unsafe-st: forall<a,e> (f : () -> <st<global>|e> a) -> (() -> e a)(f : () -> <ststd/core/types/st: H -> E<globalstd/core/types/global: H>|ee: E> aa: V ) : ((std/core/types/total: E) -> ee: E aa: V) +inline extern unsafe-ststd/core/hnd/unsafe-st: forall<a,e> (f : () -> <st<global>|e> a) -> (() -> e a)(f : () -> <ststd/core/types/st: H -> E<globalstd/core/types/global: H>|ee: E> aa: V ) : ((std/core/types/total: E) -> ee: E aa: V) inline "#1" -fun protect-promptstd/core/hnd/protect-prompt: forall<a,e,b> (resumed : ref<global,bool>, k : (resume-result<a,b>) -> e b, res : b) -> e b( resumedresumed: ref<global,bool> : refstd/core/types/ref: (H, V) -> V<globalstd/core/types/global: H,boolstd/core/types/bool: V>, kk: (resume-result<$5832,$5834>) -> $5833 $5834 : resume-resultstd/core/hnd/resume-result: (V, V) -> V<bb: V,rr: V> -> ee: E rr: V, resres: $5834 : rr: V )result: -> 6005 6006 : ee: E rr: V - val did-resumedid-resume: bool : boolstd/core/types/bool: V = (unsafe-ststd/core/hnd/unsafe-st: (f : () -> <st<global>|$5833> bool) -> $5833 (() -> $5833 bool){ !std/core/types/ref/(!): (ref : ref<global,bool>) -> <read<global>,alloc<global>,write<global>|$5833> boolresumedresumed: ref<global,bool> })() +fun protect-promptstd/core/hnd/protect-prompt: forall<a,e,b> (resumed : ref<global,bool>, k : (resume-result<a,b>) -> e b, res : b) -> e b( resumedresumed: ref<global,bool> : refstd/core/types/ref: (H, V) -> V<globalstd/core/types/global: H,boolstd/core/types/bool: V>, kk: (resume-result<$5832,$5834>) -> $5833 $5834 : resume-resultstd/core/hnd/resume-result: (V, V) -> V<bb: V,rr: V> -> ee: E rr: V, resres: $5834 : rr: V )result: -> 6005 6006 : ee: E rr: V + val did-resumedid-resume: bool : boolstd/core/types/bool: V = (unsafe-ststd/core/hnd/unsafe-st: (f : () -> <st<global>|$5833> bool) -> $5833 (() -> $5833 bool){ !std/core/types/ref/(!): (ref : ref<global,bool>) -> <read<global>,alloc<global>,write<global>|$5833> boolresumedresumed: ref<global,bool> })() if did-resumedid-resume: bool then // if resumed, we no longer need to protect resres: $5834 - elif !std/core/types/bool/(!): (b : bool) -> $5833 boolyieldingstd/core/hnd/yielding: () -> $5833 bool() then + elif !std/core/types/bool/(!): (b : bool) -> $5833 boolyieldingstd/core/hnd/yielding: () -> $5833 bool() then // otherwise, if we are not yielding, resume k with finalization (to run all finally clauses) kk: (resume-result<$5832,$5834>) -> $5833 $5834(Finalizestd/core/hnd/Finalize: forall<a,b> (result : b) -> resume-result<a,b>(resres: $5834)) elif yielding-non-finalstd/core/hnd/yielding-non-final: () -> $5833 bool() then // if we yield non-final to an operation, extend the continuation with this prompt (so we keep protecting after being resumed) - yield-contstd/core/hnd/yield-cont: (f : forall<a> ((a) -> $5833 $5834, a) -> $5833 $5834) -> $5833 $5834( fnfn: forall<a> (cont : (a) -> $5833 $5834, x : a) -> $5833 $5834(contcont: ($5910) -> $5833 $5834,xx: $5910) protect-promptstd/core/hnd/protect-prompt: (resumed : ref<global,bool>, k : (resume-result<$5832,$5834>) -> $5833 $5834, res : $5834) -> $5833 $5834(pretend-decreasingstd/core/undiv/pretend-decreasing: (x : ref<global,bool>) -> $5833 ref<global,bool>(resumedresumed: ref<global,bool>),kk: (resume-result<$5832,$5834>) -> $5833 $5834,contcont: ($5910) -> $5833 $5834(xx: $5910)) ) + yield-contstd/core/hnd/yield-cont: (f : forall<a> ((a) -> $5833 $5834, a) -> $5833 $5834) -> $5833 $5834( fnfn: forall<a> (cont : (a) -> $5833 $5834, x : a) -> $5833 $5834(contcont: ($5910) -> $5833 $5834,xx: $5910) protect-promptstd/core/hnd/protect-prompt: (resumed : ref<global,bool>, k : (resume-result<$5832,$5834>) -> $5833 $5834, res : $5834) -> $5833 $5834(pretend-decreasingstd/core/undiv/pretend-decreasing: (x : ref<global,bool>) -> $5833 ref<global,bool>(resumedresumed: ref<global,bool>),kk: (resume-result<$5832,$5834>) -> $5833 $5834,contcont: ($5910) -> $5833 $5834(xx: $5910)) ) else // if we are in a final yield, capture it, resume k with finalization, and reyield val yldyld: yield-info = yield-capturestd/core/hnd/yield-capture: () -> $5833 yield-info() kk: (resume-result<$5832,$5834>) -> $5833 $5834(Finalizestd/core/hnd/Finalize: forall<a,b> (result : b) -> resume-result<a,b>(resres: $5834)) - if yieldingstd/core/hnd/yielding: () -> $5833 bool() returnreturn: $5834 yield-extendstd/core/hnd/yield-extend: (next : (_5964) -> $5833 $5834) -> $5833 $5834( fnfn: (_5964) -> $5833 $5834(_x) unsafe-reyieldstd/core/hnd/unsafe-reyield: (yld : yield-info) -> $5833 $5834(yldyld: yield-info) )std/core/types/Unit: () // yikes, a finally clause is itself yielding... + if yieldingstd/core/hnd/yielding: () -> $5833 bool() returnreturn: $5834 yield-extendstd/core/hnd/yield-extend: (next : (_5964) -> $5833 $5834) -> $5833 $5834( fnfn: (_5964) -> $5833 $5834(_x) unsafe-reyieldstd/core/hnd/unsafe-reyield: (yld : yield-info) -> $5833 $5834(yldyld: yield-info) )std/core/types/Unit: () // yikes, a finally clause is itself yielding... unsafe-reyieldstd/core/hnd/unsafe-reyield: (yld : yield-info) -> $5833 $5834(yldyld: yield-info) -fun protectstd/core/hnd/protect: forall<a,b,e,c> (x : a, clause : (x : a, k : (b) -> e c) -> e c, k : (resume-result<b,c>) -> e c) -> e c( xx: $6016 : aa: V, clauseclause: (x : $6016, k : ($6017) -> $6018 $6019) -> $6018 $6019 : (x:aa: V, k: bb: V -> ee: E rr: V) -> ee: E rr: V, kk: (resume-result<$6017,$6019>) -> $6018 $6019 : resume-resultstd/core/hnd/resume-result: (V, V) -> V<bb: V,rr: V> -> ee: E rr: V )result: -> 6115 6116 : ee: E rr: V - val resumedresumed: ref<global,bool> = (unsafe-ststd/core/hnd/unsafe-st: (f : () -> <st<global>|$6018> ref<global,bool>) -> $6018 (() -> $6018 ref<global,bool>){refstd/core/types/ref: (value : bool) -> <alloc<global>,read<global>,write<global>|$6018> ref<global,bool>(Falsestd/core/types/False: bool)})() +fun protectstd/core/hnd/protect: forall<a,b,e,c> (x : a, clause : (x : a, k : (b) -> e c) -> e c, k : (resume-result<b,c>) -> e c) -> e c( xx: $6016 : aa: V, clauseclause: (x : $6016, k : ($6017) -> $6018 $6019) -> $6018 $6019 : (x:aa: V, k: bb: V -> ee: E rr: V) -> ee: E rr: V, kk: (resume-result<$6017,$6019>) -> $6018 $6019 : resume-resultstd/core/hnd/resume-result: (V, V) -> V<bb: V,rr: V> -> ee: E rr: V )result: -> 6115 6116 : ee: E rr: V + val resumedresumed: ref<global,bool> = (unsafe-ststd/core/hnd/unsafe-st: (f : () -> <st<global>|$6018> ref<global,bool>) -> $6018 (() -> $6018 ref<global,bool>){refstd/core/types/ref: (value : bool) -> <alloc<global>,read<global>,write<global>|$6018> ref<global,bool>(Falsestd/core/types/False: bool)})() fun kprotectkprotect: (ret : $6017) -> $6018 $6019(retret: $6017)result: -> $6018 $6019 - (unsafe-ststd/core/hnd/unsafe-st: (f : () -> <st<global>|$6018> ()) -> $6018 (() -> $6018 ()){resumedresumed: ref<global,bool> :=std/core/types/set: (ref : ref<global,bool>, assigned : bool) -> <write<global>,alloc<global>,read<global>|$6018> () Truestd/core/types/True: bool})() + (unsafe-ststd/core/hnd/unsafe-st: (f : () -> <st<global>|$6018> ()) -> $6018 (() -> $6018 ()){resumedresumed: ref<global,bool> :=std/core/types/set: (ref : ref<global,bool>, assigned : bool) -> <write<global>,alloc<global>,read<global>|$6018> () Truestd/core/types/True: bool})() kk: (resume-result<$6017,$6019>) -> $6018 $6019(Deepstd/core/hnd/Deep: forall<a,b> (result : a) -> resume-result<a,b>(retret: $6017)) val resres: $6019 = clauseclause: (x : $6016, k : ($6017) -> $6018 $6019) -> $6018 $6019(xx: $6016,kprotectkprotect: (ret : $6017) -> $6018 $6019) protect-promptstd/core/hnd/protect-prompt: (resumed : ref<global,bool>, k : (resume-result<$6017,$6019>) -> $6018 $6019, res : $6019) -> $6018 $6019(resumedresumed: ref<global,bool>,kk: (resume-result<$6017,$6019>) -> $6018 $6019,resres: $6019) @@ -650,22 +650,22 @@ */ // generic control clause -pub fun clause-control1std/core/hnd/clause-control1: forall<a,b,e,c,d> (clause : (x : a, k : (b) -> e d) -> e d) -> clause1<a,b,c,e,d>( clauseclause: (x : $6129, k : ($6130) -> $6131 $6133) -> $6131 $6133 : (x:aa: V, k: bb: V -> ee: E rr: V) -> ee: E rr: V )result: -> total clause1<6203,6204,6206,6205,6207> : clause1std/core/hnd/clause1: (V, V, (E, V) -> V, E, V) -> V<aa: V,bb: V,hh: (E, V) -> V,ee: E,rr: V> +pub fun clause-control1std/core/hnd/clause-control1: forall<a,b,e,c,d> (clause : (x : a, k : (b) -> e d) -> e d) -> clause1<a,b,c,e,d>( clauseclause: (x : $6129, k : ($6130) -> $6131 $6133) -> $6131 $6133 : (x:aa: V, k: bb: V -> ee: E rr: V) -> ee: E rr: V )result: -> total clause1<6203,6204,6206,6205,6207> : clause1std/core/hnd/clause1: (V, V, (E, V) -> V, E, V) -> V<aa: V,bb: V,hh: (E, V) -> V,ee: E,rr: V> Clause1std/core/hnd/Clause1: forall<a,b,c,e,d> (clause : (marker<e,d>, ev<c>, a) -> e b) -> clause1<a,b,c,e,d>(fnfn: (m : marker<$6131,$6133>, ev<$6132>, x : $6129) -> $6131 $6130(mm: marker<$6131,$6133>,_ev,xx: $6129){ yield-tostd/core/hnd/yield-to: (m : marker<$6131,$6133>, clause : ((resume-result<$6130,$6133>) -> $6131 $6133) -> $6131 $6133) -> $6131 $6130(mm: marker<$6131,$6133>, fnfn: (k : (resume-result<$6130,$6133>) -> $6131 $6133) -> $6131 $6133(kk: (resume-result<$6130,$6133>) -> $6131 $6133) protectstd/core/hnd/protect: (x : $6129, clause : (x : $6129, k : ($6130) -> $6131 $6133) -> $6131 $6133, k : (resume-result<$6130,$6133>) -> $6131 $6133) -> $6131 $6133(xx: $6129,clauseclause: (x : $6129, k : ($6130) -> $6131 $6133) -> $6131 $6133,kk: (resume-result<$6130,$6133>) -> $6131 $6133) ) }) // tail-resumptive clause: resumes exactly once at the end // (these can be executed 'in-place' without capturing a resumption) -pub fun clause-tail1std/core/hnd/clause-tail1: forall<e,a,b,c,d> (op : (c) -> e d) -> clause1<c,d,b,e,a><ee: E,rr: V,hh: (E, V) -> V,aa: V,bb: V>(opop: ($6227) -> $6224 $6228 : aa: V -> ee: E bb: V)result: -> total clause1<6289,6290,6288,6286,6287> : clause1std/core/hnd/clause1: (V, V, (E, V) -> V, E, V) -> V<aa: V,bb: V,hh: (E, V) -> V,ee: E,rr: V> +pub fun clause-tail1std/core/hnd/clause-tail1: forall<e,a,b,c,d> (op : (c) -> e d) -> clause1<c,d,b,e,a><ee: E,rr: V,hh: (E, V) -> V,aa: V,bb: V>(opop: ($6227) -> $6224 $6228 : aa: V -> ee: E bb: V)result: -> total clause1<6289,6290,6288,6286,6287> : clause1std/core/hnd/clause1: (V, V, (E, V) -> V, E, V) -> V<aa: V,bb: V,hh: (E, V) -> V,ee: E,rr: V> Clause1std/core/hnd/Clause1: forall<a,b,c,e,d> (clause : (marker<e,d>, ev<c>, a) -> e b) -> clause1<a,b,c,e,d>(fnfn: (marker<$6224,$6225>, ev : ev<$6226>, x : $6227) -> $6224 $6228(_m,evev: ev<$6226>,xx: $6227){ under1std/core/hnd/under1: (ev : ev<$6226>, op : ($6227) -> $6224 $6228, x : $6227) -> $6224 $6228(evev: ev<$6226>,opop: ($6227) -> $6224 $6228,xx: $6227) }) // tail-resumptive clause that does not itself invoke operations // (these can be executed 'in-place' without setting the correct evidence vector) -pub fun clause-tail-noop1std/core/hnd/clause-tail-noop1: forall<e,a,b,c,d> (op : (c) -> e d) -> clause1<c,d,b,e,a><ee: E,rr: V,hh: (E, V) -> V,aa: V,bb: V>(opop: ($6310) -> $6307 $6311 : aa: V -> ee: E bb: V)result: -> total clause1<6358,6359,6357,6355,6356> : clause1std/core/hnd/clause1: (V, V, (E, V) -> V, E, V) -> V<aa: V,bb: V,hh: (E, V) -> V,ee: E,rr: V> +pub fun clause-tail-noop1std/core/hnd/clause-tail-noop1: forall<e,a,b,c,d> (op : (c) -> e d) -> clause1<c,d,b,e,a><ee: E,rr: V,hh: (E, V) -> V,aa: V,bb: V>(opop: ($6310) -> $6307 $6311 : aa: V -> ee: E bb: V)result: -> total clause1<6358,6359,6357,6355,6356> : clause1std/core/hnd/clause1: (V, V, (E, V) -> V, E, V) -> V<aa: V,bb: V,hh: (E, V) -> V,ee: E,rr: V> Clause1std/core/hnd/Clause1: forall<a,b,c,e,d> (clause : (marker<e,d>, ev<c>, a) -> e b) -> clause1<a,b,c,e,d>(fnfn: (marker<$6307,$6308>, ev<$6309>, x : $6310) -> $6307 $6311(_m,_ev,xx: $6310){ opop: ($6310) -> $6307 $6311(xx: $6310) }) // clause that never resumes (e.g. an exception handler) // (these do not need to capture a resumption and execute finally clauses upfront) -pub fun clause-never1std/core/hnd/clause-never1: forall<a,b,e,c,d> (op : (a) -> e d) -> clause1<a,b,c,e,d>( opop: ($6376) -> $6378 $6380 : aa: V -> ee: E rr: V )result: -> total clause1<6439,6440,6442,6441,6443> : clause1std/core/hnd/clause1: (V, V, (E, V) -> V, E, V) -> V<aa: V,bb: V,hh: (E, V) -> V,ee: E,rr: V> +pub fun clause-never1std/core/hnd/clause-never1: forall<a,b,e,c,d> (op : (a) -> e d) -> clause1<a,b,c,e,d>( opop: ($6376) -> $6378 $6380 : aa: V -> ee: E rr: V )result: -> total clause1<6439,6440,6442,6441,6443> : clause1std/core/hnd/clause1: (V, V, (E, V) -> V, E, V) -> V<aa: V,bb: V,hh: (E, V) -> V,ee: E,rr: V> Clause1std/core/hnd/Clause1: forall<a,b,c,e,d> (clause : (marker<e,d>, ev<c>, a) -> e b) -> clause1<a,b,c,e,d>(fnfn: (m : marker<$6378,$6380>, ev<$6379>, x : $6376) -> $6378 $6377(mm: marker<$6378,$6380>,_ev,xx: $6376){ yield-to-finalstd/core/hnd/yield-to-final: (m : marker<$6378,$6380>, clause : ((resume-result<$6377,$6380>) -> $6378 $6380) -> $6378 $6380) -> $6378 $6377(mm: marker<$6378,$6380>, fnfn: ((resume-result<$6377,$6380>) -> $6378 $6380) -> $6378 $6380(_k) opop: ($6376) -> $6378 $6380(xx: $6376) ) }) @@ -673,25 +673,25 @@ // 0 arguments; reuse 1 argument Clauses //---------------------------------------------------------------- -abstract value type clause0std/core/hnd/clause0: (V, (E, V) -> V, E, V) -> V<bb: V,hh: (E, V) -> V,ee: E,rr: V> - Clause0std/core/hnd/Clause0: forall<a,b,e,c> (clause : (marker<e,c>, ev<b>) -> e a) -> clause0<a,b,e,c>( clausestd/core/hnd/clause0/clause: forall<a,b,e,c> (clause0 : clause0<a,b,e,c>) -> ((marker<e,c>, ev<b>) -> e a): (markerstd/core/hnd/marker: (E, V) -> V<ee: E,rr: V>, evstd/core/hnd/ev: ((E, V) -> V) -> V<hh: (E, V) -> V>) -> ee: E bb: V ) +abstract value type clause0std/core/hnd/clause0: (V, (E, V) -> V, E, V) -> V<bb: V,hh: (E, V) -> V,ee: E,rr: V> + Clause0std/core/hnd/Clause0: forall<a,b,e,c> (clause : (marker<e,c>, ev<b>) -> e a) -> clause0<a,b,e,c>( clausestd/core/hnd/clause0/clause: forall<a,b,e,c> (clause0 : clause0<a,b,e,c>) -> ((marker<e,c>, ev<b>) -> e a): (markerstd/core/hnd/marker: (E, V) -> V<ee: E,rr: V>, evstd/core/hnd/ev: ((E, V) -> V) -> V<hh: (E, V) -> V>) -> ee: E bb: V ) //inline extern cast-hnd( h : h<e1,r> ) : e h<e,r> { inline "#1"//inline extern cast-marker( m : marker<e1,r> ) : e marker<e,r> { inline "#1" -pub inline fun @perform0( evev: ev<$6462> : evstd/core/hnd/ev: ((E, V) -> V) -> V<hh: (E, V) -> V>, opop: forall<e,a> ($6462<e,a>) -> clause0<$6460,$6462,e,a> : (forall<e1e1: E,rr: V> hh: (E, V) -> V<e1e1: E,rr: V> -> clause0std/core/hnd/clause0: (V, (E, V) -> V, E, V) -> V<bb: V,hh: (E, V) -> V,e1e1: E,rr: V>) )result: -> 6535 6534 : ee: E bb: V +pub inline fun @perform0( evev: ev<$6462> : evstd/core/hnd/ev: ((E, V) -> V) -> V<hh: (E, V) -> V>, opop: forall<e,a> ($6462<e,a>) -> clause0<$6460,$6462,e,a> : (forall<e1e1: E,rr: V> hh: (E, V) -> V<e1e1: E,rr: V> -> clause0std/core/hnd/clause0: (V, (E, V) -> V, E, V) -> V<bb: V,hh: (E, V) -> V,e1e1: E,rr: V>) )result: -> 6535 6534 : ee: E bb: V match evev: ev<$6462> Evstd/core/hnd/Ev: forall<a,e,b> (htag : htag<a>, marker : marker<e,b>, hnd : a<e,b>, hevv : evv<e>) -> ev<a>(_tag,mm: marker<$6468,$6469>,hh: $6462<$6468,$6469>,_w) -> match hh: $6462<$6468,$6469>.opop: ($6462<$6468,$6469>) -> $6461 clause0<$6460,$6462,$6468,$6469> Clause0std/core/hnd/Clause0: forall<a,b,e,c> (clause : (marker<e,c>, ev<b>) -> e a) -> clause0<a,b,e,c>(ff: (marker<$6468,$6469>, ev<$6462>) -> $6468 $6460) -> cast-clause0std/core/hnd/cast-clause0: (f : (marker<$6468,$6469>, ev<$6462>) -> $6468 $6460) -> $6461 ((marker<$6468,$6469>, ev<$6462>) -> $6461 $6460)(ff: (marker<$6468,$6469>, ev<$6462>) -> $6468 $6460)(mm: marker<$6468,$6469>,evev: ev<$6462>) -inline fun under0std/core/hnd/under0: forall<a,e,b> (ev : ev<b>, op : () -> e a) -> e a( evev: ev<$6550> : evstd/core/hnd/ev: ((E, V) -> V) -> V<ii: (E, V) -> V>, opop: () -> $6549 $6548 : () -> ee: E bb: V)result: -> 6631 6630 : ee: E bb: V +inline fun under0std/core/hnd/under0: forall<a,e,b> (ev : ev<b>, op : () -> e a) -> e a( evev: ev<$6550> : evstd/core/hnd/ev: ((E, V) -> V) -> V<ii: (E, V) -> V>, opop: () -> $6549 $6548 : () -> ee: E bb: V)result: -> 6631 6630 : ee: E bb: V val w0w0: evv<_6558> = evv-swap-withstd/core/hnd/evv-swap-with: (ev : ev<$6550>) -> $6549 evv<_6558>(evev: ev<$6550>) val yy: $6548 = opop: () -> $6549 $6548() // evv-set(w0) // only needed before yielding for evidence expected check in prompt evv-setstd/core/hnd/evv-set: (w : evv<_6558>) -> $6549 ()(w0w0: evv<_6558>) - if yieldingstd/core/hnd/yielding: () -> $6549 bool() returnreturn: $6548 yield-contstd/core/hnd/yield-cont: (f : forall<a> ((a) -> $6549 $6548, a) -> $6549 $6548) -> $6549 $6548( fnfn: forall<a,b,e> (cont : (a) -> e b, res : a) -> e b(contcont: ($6585) -> $6549 $6548,resres: $6585) under1std/core/hnd/under1: (ev : ev<$6550>, op : ($6585) -> $6549 $6548, x : $6585) -> $6549 $6548(evev: ev<$6550>,contcont: ($6585) -> $6549 $6548,resres: $6585) )std/core/types/Unit: () + if yieldingstd/core/hnd/yielding: () -> $6549 bool() returnreturn: $6548 yield-contstd/core/hnd/yield-cont: (f : forall<a> ((a) -> $6549 $6548, a) -> $6549 $6548) -> $6549 $6548( fnfn: forall<a,b,e> (cont : (a) -> e b, res : a) -> e b(contcont: ($6585) -> $6549 $6548,resres: $6585) under1std/core/hnd/under1: (ev : ev<$6550>, op : ($6585) -> $6549 $6548, x : $6585) -> $6549 $6548(evev: ev<$6550>,contcont: ($6585) -> $6549 $6548,resres: $6585) )std/core/types/Unit: () yy: $6548 -pub fun clause-control-raw0std/core/hnd/clause-control-raw0: forall<a,e,e1,b,c> (op : (resume-context<a,e,e1,c>) -> e c) -> clause0<a,b,e,c>( opop: (resume-context<$6642,$6643,$6644,$6646>) -> $6643 $6646 : resume-contextstd/core/hnd/resume-context: (V, E, E, V) -> V<bb: V,ee: E,e0e0: E,rr: V> -> ee: E rr: V )result: -> total clause0<6714,6717,6715,6718> : clause0std/core/hnd/clause0: (V, (E, V) -> V, E, V) -> V<bb: V,hh: (E, V) -> V,ee: E,rr: V> +pub fun clause-control-raw0std/core/hnd/clause-control-raw0: forall<a,e,e1,b,c> (op : (resume-context<a,e,e1,c>) -> e c) -> clause0<a,b,e,c>( opop: (resume-context<$6642,$6643,$6644,$6646>) -> $6643 $6646 : resume-contextstd/core/hnd/resume-context: (V, E, E, V) -> V<bb: V,ee: E,e0e0: E,rr: V> -> ee: E rr: V )result: -> total clause0<6714,6717,6715,6718> : clause0std/core/hnd/clause0: (V, (E, V) -> V, E, V) -> V<bb: V,hh: (E, V) -> V,ee: E,rr: V> Clause0std/core/hnd/Clause0: forall<a,b,e,c> (clause : (marker<e,c>, ev<b>) -> e a) -> clause0<a,b,e,c>(fnfn: (m : marker<$6643,$6646>, ev<$6645>) -> $6643 $6642(mm: marker<$6643,$6646>,_ev){ yield-tostd/core/hnd/yield-to: (m : marker<$6643,$6646>, clause : ((resume-result<$6642,$6646>) -> $6643 $6646) -> $6643 $6646) -> $6643 $6642(mm: marker<$6643,$6646>, fnfn: (k : (resume-result<$6642,$6646>) -> $6643 $6646) -> $6643 $6646(kk: (resume-result<$6642,$6646>) -> $6643 $6646){ opop: (resume-context<$6642,$6643,$6644,$6646>) -> $6643 $6646(Resume-contextstd/core/hnd/Resume-context: forall<a,e,e1,b> (k : (resume-result<a,b>) -> e b) -> resume-context<a,e,e1,b>(kk: (resume-result<$6642,$6646>) -> $6643 $6646)) } ) }) /* @@ -699,63 +699,63 @@ Clause0(fn(m,w){ yield-to(m, fn(k){ op(fn(r){ k({r} )}) }) }) */ -pub fun clause-control0std/core/hnd/clause-control0: forall<a,e,b,c> (op : ((a) -> e c) -> e c) -> clause0<a,b,e,c>( opop: (($6735) -> $6736 $6738) -> $6736 $6738 : (bb: V -> ee: E rr: V) -> ee: E rr: V )result: -> total clause0<6803,6805,6804,6806> : clause0std/core/hnd/clause0: (V, (E, V) -> V, E, V) -> V<bb: V,hh: (E, V) -> V,ee: E,rr: V> - Clause0std/core/hnd/Clause0: forall<a,b,e,c> (clause : (marker<e,c>, ev<b>) -> e a) -> clause0<a,b,e,c>(fnfn: (m : marker<$6736,$6738>, ev<$6737>) -> $6736 $6735(mm: marker<$6736,$6738>,_ev){ yield-tostd/core/hnd/yield-to: (m : marker<$6736,$6738>, clause : ((resume-result<$6735,$6738>) -> $6736 $6738) -> $6736 $6738) -> $6736 $6735(mm: marker<$6736,$6738>, fnfn: (k : (resume-result<$6735,$6738>) -> $6736 $6738) -> $6736 $6738(kk: (resume-result<$6735,$6738>) -> $6736 $6738){ protectstd/core/hnd/protect: (x : (), clause : (x : (), k : ($6735) -> $6736 $6738) -> $6736 $6738, k : (resume-result<$6735,$6738>) -> $6736 $6738) -> $6736 $6738((std/core/types/Unit: ())std/core/types/Unit: (),fnfn: ((), r : ($6735) -> $6736 $6738) -> $6736 $6738(_x,rr: ($6735) -> $6736 $6738){ opop: (($6735) -> $6736 $6738) -> $6736 $6738(rr: ($6735) -> $6736 $6738) }, kk: (resume-result<$6735,$6738>) -> $6736 $6738) }) }) +pub fun clause-control0std/core/hnd/clause-control0: forall<a,e,b,c> (op : ((a) -> e c) -> e c) -> clause0<a,b,e,c>( opop: (($6735) -> $6736 $6738) -> $6736 $6738 : (bb: V -> ee: E rr: V) -> ee: E rr: V )result: -> total clause0<6803,6805,6804,6806> : clause0std/core/hnd/clause0: (V, (E, V) -> V, E, V) -> V<bb: V,hh: (E, V) -> V,ee: E,rr: V> + Clause0std/core/hnd/Clause0: forall<a,b,e,c> (clause : (marker<e,c>, ev<b>) -> e a) -> clause0<a,b,e,c>(fnfn: (m : marker<$6736,$6738>, ev<$6737>) -> $6736 $6735(mm: marker<$6736,$6738>,_ev){ yield-tostd/core/hnd/yield-to: (m : marker<$6736,$6738>, clause : ((resume-result<$6735,$6738>) -> $6736 $6738) -> $6736 $6738) -> $6736 $6735(mm: marker<$6736,$6738>, fnfn: (k : (resume-result<$6735,$6738>) -> $6736 $6738) -> $6736 $6738(kk: (resume-result<$6735,$6738>) -> $6736 $6738){ protectstd/core/hnd/protect: (x : (), clause : (x : (), k : ($6735) -> $6736 $6738) -> $6736 $6738, k : (resume-result<$6735,$6738>) -> $6736 $6738) -> $6736 $6738((std/core/types/Unit: ())std/core/types/Unit: (),fnfn: ((), r : ($6735) -> $6736 $6738) -> $6736 $6738(_x,rr: ($6735) -> $6736 $6738){ opop: (($6735) -> $6736 $6738) -> $6736 $6738(rr: ($6735) -> $6736 $6738) }, kk: (resume-result<$6735,$6738>) -> $6736 $6738) }) }) -pub fun clause-tail0std/core/hnd/clause-tail0: forall<e,a,b,c> (op : () -> e c) -> clause0<c,b,e,a><ee: E,rr: V,hh: (E, V) -> V,bb: V>(opop: () -> $6820 $6823 : () -> ee: E bb: V)result: -> total clause0<6873,6872,6870,6871> : clause0std/core/hnd/clause0: (V, (E, V) -> V, E, V) -> V<bb: V,hh: (E, V) -> V,ee: E,rr: V> +pub fun clause-tail0std/core/hnd/clause-tail0: forall<e,a,b,c> (op : () -> e c) -> clause0<c,b,e,a><ee: E,rr: V,hh: (E, V) -> V,bb: V>(opop: () -> $6820 $6823 : () -> ee: E bb: V)result: -> total clause0<6873,6872,6870,6871> : clause0std/core/hnd/clause0: (V, (E, V) -> V, E, V) -> V<bb: V,hh: (E, V) -> V,ee: E,rr: V> Clause0std/core/hnd/Clause0: forall<a,b,e,c> (clause : (marker<e,c>, ev<b>) -> e a) -> clause0<a,b,e,c>(fnfn: (marker<$6820,$6821>, ev : ev<$6822>) -> $6820 $6823(_m,evev: ev<$6822>){ under0std/core/hnd/under0: (ev : ev<$6822>, op : () -> $6820 $6823) -> $6820 $6823(evev: ev<$6822>,opop: () -> $6820 $6823) }) -pub fun clause-tail-noop0std/core/hnd/clause-tail-noop0: forall<e,a,b,c> (op : () -> e c) -> clause0<c,b,e,a><ee: E,rr: V,hh: (E, V) -> V,bb: V>(opop: () -> $6887 $6890 : () -> ee: E bb: V)result: -> total clause0<6929,6928,6926,6927> : clause0std/core/hnd/clause0: (V, (E, V) -> V, E, V) -> V<bb: V,hh: (E, V) -> V,ee: E,rr: V> +pub fun clause-tail-noop0std/core/hnd/clause-tail-noop0: forall<e,a,b,c> (op : () -> e c) -> clause0<c,b,e,a><ee: E,rr: V,hh: (E, V) -> V,bb: V>(opop: () -> $6887 $6890 : () -> ee: E bb: V)result: -> total clause0<6929,6928,6926,6927> : clause0std/core/hnd/clause0: (V, (E, V) -> V, E, V) -> V<bb: V,hh: (E, V) -> V,ee: E,rr: V> Clause0std/core/hnd/Clause0: forall<a,b,e,c> (clause : (marker<e,c>, ev<b>) -> e a) -> clause0<a,b,e,c>(fnfn: (marker<$6887,$6888>, ev<$6889>) -> $6887 $6890(_m,_ev){ opop: () -> $6887 $6890() }) -pub fun clause-valuestd/core/hnd/clause-value: forall<a,e,b,c> (v : a) -> clause0<a,b,e,c>(vv: $6943 : bb: V)result: -> total clause0<6982,6984,6983,6985> : clause0std/core/hnd/clause0: (V, (E, V) -> V, E, V) -> V<bb: V,hh: (E, V) -> V,ee: E,rr: V> +pub fun clause-valuestd/core/hnd/clause-value: forall<a,e,b,c> (v : a) -> clause0<a,b,e,c>(vv: $6943 : bb: V)result: -> total clause0<6982,6984,6983,6985> : clause0std/core/hnd/clause0: (V, (E, V) -> V, E, V) -> V<bb: V,hh: (E, V) -> V,ee: E,rr: V> Clause0std/core/hnd/Clause0: forall<a,b,e,c> (clause : (marker<e,c>, ev<b>) -> e a) -> clause0<a,b,e,c>(fnfn: (marker<$6944,$6946>, ev<$6945>) -> $6944 $6943(_m,_ev){ vv: $6943 }) -pub fun clause-never0std/core/hnd/clause-never0: forall<a,e,b,c> (op : () -> e c) -> clause0<a,b,e,c>( opop: () -> $7000 $7002 : () -> ee: E rr: V )result: -> total clause0<7053,7055,7054,7056> : clause0std/core/hnd/clause0: (V, (E, V) -> V, E, V) -> V<bb: V,hh: (E, V) -> V,ee: E,rr: V> +pub fun clause-never0std/core/hnd/clause-never0: forall<a,e,b,c> (op : () -> e c) -> clause0<a,b,e,c>( opop: () -> $7000 $7002 : () -> ee: E rr: V )result: -> total clause0<7053,7055,7054,7056> : clause0std/core/hnd/clause0: (V, (E, V) -> V, E, V) -> V<bb: V,hh: (E, V) -> V,ee: E,rr: V> Clause0std/core/hnd/Clause0: forall<a,b,e,c> (clause : (marker<e,c>, ev<b>) -> e a) -> clause0<a,b,e,c>(fnfn: (m : marker<$7000,$7002>, ev<$7001>) -> $7000 $6999(mm: marker<$7000,$7002>,_ev){ yield-to-finalstd/core/hnd/yield-to-final: (m : marker<$7000,$7002>, clause : ((resume-result<$6999,$7002>) -> $7000 $7002) -> $7000 $7002) -> $7000 $6999(mm: marker<$7000,$7002>, fnfn: ((resume-result<$6999,$7002>) -> $7000 $7002) -> $7000 $7002(_k){ opop: () -> $7000 $7002() }) }) //---------------------------------------------------------------- // 2 arguments //---------------------------------------------------------------- -abstract value type clause2std/core/hnd/clause2: (V, V, V, (E, V) -> V, E, V) -> V<a1a1: V,a2a2: V,bb: V,hh: (E, V) -> V,ee: E,rr: V> - Clause2std/core/hnd/Clause2: forall<a,b,c,d,e,a1> (clause : (marker<e,a1>, ev<d>, a, b) -> e c) -> clause2<a,b,c,d,e,a1>( clausestd/core/hnd/clause2/clause: forall<a,b,c,d,e,a1> (clause2 : clause2<a,b,c,d,e,a1>) -> ((marker<e,a1>, ev<d>, a, b) -> e c): (markerstd/core/hnd/marker: (E, V) -> V<ee: E,rr: V>, evstd/core/hnd/ev: ((E, V) -> V) -> V<hh: (E, V) -> V>, a1a1: V, a2a2: V) -> ee: E bb: V ) +abstract value type clause2std/core/hnd/clause2: (V, V, V, (E, V) -> V, E, V) -> V<a1a1: V,a2a2: V,bb: V,hh: (E, V) -> V,ee: E,rr: V> + Clause2std/core/hnd/Clause2: forall<a,b,c,d,e,a1> (clause : (marker<e,a1>, ev<d>, a, b) -> e c) -> clause2<a,b,c,d,e,a1>( clausestd/core/hnd/clause2/clause: forall<a,b,c,d,e,a1> (clause2 : clause2<a,b,c,d,e,a1>) -> ((marker<e,a1>, ev<d>, a, b) -> e c): (markerstd/core/hnd/marker: (E, V) -> V<ee: E,rr: V>, evstd/core/hnd/ev: ((E, V) -> V) -> V<hh: (E, V) -> V>, a1a1: V, a2a2: V) -> ee: E bb: V ) -fun under2std/core/hnd/under2: forall<a,b,c,e,d> (ev : ev<d>, op : (a, b) -> e c, x1 : a, x2 : b) -> e c( evev: ev<$7074> : evstd/core/hnd/ev: ((E, V) -> V) -> V<hh: (E, V) -> V>, opop: ($7070, $7071) -> $7073 $7072 : (a1a1: V,a2a2: V) -> ee: E bb: V, x1x1: $7070 : a1a1: V, x2x2: $7071 : a2a2: V )result: -> 7167 7166 : ee: E bb: V +fun under2std/core/hnd/under2: forall<a,b,c,e,d> (ev : ev<d>, op : (a, b) -> e c, x1 : a, x2 : b) -> e c( evev: ev<$7074> : evstd/core/hnd/ev: ((E, V) -> V) -> V<hh: (E, V) -> V>, opop: ($7070, $7071) -> $7073 $7072 : (a1a1: V,a2a2: V) -> ee: E bb: V, x1x1: $7070 : a1a1: V, x2x2: $7071 : a2a2: V )result: -> 7167 7166 : ee: E bb: V val w0w0: evv<_7082> = evv-swap-withstd/core/hnd/evv-swap-with: (ev : ev<$7074>) -> $7073 evv<_7082>(evev: ev<$7074>) val zz: $7072 = opop: ($7070, $7071) -> $7073 $7072(x1x1: $7070,x2x2: $7071) evv-setstd/core/hnd/evv-set: (w : evv<_7082>) -> $7073 ()(w0w0: evv<_7082>) - if yieldingstd/core/hnd/yielding: () -> $7073 bool() returnreturn: $7072 yield-contstd/core/hnd/yield-cont: (f : forall<a> ((a) -> $7073 $7072, a) -> $7073 $7072) -> $7073 $7072( fnfn: forall<a,b,e> (cont : (a) -> e b, res : a) -> e b(contcont: ($7111) -> $7073 $7072,resres: $7111) under1std/core/hnd/under1: (ev : ev<$7074>, op : ($7111) -> $7073 $7072, x : $7111) -> $7073 $7072(evev: ev<$7074>,contcont: ($7111) -> $7073 $7072,resres: $7111) )std/core/types/Unit: () + if yieldingstd/core/hnd/yielding: () -> $7073 bool() returnreturn: $7072 yield-contstd/core/hnd/yield-cont: (f : forall<a> ((a) -> $7073 $7072, a) -> $7073 $7072) -> $7073 $7072( fnfn: forall<a,b,e> (cont : (a) -> e b, res : a) -> e b(contcont: ($7111) -> $7073 $7072,resres: $7111) under1std/core/hnd/under1: (ev : ev<$7074>, op : ($7111) -> $7073 $7072, x : $7111) -> $7073 $7072(evev: ev<$7074>,contcont: ($7111) -> $7073 $7072,resres: $7111) )std/core/types/Unit: () zz: $7072 -fun protect2std/core/hnd/protect2: forall<a,b,c,e,d> (x1 : a, x2 : b, clause : (x : a, x : b, k : (c) -> e d) -> e d, k : (resume-result<c,d>) -> e d) -> e d( x1x1: $7184 : a1a1: V, x2x2: $7185:a2a2: V, clauseclause: (x : $7184, x : $7185, k : ($7186) -> $7187 $7188) -> $7187 $7188 : (x:a1a1: V,x:a2a2: V, k: bb: V -> ee: E rr: V) -> ee: E rr: V, kk: (resume-result<$7186,$7188>) -> $7187 $7188 : resume-resultstd/core/hnd/resume-result: (V, V) -> V<bb: V,rr: V> -> ee: E rr: V )result: -> 7290 7291 : ee: E rr: V - val resumedresumed: ref<global,bool> = (unsafe-ststd/core/hnd/unsafe-st: (f : () -> <st<global>|$7187> ref<global,bool>) -> $7187 (() -> $7187 ref<global,bool>){refstd/core/types/ref: (value : bool) -> <alloc<global>,read<global>,write<global>|$7187> ref<global,bool>(Falsestd/core/types/False: bool)})() +fun protect2std/core/hnd/protect2: forall<a,b,c,e,d> (x1 : a, x2 : b, clause : (x : a, x : b, k : (c) -> e d) -> e d, k : (resume-result<c,d>) -> e d) -> e d( x1x1: $7184 : a1a1: V, x2x2: $7185:a2a2: V, clauseclause: (x : $7184, x : $7185, k : ($7186) -> $7187 $7188) -> $7187 $7188 : (x:a1a1: V,x:a2a2: V, k: bb: V -> ee: E rr: V) -> ee: E rr: V, kk: (resume-result<$7186,$7188>) -> $7187 $7188 : resume-resultstd/core/hnd/resume-result: (V, V) -> V<bb: V,rr: V> -> ee: E rr: V )result: -> 7290 7291 : ee: E rr: V + val resumedresumed: ref<global,bool> = (unsafe-ststd/core/hnd/unsafe-st: (f : () -> <st<global>|$7187> ref<global,bool>) -> $7187 (() -> $7187 ref<global,bool>){refstd/core/types/ref: (value : bool) -> <alloc<global>,read<global>,write<global>|$7187> ref<global,bool>(Falsestd/core/types/False: bool)})() fun kprotectkprotect: (ret : $7186) -> $7187 $7188(retret: $7186)result: -> $7187 $7188 - (unsafe-ststd/core/hnd/unsafe-st: (f : () -> <st<global>|$7187> ()) -> $7187 (() -> $7187 ()){ resumedresumed: ref<global,bool> :=std/core/types/set: (ref : ref<global,bool>, assigned : bool) -> <write<global>,alloc<global>,read<global>|$7187> () Truestd/core/types/True: bool })() + (unsafe-ststd/core/hnd/unsafe-st: (f : () -> <st<global>|$7187> ()) -> $7187 (() -> $7187 ()){ resumedresumed: ref<global,bool> :=std/core/types/set: (ref : ref<global,bool>, assigned : bool) -> <write<global>,alloc<global>,read<global>|$7187> () Truestd/core/types/True: bool })() kk: (resume-result<$7186,$7188>) -> $7187 $7188(Deepstd/core/hnd/Deep: forall<a,b> (result : a) -> resume-result<a,b>(retret: $7186)) val resres: $7188 = clauseclause: (x : $7184, x : $7185, k : ($7186) -> $7187 $7188) -> $7187 $7188(x1x1: $7184,x2x2: $7185,kprotectkprotect: (ret : $7186) -> $7187 $7188) protect-promptstd/core/hnd/protect-prompt: (resumed : ref<global,bool>, k : (resume-result<$7186,$7188>) -> $7187 $7188, res : $7188) -> $7187 $7188(resumedresumed: ref<global,bool>,kk: (resume-result<$7186,$7188>) -> $7187 $7188,resres: $7188) -pub fun clause-control2std/core/hnd/clause-control2: forall<a,b,c,e,d,a1> (clause : (x1 : a, x2 : b, k : (c) -> e a1) -> e a1) -> clause2<a,b,c,d,e,a1>( clauseclause: (x1 : $7307, x2 : $7308, k : ($7309) -> $7310 $7312) -> $7310 $7312 : (x1:a1a1: V, x2:a2a2: V, k: bb: V -> ee: E rr: V) -> ee: E rr: V )result: -> total clause2<7393,7394,7395,7397,7396,7398> : clause2std/core/hnd/clause2: (V, V, V, (E, V) -> V, E, V) -> V<a1a1: V,a2a2: V,bb: V,hh: (E, V) -> V,ee: E,rr: V> +pub fun clause-control2std/core/hnd/clause-control2: forall<a,b,c,e,d,a1> (clause : (x1 : a, x2 : b, k : (c) -> e a1) -> e a1) -> clause2<a,b,c,d,e,a1>( clauseclause: (x1 : $7307, x2 : $7308, k : ($7309) -> $7310 $7312) -> $7310 $7312 : (x1:a1a1: V, x2:a2a2: V, k: bb: V -> ee: E rr: V) -> ee: E rr: V )result: -> total clause2<7393,7394,7395,7397,7396,7398> : clause2std/core/hnd/clause2: (V, V, V, (E, V) -> V, E, V) -> V<a1a1: V,a2a2: V,bb: V,hh: (E, V) -> V,ee: E,rr: V> Clause2std/core/hnd/Clause2: forall<a,b,c,d,e,a1> (clause : (marker<e,a1>, ev<d>, a, b) -> e c) -> clause2<a,b,c,d,e,a1>(fnfn: (m : marker<$7310,$7312>, ev<$7311>, x1 : $7307, x2 : $7308) -> $7310 $7309(mm: marker<$7310,$7312>,_ev,x1x1: $7307,x2x2: $7308){ yield-tostd/core/hnd/yield-to: (m : marker<$7310,$7312>, clause : ((resume-result<$7309,$7312>) -> $7310 $7312) -> $7310 $7312) -> $7310 $7309(mm: marker<$7310,$7312>, fnfn: (k : (resume-result<$7309,$7312>) -> $7310 $7312) -> $7310 $7312(kk: (resume-result<$7309,$7312>) -> $7310 $7312){ protect2std/core/hnd/protect2: (x1 : $7307, x2 : $7308, clause : (x : $7307, x : $7308, k : ($7309) -> $7310 $7312) -> $7310 $7312, k : (resume-result<$7309,$7312>) -> $7310 $7312) -> $7310 $7312(x1x1: $7307,x2x2: $7308,clauseclause: (x1 : $7307, x2 : $7308, k : ($7309) -> $7310 $7312) -> $7310 $7312,kk: (resume-result<$7309,$7312>) -> $7310 $7312) }) }) -pub fun clause-control-raw2std/core/hnd/clause-control-raw2: forall<a,b,c,e,e1,d,a1> (op : (x1 : a, x2 : b, r : resume-context<c,e,e1,a1>) -> e a1) -> clause2<a,b,c,d,e,a1>( opop: (x1 : $7418, x2 : $7419, r : resume-context<$7420,$7421,$7422,$7424>) -> $7421 $7424 : (x1:a1a1: V, x2:a2a2: V, r: resume-contextstd/core/hnd/resume-context: (V, E, E, V) -> V<bb: V,ee: E,e0e0: E,rr: V>) -> ee: E rr: V )result: -> total clause2<7508,7509,7510,7513,7511,7514> : clause2std/core/hnd/clause2: (V, V, V, (E, V) -> V, E, V) -> V<a1a1: V,a2a2: V,bb: V,hh: (E, V) -> V,ee: E,rr: V> +pub fun clause-control-raw2std/core/hnd/clause-control-raw2: forall<a,b,c,e,e1,d,a1> (op : (x1 : a, x2 : b, r : resume-context<c,e,e1,a1>) -> e a1) -> clause2<a,b,c,d,e,a1>( opop: (x1 : $7418, x2 : $7419, r : resume-context<$7420,$7421,$7422,$7424>) -> $7421 $7424 : (x1:a1a1: V, x2:a2a2: V, r: resume-contextstd/core/hnd/resume-context: (V, E, E, V) -> V<bb: V,ee: E,e0e0: E,rr: V>) -> ee: E rr: V )result: -> total clause2<7508,7509,7510,7513,7511,7514> : clause2std/core/hnd/clause2: (V, V, V, (E, V) -> V, E, V) -> V<a1a1: V,a2a2: V,bb: V,hh: (E, V) -> V,ee: E,rr: V> Clause2std/core/hnd/Clause2: forall<a,b,c,d,e,a1> (clause : (marker<e,a1>, ev<d>, a, b) -> e c) -> clause2<a,b,c,d,e,a1>(fnfn: (m : marker<$7421,$7424>, ev<$7423>, x1 : $7418, x2 : $7419) -> $7421 $7420(mm: marker<$7421,$7424>,_ev,x1x1: $7418,x2x2: $7419){ yield-tostd/core/hnd/yield-to: (m : marker<$7421,$7424>, clause : ((resume-result<$7420,$7424>) -> $7421 $7424) -> $7421 $7424) -> $7421 $7420(mm: marker<$7421,$7424>, fnfn: (k : (resume-result<$7420,$7424>) -> $7421 $7424) -> $7421 $7424(kk: (resume-result<$7420,$7424>) -> $7421 $7424){ opop: (x1 : $7418, x2 : $7419, r : resume-context<$7420,$7421,$7422,$7424>) -> $7421 $7424(x1x1: $7418,x2x2: $7419,Resume-contextstd/core/hnd/Resume-context: forall<a,e,e1,b> (k : (resume-result<a,b>) -> e b) -> resume-context<a,e,e1,b>(kk: (resume-result<$7420,$7424>) -> $7421 $7424)) } ) }) -pub fun clause-tail2std/core/hnd/clause-tail2: forall<e,a,b,c,d,a1> (op : (c, d) -> e a1) -> clause2<c,d,a1,b,e,a><ee: E,rr: V,hh: (E, V) -> V,a1a1: V,a2a2: V,bb: V>(opop: ($7540, $7541) -> $7537 $7542 : (a1a1: V,a2a2: V) -> ee: E bb: V)result: -> total clause2<7614,7615,7616,7613,7611,7612> : clause2std/core/hnd/clause2: (V, V, V, (E, V) -> V, E, V) -> V<a1a1: V,a2a2: V,bb: V,hh: (E, V) -> V,ee: E,rr: V> +pub fun clause-tail2std/core/hnd/clause-tail2: forall<e,a,b,c,d,a1> (op : (c, d) -> e a1) -> clause2<c,d,a1,b,e,a><ee: E,rr: V,hh: (E, V) -> V,a1a1: V,a2a2: V,bb: V>(opop: ($7540, $7541) -> $7537 $7542 : (a1a1: V,a2a2: V) -> ee: E bb: V)result: -> total clause2<7614,7615,7616,7613,7611,7612> : clause2std/core/hnd/clause2: (V, V, V, (E, V) -> V, E, V) -> V<a1a1: V,a2a2: V,bb: V,hh: (E, V) -> V,ee: E,rr: V> Clause2std/core/hnd/Clause2: forall<a,b,c,d,e,a1> (clause : (marker<e,a1>, ev<d>, a, b) -> e c) -> clause2<a,b,c,d,e,a1>(fnfn: (m : marker<$7537,$7538>, ev : ev<$7539>, x1 : $7540, x2 : $7541) -> $7537 $7542(mm: marker<$7537,$7538>,evev: ev<$7539>,x1x1: $7540,x2x2: $7541){ under2std/core/hnd/under2: (ev : ev<$7539>, op : ($7540, $7541) -> $7537 $7542, x1 : $7540, x2 : $7541) -> $7537 $7542(evev: ev<$7539>,opop: ($7540, $7541) -> $7537 $7542,x1x1: $7540,x2x2: $7541) }) -pub fun clause-tail-noop2std/core/hnd/clause-tail-noop2: forall<e,a,b,c,d,a1> (op : (c, d) -> e a1) -> clause2<c,d,a1,b,e,a><ee: E,rr: V,hh: (E, V) -> V,a1a1: V,a2a2: V,bb: V>(opop: ($7639, $7640) -> $7636 $7641 : (a1a1: V,a2a2: V) -> ee: E bb: V)result: -> total clause2<7696,7697,7698,7695,7693,7694> : clause2std/core/hnd/clause2: (V, V, V, (E, V) -> V, E, V) -> V<a1a1: V,a2a2: V,bb: V,hh: (E, V) -> V,ee: E,rr: V> +pub fun clause-tail-noop2std/core/hnd/clause-tail-noop2: forall<e,a,b,c,d,a1> (op : (c, d) -> e a1) -> clause2<c,d,a1,b,e,a><ee: E,rr: V,hh: (E, V) -> V,a1a1: V,a2a2: V,bb: V>(opop: ($7639, $7640) -> $7636 $7641 : (a1a1: V,a2a2: V) -> ee: E bb: V)result: -> total clause2<7696,7697,7698,7695,7693,7694> : clause2std/core/hnd/clause2: (V, V, V, (E, V) -> V, E, V) -> V<a1a1: V,a2a2: V,bb: V,hh: (E, V) -> V,ee: E,rr: V> Clause2std/core/hnd/Clause2: forall<a,b,c,d,e,a1> (clause : (marker<e,a1>, ev<d>, a, b) -> e c) -> clause2<a,b,c,d,e,a1>(fnfn: (marker<$7636,$7637>, ev<$7638>, x1 : $7639, x2 : $7640) -> $7636 $7641(_m,_ev,x1x1: $7639,x2x2: $7640){ opop: ($7639, $7640) -> $7636 $7641(x1x1: $7639,x2x2: $7640) }) -pub inline fun @perform2( evxevx: ev<$7722> : evstd/core/hnd/ev: ((E, V) -> V) -> V<hh: (E, V) -> V>, opop: forall<e,a> ($7722<e,a>) -> clause2<$7718,$7719,$7720,$7722,e,a> : (forall<e1e1: E,rr: V> hh: (E, V) -> V<e1e1: E,rr: V> -> clause2std/core/hnd/clause2: (V, V, V, (E, V) -> V, E, V) -> V<aa: V,bb: V,cc: V,hh: (E, V) -> V,e1e1: E,rr: V>), xx: $7718 : aa: V, yy: $7719 : bb: V )result: -> 7817 7816 : ee: E cc: V +pub inline fun @perform2( evxevx: ev<$7722> : evstd/core/hnd/ev: ((E, V) -> V) -> V<hh: (E, V) -> V>, opop: forall<e,a> ($7722<e,a>) -> clause2<$7718,$7719,$7720,$7722,e,a> : (forall<e1e1: E,rr: V> hh: (E, V) -> V<e1e1: E,rr: V> -> clause2std/core/hnd/clause2: (V, V, V, (E, V) -> V, E, V) -> V<aa: V,bb: V,cc: V,hh: (E, V) -> V,e1e1: E,rr: V>), xx: $7718 : aa: V, yy: $7719 : bb: V )result: -> 7817 7816 : ee: E cc: V match evxevx: ev<$7722> Evstd/core/hnd/Ev: forall<a,e,b> (htag : htag<a>, marker : marker<e,b>, hnd : a<e,b>, hevv : evv<e>) -> ev<a>(_tag,mm: marker<$7728,$7729>,hh: $7722<$7728,$7729>,_w) -> match hh: $7722<$7728,$7729>.opop: ($7722<$7728,$7729>) -> $7721 clause2<$7718,$7719,$7720,$7722,$7728,$7729> Clause2std/core/hnd/Clause2: forall<a,b,c,d,e,a1> (clause : (marker<e,a1>, ev<d>, a, b) -> e c) -> clause2<a,b,c,d,e,a1>(ff: (marker<$7728,$7729>, ev<$7722>, $7718, $7719) -> $7728 $7720) -> cast-clause2std/core/hnd/cast-clause2: (f : (marker<$7728,$7729>, ev<$7722>, $7718, $7719) -> $7728 $7720) -> $7721 ((marker<$7728,$7729>, ev<$7722>, $7718, $7719) -> $7721 $7720)(ff: (marker<$7728,$7729>, ev<$7722>, $7718, $7719) -> $7728 $7720)(mm: marker<$7728,$7729>,evxevx: ev<$7722>,xx: $7718,yy: $7719) -pub fun clause-never2std/core/hnd/clause-never2: forall<a,b,c,e,d,a1> (op : (a, b) -> e a1) -> clause2<a,b,c,d,e,a1>( opop: ($7836, $7837) -> $7839 $7841 : (a1a1: V,a2a2: V) -> ee: E rr: V )result: -> total clause2<7908,7909,7910,7912,7911,7913> : clause2std/core/hnd/clause2: (V, V, V, (E, V) -> V, E, V) -> V<a1a1: V,a2a2: V,bb: V,hh: (E, V) -> V,ee: E,rr: V> +pub fun clause-never2std/core/hnd/clause-never2: forall<a,b,c,e,d,a1> (op : (a, b) -> e a1) -> clause2<a,b,c,d,e,a1>( opop: ($7836, $7837) -> $7839 $7841 : (a1a1: V,a2a2: V) -> ee: E rr: V )result: -> total clause2<7908,7909,7910,7912,7911,7913> : clause2std/core/hnd/clause2: (V, V, V, (E, V) -> V, E, V) -> V<a1a1: V,a2a2: V,bb: V,hh: (E, V) -> V,ee: E,rr: V> Clause2std/core/hnd/Clause2: forall<a,b,c,d,e,a1> (clause : (marker<e,a1>, ev<d>, a, b) -> e c) -> clause2<a,b,c,d,e,a1>(fnfn: (m : marker<$7839,$7841>, ev<$7840>, x1 : $7836, x2 : $7837) -> $7839 $7838(mm: marker<$7839,$7841>,_ev,x1x1: $7836,x2x2: $7837){ yield-to-finalstd/core/hnd/yield-to-final: (m : marker<$7839,$7841>, clause : ((resume-result<$7838,$7841>) -> $7839 $7841) -> $7839 $7841) -> $7839 $7838(mm: marker<$7839,$7841>, fnfn: ((resume-result<$7838,$7841>) -> $7839 $7841) -> $7839 $7841(_k){ opop: ($7836, $7837) -> $7839 $7841(x1x1: $7836,x2x2: $7837) }) }) @@ -765,58 +765,58 @@ //---------------------------------------------------------------- // For interal use -fun xperform1std/core/hnd/xperform1: forall<a,b,e,c> (ev : ev<c>, op : forall<e1,d> (c<e1,d>) -> clause1<a,b,c,e1,d>, x : a) -> e b( evev: ev<$7936> : evstd/core/hnd/ev: ((E, V) -> V) -> V<hh: (E, V) -> V>, opop: forall<e,a> ($7936<e,a>) -> clause1<$7933,$7934,$7936,e,a> : (forall<e1e1: E,rr: V> hh: (E, V) -> V<e1e1: E,rr: V> -> clause1std/core/hnd/clause1: (V, V, (E, V) -> V, E, V) -> V<aa: V,bb: V,hh: (E, V) -> V,e1e1: E,rr: V>), xx: $7933 : aa: V )result: -> 8020 8019 : ee: E bb: V +fun xperform1std/core/hnd/xperform1: forall<a,b,e,c> (ev : ev<c>, op : forall<e1,d> (c<e1,d>) -> clause1<a,b,c,e1,d>, x : a) -> e b( evev: ev<$7936> : evstd/core/hnd/ev: ((E, V) -> V) -> V<hh: (E, V) -> V>, opop: forall<e,a> ($7936<e,a>) -> clause1<$7933,$7934,$7936,e,a> : (forall<e1e1: E,rr: V> hh: (E, V) -> V<e1e1: E,rr: V> -> clause1std/core/hnd/clause1: (V, V, (E, V) -> V, E, V) -> V<aa: V,bb: V,hh: (E, V) -> V,e1e1: E,rr: V>), xx: $7933 : aa: V )result: -> 8020 8019 : ee: E bb: V match evev: ev<$7936> Evstd/core/hnd/Ev: forall<a,e,b> (htag : htag<a>, marker : marker<e,b>, hnd : a<e,b>, hevv : evv<e>) -> ev<a>(_tag,mm: marker<$7942,$7943>,hh: $7936<$7942,$7943>,_w) -> match hh: $7936<$7942,$7943>.opop: ($7936<$7942,$7943>) -> $7935 clause1<$7933,$7934,$7936,$7942,$7943> Clause1std/core/hnd/Clause1: forall<a,b,c,e,d> (clause : (marker<e,d>, ev<c>, a) -> e b) -> clause1<a,b,c,e,d>(ff: (marker<$7942,$7943>, ev<$7936>, $7933) -> $7942 $7934) -> cast-clause1std/core/hnd/cast-clause1: (f : (marker<$7942,$7943>, ev<$7936>, $7933) -> $7942 $7934) -> $7935 ((marker<$7942,$7943>, ev<$7936>, $7933) -> $7935 $7934)(ff: (marker<$7942,$7943>, ev<$7936>, $7933) -> $7942 $7934)(mm: marker<$7942,$7943>,evev: ev<$7936>,xx: $7933) -pub fun clause-control-raw3std/core/hnd/clause-control-raw3: forall<a,b,c,d,e,e1,a1,b1> (op : (x1 : a, x2 : b, x3 : c, r : resume-context<d,e,e1,b1>) -> e b1) -> clause1<(a, b, c),d,a1,e,b1>( opop: (x1 : $8036, x2 : $8037, x3 : $8038, r : resume-context<$8039,$8040,$8041,$8043>) -> $8040 $8043 : (x1:a1a1: V, x2:a2a2: V, x3:a3a3: V, r: resume-contextstd/core/hnd/resume-context: (V, E, E, V) -> V<bb: V,ee: E,e0e0: E,rr: V>) -> ee: E rr: V )result: -> total clause1<(8115, 8116, 8117),8118,8121,8119,8122> : clause1std/core/hnd/clause1: (V, V, (E, V) -> V, E, V) -> V<(std/core/types/tuple3: (V, V, V) -> Va1a1: V,a2a2: V,a3a3: V),bb: V,hh: (E, V) -> V,ee: E,rr: V> - clause-control-raw1std/core/hnd/clause-control-raw1: (op : (x : ($8036, $8037, $8038), r : resume-context<$8039,$8040,$8041,$8043>) -> $8040 $8043) -> clause1<($8036, $8037, $8038),$8039,$8042,$8040,$8043>( fnfn: (($8036, $8037, $8038), r : resume-context<$8039,$8040,$8041,$8043>) -> $8040 $8043((std/core/types/Tuple3: forall<a,b,c> (fst : a, snd : b, thd : c) -> (a, b, c)x1x1: $8036,x2x2: $8037,x3x3: $8038)std/core/types/Tuple3: forall<a,b,c> (fst : a, snd : b, thd : c) -> (a, b, c),rr: resume-context<$8039,$8040,$8041,$8043>){ opop: (x1 : $8036, x2 : $8037, x3 : $8038, r : resume-context<$8039,$8040,$8041,$8043>) -> $8040 $8043(x1x1: $8036,x2x2: $8037,x3x3: $8038,rr: resume-context<$8039,$8040,$8041,$8043>) } ) +pub fun clause-control-raw3std/core/hnd/clause-control-raw3: forall<a,b,c,d,e,e1,a1,b1> (op : (x1 : a, x2 : b, x3 : c, r : resume-context<d,e,e1,b1>) -> e b1) -> clause1<(a, b, c),d,a1,e,b1>( opop: (x1 : $8036, x2 : $8037, x3 : $8038, r : resume-context<$8039,$8040,$8041,$8043>) -> $8040 $8043 : (x1:a1a1: V, x2:a2a2: V, x3:a3a3: V, r: resume-contextstd/core/hnd/resume-context: (V, E, E, V) -> V<bb: V,ee: E,e0e0: E,rr: V>) -> ee: E rr: V )result: -> total clause1<(8115, 8116, 8117),8118,8121,8119,8122> : clause1std/core/hnd/clause1: (V, V, (E, V) -> V, E, V) -> V<(std/core/types/tuple3: (V, V, V) -> Va1a1: V,a2a2: V,a3a3: V),bb: V,hh: (E, V) -> V,ee: E,rr: V> + clause-control-raw1std/core/hnd/clause-control-raw1: (op : (x : ($8036, $8037, $8038), r : resume-context<$8039,$8040,$8041,$8043>) -> $8040 $8043) -> clause1<($8036, $8037, $8038),$8039,$8042,$8040,$8043>( fnfn: (($8036, $8037, $8038), r : resume-context<$8039,$8040,$8041,$8043>) -> $8040 $8043((std/core/types/Tuple3: forall<a,b,c> (fst : a, snd : b, thd : c) -> (a, b, c)x1x1: $8036,x2x2: $8037,x3x3: $8038)std/core/types/Tuple3: forall<a,b,c> (fst : a, snd : b, thd : c) -> (a, b, c),rr: resume-context<$8039,$8040,$8041,$8043>){ opop: (x1 : $8036, x2 : $8037, x3 : $8038, r : resume-context<$8039,$8040,$8041,$8043>) -> $8040 $8043(x1x1: $8036,x2x2: $8037,x3x3: $8038,rr: resume-context<$8039,$8040,$8041,$8043>) } ) -pub fun clause-control3std/core/hnd/clause-control3: forall<a,b,c,d,e,a1,b1> (op : (x1 : a, x2 : b, x3 : c, k : (d) -> e b1) -> e b1) -> clause1<(a, b, c),d,a1,e,b1>( opop: (x1 : $8148, x2 : $8149, x3 : $8150, k : ($8151) -> $8152 $8154) -> $8152 $8154 : (x1:a1a1: V, x2:a2a2: V, x3:a3a3: V, k: bb: V -> ee: E rr: V) -> ee: E rr: V )result: -> total clause1<(8219, 8220, 8221),8222,8224,8223,8225> : clause1std/core/hnd/clause1: (V, V, (E, V) -> V, E, V) -> V<(std/core/types/tuple3: (V, V, V) -> Va1a1: V,a2a2: V,a3a3: V),bb: V,hh: (E, V) -> V,ee: E,rr: V> - clause-control1std/core/hnd/clause-control1: (clause : (x : ($8148, $8149, $8150), k : ($8151) -> $8152 $8154) -> $8152 $8154) -> clause1<($8148, $8149, $8150),$8151,$8153,$8152,$8154>( fnfn: (($8148, $8149, $8150), k : ($8151) -> $8152 $8154) -> $8152 $8154((std/core/types/Tuple3: forall<a,b,c> (fst : a, snd : b, thd : c) -> (a, b, c)x1x1: $8148,x2x2: $8149,x3x3: $8150)std/core/types/Tuple3: forall<a,b,c> (fst : a, snd : b, thd : c) -> (a, b, c),kk: ($8151) -> $8152 $8154){ opop: (x1 : $8148, x2 : $8149, x3 : $8150, k : ($8151) -> $8152 $8154) -> $8152 $8154(x1x1: $8148,x2x2: $8149,x3x3: $8150,kk: ($8151) -> $8152 $8154) } ) +pub fun clause-control3std/core/hnd/clause-control3: forall<a,b,c,d,e,a1,b1> (op : (x1 : a, x2 : b, x3 : c, k : (d) -> e b1) -> e b1) -> clause1<(a, b, c),d,a1,e,b1>( opop: (x1 : $8148, x2 : $8149, x3 : $8150, k : ($8151) -> $8152 $8154) -> $8152 $8154 : (x1:a1a1: V, x2:a2a2: V, x3:a3a3: V, k: bb: V -> ee: E rr: V) -> ee: E rr: V )result: -> total clause1<(8219, 8220, 8221),8222,8224,8223,8225> : clause1std/core/hnd/clause1: (V, V, (E, V) -> V, E, V) -> V<(std/core/types/tuple3: (V, V, V) -> Va1a1: V,a2a2: V,a3a3: V),bb: V,hh: (E, V) -> V,ee: E,rr: V> + clause-control1std/core/hnd/clause-control1: (clause : (x : ($8148, $8149, $8150), k : ($8151) -> $8152 $8154) -> $8152 $8154) -> clause1<($8148, $8149, $8150),$8151,$8153,$8152,$8154>( fnfn: (($8148, $8149, $8150), k : ($8151) -> $8152 $8154) -> $8152 $8154((std/core/types/Tuple3: forall<a,b,c> (fst : a, snd : b, thd : c) -> (a, b, c)x1x1: $8148,x2x2: $8149,x3x3: $8150)std/core/types/Tuple3: forall<a,b,c> (fst : a, snd : b, thd : c) -> (a, b, c),kk: ($8151) -> $8152 $8154){ opop: (x1 : $8148, x2 : $8149, x3 : $8150, k : ($8151) -> $8152 $8154) -> $8152 $8154(x1x1: $8148,x2x2: $8149,x3x3: $8150,kk: ($8151) -> $8152 $8154) } ) -pub fun clause-tail3std/core/hnd/clause-tail3: forall<e,a,b,c,d,a1,b1> (op : (c, d, a1) -> e b1) -> clause1<(c, d, a1),b1,b,e,a><ee: E,rr: V,hh: (E, V) -> V,a1a1: V,a2a2: V,a3a3: V,bb: V>(opop: ($8251, $8252, $8253) -> $8248 $8254 : (a1a1: V,a2a2: V,a3a3: V) -> ee: E bb: V)result: -> total clause1<(8321, 8322, 8323),8324,8320,8318,8319> : clause1std/core/hnd/clause1: (V, V, (E, V) -> V, E, V) -> V<(std/core/types/tuple3: (V, V, V) -> Va1a1: V,a2a2: V,a3a3: V),bb: V,hh: (E, V) -> V,ee: E,rr: V> - clause-tail1std/core/hnd/clause-tail1: (op : (($8251, $8252, $8253)) -> $8248 $8254) -> clause1<($8251, $8252, $8253),$8254,$8250,$8248,$8249>( fnfn: (($8251, $8252, $8253)) -> $8248 $8254((std/core/types/Tuple3: forall<a,b,c> (fst : a, snd : b, thd : c) -> (a, b, c)x1x1: $8251,x2x2: $8252,x3x3: $8253)std/core/types/Tuple3: forall<a,b,c> (fst : a, snd : b, thd : c) -> (a, b, c) ){ opop: ($8251, $8252, $8253) -> $8248 $8254(x1x1: $8251,x2x2: $8252,x3x3: $8253) } ) +pub fun clause-tail3std/core/hnd/clause-tail3: forall<e,a,b,c,d,a1,b1> (op : (c, d, a1) -> e b1) -> clause1<(c, d, a1),b1,b,e,a><ee: E,rr: V,hh: (E, V) -> V,a1a1: V,a2a2: V,a3a3: V,bb: V>(opop: ($8251, $8252, $8253) -> $8248 $8254 : (a1a1: V,a2a2: V,a3a3: V) -> ee: E bb: V)result: -> total clause1<(8321, 8322, 8323),8324,8320,8318,8319> : clause1std/core/hnd/clause1: (V, V, (E, V) -> V, E, V) -> V<(std/core/types/tuple3: (V, V, V) -> Va1a1: V,a2a2: V,a3a3: V),bb: V,hh: (E, V) -> V,ee: E,rr: V> + clause-tail1std/core/hnd/clause-tail1: (op : (($8251, $8252, $8253)) -> $8248 $8254) -> clause1<($8251, $8252, $8253),$8254,$8250,$8248,$8249>( fnfn: (($8251, $8252, $8253)) -> $8248 $8254((std/core/types/Tuple3: forall<a,b,c> (fst : a, snd : b, thd : c) -> (a, b, c)x1x1: $8251,x2x2: $8252,x3x3: $8253)std/core/types/Tuple3: forall<a,b,c> (fst : a, snd : b, thd : c) -> (a, b, c) ){ opop: ($8251, $8252, $8253) -> $8248 $8254(x1x1: $8251,x2x2: $8252,x3x3: $8253) } ) -pub fun clause-tail-noop3std/core/hnd/clause-tail-noop3: forall<e,a,b,c,d,a1,b1> (op : (c, d, a1) -> e b1) -> clause1<(c, d, a1),b1,b,e,a><ee: E,rr: V,hh: (E, V) -> V,a1a1: V,a2a2: V,a3a3: V,bb: V>(opop: ($8350, $8351, $8352) -> $8347 $8353 : (a1a1: V,a2a2: V,a3a3: V) -> ee: E bb: V)result: -> total clause1<(8420, 8421, 8422),8423,8419,8417,8418> : clause1std/core/hnd/clause1: (V, V, (E, V) -> V, E, V) -> V<(std/core/types/tuple3: (V, V, V) -> Va1a1: V,a2a2: V,a3a3: V),bb: V,hh: (E, V) -> V,ee: E,rr: V> - clause-tail-noop1std/core/hnd/clause-tail-noop1: (op : (($8350, $8351, $8352)) -> $8347 $8353) -> clause1<($8350, $8351, $8352),$8353,$8349,$8347,$8348>( fnfn: (($8350, $8351, $8352)) -> $8347 $8353((std/core/types/Tuple3: forall<a,b,c> (fst : a, snd : b, thd : c) -> (a, b, c)x1x1: $8350,x2x2: $8351,x3x3: $8352)std/core/types/Tuple3: forall<a,b,c> (fst : a, snd : b, thd : c) -> (a, b, c)){ opop: ($8350, $8351, $8352) -> $8347 $8353(x1x1: $8350,x2x2: $8351,x3x3: $8352) } ) +pub fun clause-tail-noop3std/core/hnd/clause-tail-noop3: forall<e,a,b,c,d,a1,b1> (op : (c, d, a1) -> e b1) -> clause1<(c, d, a1),b1,b,e,a><ee: E,rr: V,hh: (E, V) -> V,a1a1: V,a2a2: V,a3a3: V,bb: V>(opop: ($8350, $8351, $8352) -> $8347 $8353 : (a1a1: V,a2a2: V,a3a3: V) -> ee: E bb: V)result: -> total clause1<(8420, 8421, 8422),8423,8419,8417,8418> : clause1std/core/hnd/clause1: (V, V, (E, V) -> V, E, V) -> V<(std/core/types/tuple3: (V, V, V) -> Va1a1: V,a2a2: V,a3a3: V),bb: V,hh: (E, V) -> V,ee: E,rr: V> + clause-tail-noop1std/core/hnd/clause-tail-noop1: (op : (($8350, $8351, $8352)) -> $8347 $8353) -> clause1<($8350, $8351, $8352),$8353,$8349,$8347,$8348>( fnfn: (($8350, $8351, $8352)) -> $8347 $8353((std/core/types/Tuple3: forall<a,b,c> (fst : a, snd : b, thd : c) -> (a, b, c)x1x1: $8350,x2x2: $8351,x3x3: $8352)std/core/types/Tuple3: forall<a,b,c> (fst : a, snd : b, thd : c) -> (a, b, c)){ opop: ($8350, $8351, $8352) -> $8347 $8353(x1x1: $8350,x2x2: $8351,x3x3: $8352) } ) -pub fun clause-never3std/core/hnd/clause-never3: forall<a,b,c,d,e,a1,b1> (op : (a, b, c) -> e b1) -> clause1<(a, b, c),d,a1,e,b1>( opop: ($8446, $8447, $8448) -> $8450 $8452 : (a1a1: V,a2a2: V,a3a3: V) -> ee: E rr: V )result: -> total clause1<(8516, 8517, 8518),8519,8521,8520,8522> : clause1std/core/hnd/clause1: (V, V, (E, V) -> V, E, V) -> V<(std/core/types/tuple3: (V, V, V) -> Va1a1: V,a2a2: V,a3a3: V),bb: V,hh: (E, V) -> V,ee: E,rr: V> - clause-never1std/core/hnd/clause-never1: (op : (($8446, $8447, $8448)) -> $8450 $8452) -> clause1<($8446, $8447, $8448),$8449,$8451,$8450,$8452>(fnfn: (($8446, $8447, $8448)) -> $8450 $8452((std/core/types/Tuple3: forall<a,b,c> (fst : a, snd : b, thd : c) -> (a, b, c)x1x1: $8446,x2x2: $8447,x3x3: $8448)std/core/types/Tuple3: forall<a,b,c> (fst : a, snd : b, thd : c) -> (a, b, c)){ opop: ($8446, $8447, $8448) -> $8450 $8452(x1x1: $8446,x2x2: $8447,x3x3: $8448) } ) +pub fun clause-never3std/core/hnd/clause-never3: forall<a,b,c,d,e,a1,b1> (op : (a, b, c) -> e b1) -> clause1<(a, b, c),d,a1,e,b1>( opop: ($8446, $8447, $8448) -> $8450 $8452 : (a1a1: V,a2a2: V,a3a3: V) -> ee: E rr: V )result: -> total clause1<(8516, 8517, 8518),8519,8521,8520,8522> : clause1std/core/hnd/clause1: (V, V, (E, V) -> V, E, V) -> V<(std/core/types/tuple3: (V, V, V) -> Va1a1: V,a2a2: V,a3a3: V),bb: V,hh: (E, V) -> V,ee: E,rr: V> + clause-never1std/core/hnd/clause-never1: (op : (($8446, $8447, $8448)) -> $8450 $8452) -> clause1<($8446, $8447, $8448),$8449,$8451,$8450,$8452>(fnfn: (($8446, $8447, $8448)) -> $8450 $8452((std/core/types/Tuple3: forall<a,b,c> (fst : a, snd : b, thd : c) -> (a, b, c)x1x1: $8446,x2x2: $8447,x3x3: $8448)std/core/types/Tuple3: forall<a,b,c> (fst : a, snd : b, thd : c) -> (a, b, c)){ opop: ($8446, $8447, $8448) -> $8450 $8452(x1x1: $8446,x2x2: $8447,x3x3: $8448) } ) -pub fun @perform3( evev: ev<$8550> : evstd/core/hnd/ev: ((E, V) -> V) -> V<hh: (E, V) -> V>, opop: forall<e,a> ($8550<e,a>) -> clause1<($8545, $8546, $8547),$8548,$8550,e,a> : (forall<e1e1: E,rr: V> hh: (E, V) -> V<e1e1: E,rr: V> -> clause1std/core/hnd/clause1: (V, V, (E, V) -> V, E, V) -> V<(std/core/types/tuple3: (V, V, V) -> Va1a1: V,a2a2: V,a3a3: V),bb: V,hh: (E, V) -> V,e1e1: E,rr: V>), x1x1: $8545 : a1a1: V, x2x2: $8546 : a2a2: V, x3x3: $8547 : a3a3: V )result: -> 8628 8627 : ee: E bb: V - xperform1std/core/hnd/xperform1: (ev : ev<$8550>, op : forall<e,a> ($8550<e,a>) -> clause1<($8545, $8546, $8547),$8548,$8550,e,a>, x : ($8545, $8546, $8547)) -> $8549 $8548(evev: ev<$8550>,opop: forall<e,a> ($8550<e,a>) -> clause1<($8545, $8546, $8547),$8548,$8550,e,a>,(std/core/types/Tuple3: forall<a,b,c> (fst : a, snd : b, thd : c) -> (a, b, c)x1x1: $8545,x2x2: $8546,x3x3: $8547)std/core/types/Tuple3: forall<a,b,c> (fst : a, snd : b, thd : c) -> (a, b, c)) +pub fun @perform3( evev: ev<$8550> : evstd/core/hnd/ev: ((E, V) -> V) -> V<hh: (E, V) -> V>, opop: forall<e,a> ($8550<e,a>) -> clause1<($8545, $8546, $8547),$8548,$8550,e,a> : (forall<e1e1: E,rr: V> hh: (E, V) -> V<e1e1: E,rr: V> -> clause1std/core/hnd/clause1: (V, V, (E, V) -> V, E, V) -> V<(std/core/types/tuple3: (V, V, V) -> Va1a1: V,a2a2: V,a3a3: V),bb: V,hh: (E, V) -> V,e1e1: E,rr: V>), x1x1: $8545 : a1a1: V, x2x2: $8546 : a2a2: V, x3x3: $8547 : a3a3: V )result: -> 8628 8627 : ee: E bb: V + xperform1std/core/hnd/xperform1: (ev : ev<$8550>, op : forall<e,a> ($8550<e,a>) -> clause1<($8545, $8546, $8547),$8548,$8550,e,a>, x : ($8545, $8546, $8547)) -> $8549 $8548(evev: ev<$8550>,opop: forall<e,a> ($8550<e,a>) -> clause1<($8545, $8546, $8547),$8548,$8550,e,a>,(std/core/types/Tuple3: forall<a,b,c> (fst : a, snd : b, thd : c) -> (a, b, c)x1x1: $8545,x2x2: $8546,x3x3: $8547)std/core/types/Tuple3: forall<a,b,c> (fst : a, snd : b, thd : c) -> (a, b, c)) -fun under3std/core/hnd/under3: forall<a,b,c,d,e,a1> (ev : ev<a1>, op : (a, b, c) -> e d, x1 : a, x2 : b, x3 : c) -> e d( evev: ev<$8655> : evstd/core/hnd/ev: ((E, V) -> V) -> V<hh: (E, V) -> V>, opop: ($8650, $8651, $8652) -> $8654 $8653 : (a1a1: V,a2a2: V,a3a3: V) -> ee: E bb: V, x1x1: $8650 : a1a1: V, x2x2: $8651 : a2a2: V, x3x3: $8652 : a3a3: V )result: -> 8754 8753 : ee: E bb: V +fun under3std/core/hnd/under3: forall<a,b,c,d,e,a1> (ev : ev<a1>, op : (a, b, c) -> e d, x1 : a, x2 : b, x3 : c) -> e d( evev: ev<$8655> : evstd/core/hnd/ev: ((E, V) -> V) -> V<hh: (E, V) -> V>, opop: ($8650, $8651, $8652) -> $8654 $8653 : (a1a1: V,a2a2: V,a3a3: V) -> ee: E bb: V, x1x1: $8650 : a1a1: V, x2x2: $8651 : a2a2: V, x3x3: $8652 : a3a3: V )result: -> 8754 8753 : ee: E bb: V val w0w0: evv<_8663> = evv-swap-withstd/core/hnd/evv-swap-with: (ev : ev<$8655>) -> $8654 evv<_8663>(evev: ev<$8655>) val zz: $8653 = opop: ($8650, $8651, $8652) -> $8654 $8653(x1x1: $8650,x2x2: $8651,x3x3: $8652) evv-setstd/core/hnd/evv-set: (w : evv<_8663>) -> $8654 ()(w0w0: evv<_8663>) - if yieldingstd/core/hnd/yielding: () -> $8654 bool() returnreturn: $8653 yield-contstd/core/hnd/yield-cont: (f : forall<a> ((a) -> $8654 $8653, a) -> $8654 $8653) -> $8654 $8653( fnfn: forall<a,b,e> (cont : (a) -> e b, res : a) -> e b(contcont: ($8693) -> $8654 $8653,resres: $8693) under1std/core/hnd/under1: (ev : ev<$8655>, op : ($8693) -> $8654 $8653, x : $8693) -> $8654 $8653(evev: ev<$8655>,contcont: ($8693) -> $8654 $8653,resres: $8693) )std/core/types/Unit: () + if yieldingstd/core/hnd/yielding: () -> $8654 bool() returnreturn: $8653 yield-contstd/core/hnd/yield-cont: (f : forall<a> ((a) -> $8654 $8653, a) -> $8654 $8653) -> $8654 $8653( fnfn: forall<a,b,e> (cont : (a) -> e b, res : a) -> e b(contcont: ($8693) -> $8654 $8653,resres: $8693) under1std/core/hnd/under1: (ev : ev<$8655>, op : ($8693) -> $8654 $8653, x : $8693) -> $8654 $8653(evev: ev<$8655>,contcont: ($8693) -> $8654 $8653,resres: $8693) )std/core/types/Unit: () zz: $8653 -pub fun clause-control4std/core/hnd/clause-control4: forall<a,b,c,d,a1,e,b1,c1> (op : (x1 : a, x2 : b, x3 : c, x4 : d, k : (a1) -> e c1) -> e c1) -> clause1<(a, b, c, d),a1,b1,e,c1>( opop: (x1 : $8774, x2 : $8775, x3 : $8776, x4 : $8777, k : ($8778) -> $8779 $8781) -> $8779 $8781 : (x1:a1a1: V, x2:a2a2: V, x3:a3a3: V, x4:a4a4: V, k: bb: V -> ee: E rr: V) -> ee: E rr: V )result: -> total clause1<(8853, 8854, 8855, 8856),8857,8859,8858,8860> : clause1std/core/hnd/clause1: (V, V, (E, V) -> V, E, V) -> V<(std/core/types/tuple4: (V, V, V, V) -> Va1a1: V,a2a2: V,a3a3: V,a4a4: V),bb: V,hh: (E, V) -> V,ee: E,rr: V> - clause-control1std/core/hnd/clause-control1: (clause : (x : ($8774, $8775, $8776, $8777), k : ($8778) -> $8779 $8781) -> $8779 $8781) -> clause1<($8774, $8775, $8776, $8777),$8778,$8780,$8779,$8781>( fnfn: (($8774, $8775, $8776, $8777), k : ($8778) -> $8779 $8781) -> $8779 $8781((std/core/types/Tuple4: forall<a,b,c,d> (fst : a, snd : b, thd : c, field4 : d) -> (a, b, c, d)x1x1: $8774,x2x2: $8775,x3x3: $8776,x4x4: $8777)std/core/types/Tuple4: forall<a,b,c,d> (fst : a, snd : b, thd : c, field4 : d) -> (a, b, c, d),kk: ($8778) -> $8779 $8781){ opop: (x1 : $8774, x2 : $8775, x3 : $8776, x4 : $8777, k : ($8778) -> $8779 $8781) -> $8779 $8781(x1x1: $8774,x2x2: $8775,x3x3: $8776,x4x4: $8777,kk: ($8778) -> $8779 $8781) } ) +pub fun clause-control4std/core/hnd/clause-control4: forall<a,b,c,d,a1,e,b1,c1> (op : (x1 : a, x2 : b, x3 : c, x4 : d, k : (a1) -> e c1) -> e c1) -> clause1<(a, b, c, d),a1,b1,e,c1>( opop: (x1 : $8774, x2 : $8775, x3 : $8776, x4 : $8777, k : ($8778) -> $8779 $8781) -> $8779 $8781 : (x1:a1a1: V, x2:a2a2: V, x3:a3a3: V, x4:a4a4: V, k: bb: V -> ee: E rr: V) -> ee: E rr: V )result: -> total clause1<(8853, 8854, 8855, 8856),8857,8859,8858,8860> : clause1std/core/hnd/clause1: (V, V, (E, V) -> V, E, V) -> V<(std/core/types/tuple4: (V, V, V, V) -> Va1a1: V,a2a2: V,a3a3: V,a4a4: V),bb: V,hh: (E, V) -> V,ee: E,rr: V> + clause-control1std/core/hnd/clause-control1: (clause : (x : ($8774, $8775, $8776, $8777), k : ($8778) -> $8779 $8781) -> $8779 $8781) -> clause1<($8774, $8775, $8776, $8777),$8778,$8780,$8779,$8781>( fnfn: (($8774, $8775, $8776, $8777), k : ($8778) -> $8779 $8781) -> $8779 $8781((std/core/types/Tuple4: forall<a,b,c,d> (fst : a, snd : b, thd : c, field4 : d) -> (a, b, c, d)x1x1: $8774,x2x2: $8775,x3x3: $8776,x4x4: $8777)std/core/types/Tuple4: forall<a,b,c,d> (fst : a, snd : b, thd : c, field4 : d) -> (a, b, c, d),kk: ($8778) -> $8779 $8781){ opop: (x1 : $8774, x2 : $8775, x3 : $8776, x4 : $8777, k : ($8778) -> $8779 $8781) -> $8779 $8781(x1x1: $8774,x2x2: $8775,x3x3: $8776,x4x4: $8777,kk: ($8778) -> $8779 $8781) } ) -pub fun clause-tail4std/core/hnd/clause-tail4: forall<e,a,b,c,d,a1,b1,c1> (op : (c, d, a1, b1) -> e c1) -> clause1<(c, d, a1, b1),c1,b,e,a><ee: E,rr: V,hh: (E, V) -> V,a1a1: V,a2a2: V,a3a3: V,a4a4: V,bb: V>(opop: ($8889, $8890, $8891, $8892) -> $8886 $8893 : (a1a1: V,a2a2: V,a3a3: V,a4a4: V) -> ee: E bb: V)result: -> total clause1<(8967, 8968, 8969, 8970),8971,8966,8964,8965> : clause1std/core/hnd/clause1: (V, V, (E, V) -> V, E, V) -> V<(std/core/types/tuple4: (V, V, V, V) -> Va1a1: V,a2a2: V,a3a3: V,a4a4: V),bb: V,hh: (E, V) -> V,ee: E,rr: V> - clause-tail1std/core/hnd/clause-tail1: (op : (($8889, $8890, $8891, $8892)) -> $8886 $8893) -> clause1<($8889, $8890, $8891, $8892),$8893,$8888,$8886,$8887>( fnfn: (($8889, $8890, $8891, $8892)) -> $8886 $8893((std/core/types/Tuple4: forall<a,b,c,d> (fst : a, snd : b, thd : c, field4 : d) -> (a, b, c, d)x1x1: $8889,x2x2: $8890,x3x3: $8891,x4x4: $8892)std/core/types/Tuple4: forall<a,b,c,d> (fst : a, snd : b, thd : c, field4 : d) -> (a, b, c, d)){ opop: ($8889, $8890, $8891, $8892) -> $8886 $8893(x1x1: $8889,x2x2: $8890,x3x3: $8891,x4x4: $8892) } ) +pub fun clause-tail4std/core/hnd/clause-tail4: forall<e,a,b,c,d,a1,b1,c1> (op : (c, d, a1, b1) -> e c1) -> clause1<(c, d, a1, b1),c1,b,e,a><ee: E,rr: V,hh: (E, V) -> V,a1a1: V,a2a2: V,a3a3: V,a4a4: V,bb: V>(opop: ($8889, $8890, $8891, $8892) -> $8886 $8893 : (a1a1: V,a2a2: V,a3a3: V,a4a4: V) -> ee: E bb: V)result: -> total clause1<(8967, 8968, 8969, 8970),8971,8966,8964,8965> : clause1std/core/hnd/clause1: (V, V, (E, V) -> V, E, V) -> V<(std/core/types/tuple4: (V, V, V, V) -> Va1a1: V,a2a2: V,a3a3: V,a4a4: V),bb: V,hh: (E, V) -> V,ee: E,rr: V> + clause-tail1std/core/hnd/clause-tail1: (op : (($8889, $8890, $8891, $8892)) -> $8886 $8893) -> clause1<($8889, $8890, $8891, $8892),$8893,$8888,$8886,$8887>( fnfn: (($8889, $8890, $8891, $8892)) -> $8886 $8893((std/core/types/Tuple4: forall<a,b,c,d> (fst : a, snd : b, thd : c, field4 : d) -> (a, b, c, d)x1x1: $8889,x2x2: $8890,x3x3: $8891,x4x4: $8892)std/core/types/Tuple4: forall<a,b,c,d> (fst : a, snd : b, thd : c, field4 : d) -> (a, b, c, d)){ opop: ($8889, $8890, $8891, $8892) -> $8886 $8893(x1x1: $8889,x2x2: $8890,x3x3: $8891,x4x4: $8892) } ) -pub fun clause-tail-noop4std/core/hnd/clause-tail-noop4: forall<e,a,b,c,d,a1,b1,c1> (op : (c, d, a1, b1) -> e c1) -> clause1<(c, d, a1, b1),c1,b,e,a><ee: E,rr: V,hh: (E, V) -> V,a1a1: V,a2a2: V,a3a3: V,a4a4: V,bb: V>(opop: ($9000, $9001, $9002, $9003) -> $8997 $9004 : (a1a1: V,a2a2: V,a3a3: V,a4a4: V) -> ee: E bb: V)result: -> total clause1<(9078, 9079, 9080, 9081),9082,9077,9075,9076> : clause1std/core/hnd/clause1: (V, V, (E, V) -> V, E, V) -> V<(std/core/types/tuple4: (V, V, V, V) -> Va1a1: V,a2a2: V,a3a3: V,a4a4: V),bb: V,hh: (E, V) -> V,ee: E,rr: V> - clause-tail-noop1std/core/hnd/clause-tail-noop1: (op : (($9000, $9001, $9002, $9003)) -> $8997 $9004) -> clause1<($9000, $9001, $9002, $9003),$9004,$8999,$8997,$8998>( fnfn: (($9000, $9001, $9002, $9003)) -> $8997 $9004((std/core/types/Tuple4: forall<a,b,c,d> (fst : a, snd : b, thd : c, field4 : d) -> (a, b, c, d)x1x1: $9000,x2x2: $9001,x3x3: $9002,x4x4: $9003)std/core/types/Tuple4: forall<a,b,c,d> (fst : a, snd : b, thd : c, field4 : d) -> (a, b, c, d)){ opop: ($9000, $9001, $9002, $9003) -> $8997 $9004(x1x1: $9000,x2x2: $9001,x3x3: $9002,x4x4: $9003) } ) +pub fun clause-tail-noop4std/core/hnd/clause-tail-noop4: forall<e,a,b,c,d,a1,b1,c1> (op : (c, d, a1, b1) -> e c1) -> clause1<(c, d, a1, b1),c1,b,e,a><ee: E,rr: V,hh: (E, V) -> V,a1a1: V,a2a2: V,a3a3: V,a4a4: V,bb: V>(opop: ($9000, $9001, $9002, $9003) -> $8997 $9004 : (a1a1: V,a2a2: V,a3a3: V,a4a4: V) -> ee: E bb: V)result: -> total clause1<(9078, 9079, 9080, 9081),9082,9077,9075,9076> : clause1std/core/hnd/clause1: (V, V, (E, V) -> V, E, V) -> V<(std/core/types/tuple4: (V, V, V, V) -> Va1a1: V,a2a2: V,a3a3: V,a4a4: V),bb: V,hh: (E, V) -> V,ee: E,rr: V> + clause-tail-noop1std/core/hnd/clause-tail-noop1: (op : (($9000, $9001, $9002, $9003)) -> $8997 $9004) -> clause1<($9000, $9001, $9002, $9003),$9004,$8999,$8997,$8998>( fnfn: (($9000, $9001, $9002, $9003)) -> $8997 $9004((std/core/types/Tuple4: forall<a,b,c,d> (fst : a, snd : b, thd : c, field4 : d) -> (a, b, c, d)x1x1: $9000,x2x2: $9001,x3x3: $9002,x4x4: $9003)std/core/types/Tuple4: forall<a,b,c,d> (fst : a, snd : b, thd : c, field4 : d) -> (a, b, c, d)){ opop: ($9000, $9001, $9002, $9003) -> $8997 $9004(x1x1: $9000,x2x2: $9001,x3x3: $9002,x4x4: $9003) } ) -pub fun clause-never4std/core/hnd/clause-never4: forall<a,b,c,d,a1,e,b1,c1> (op : (a, b, c, d) -> e c1) -> clause1<(a, b, c, d),a1,b1,e,c1>( opop: ($9108, $9109, $9110, $9111) -> $9113 $9115 : (a1a1: V,a2a2: V,a3a3: V,a4a4: V) -> ee: E rr: V )result: -> total clause1<(9186, 9187, 9188, 9189),9190,9192,9191,9193> : clause1std/core/hnd/clause1: (V, V, (E, V) -> V, E, V) -> V<(std/core/types/tuple4: (V, V, V, V) -> Va1a1: V,a2a2: V,a3a3: V,a4a4: V),bb: V,hh: (E, V) -> V,ee: E,rr: V> - clause-never1std/core/hnd/clause-never1: (op : (($9108, $9109, $9110, $9111)) -> $9113 $9115) -> clause1<($9108, $9109, $9110, $9111),$9112,$9114,$9113,$9115>(fnfn: (($9108, $9109, $9110, $9111)) -> $9113 $9115((std/core/types/Tuple4: forall<a,b,c,d> (fst : a, snd : b, thd : c, field4 : d) -> (a, b, c, d)x1x1: $9108,x2x2: $9109,x3x3: $9110,x4x4: $9111)std/core/types/Tuple4: forall<a,b,c,d> (fst : a, snd : b, thd : c, field4 : d) -> (a, b, c, d)){ opop: ($9108, $9109, $9110, $9111) -> $9113 $9115(x1x1: $9108,x2x2: $9109,x3x3: $9110,x4x4: $9111) } ) +pub fun clause-never4std/core/hnd/clause-never4: forall<a,b,c,d,a1,e,b1,c1> (op : (a, b, c, d) -> e c1) -> clause1<(a, b, c, d),a1,b1,e,c1>( opop: ($9108, $9109, $9110, $9111) -> $9113 $9115 : (a1a1: V,a2a2: V,a3a3: V,a4a4: V) -> ee: E rr: V )result: -> total clause1<(9186, 9187, 9188, 9189),9190,9192,9191,9193> : clause1std/core/hnd/clause1: (V, V, (E, V) -> V, E, V) -> V<(std/core/types/tuple4: (V, V, V, V) -> Va1a1: V,a2a2: V,a3a3: V,a4a4: V),bb: V,hh: (E, V) -> V,ee: E,rr: V> + clause-never1std/core/hnd/clause-never1: (op : (($9108, $9109, $9110, $9111)) -> $9113 $9115) -> clause1<($9108, $9109, $9110, $9111),$9112,$9114,$9113,$9115>(fnfn: (($9108, $9109, $9110, $9111)) -> $9113 $9115((std/core/types/Tuple4: forall<a,b,c,d> (fst : a, snd : b, thd : c, field4 : d) -> (a, b, c, d)x1x1: $9108,x2x2: $9109,x3x3: $9110,x4x4: $9111)std/core/types/Tuple4: forall<a,b,c,d> (fst : a, snd : b, thd : c, field4 : d) -> (a, b, c, d)){ opop: ($9108, $9109, $9110, $9111) -> $9113 $9115(x1x1: $9108,x2x2: $9109,x3x3: $9110,x4x4: $9111) } ) -pub fun @perform4( evev: ev<$9225> : evstd/core/hnd/ev: ((E, V) -> V) -> V<hh: (E, V) -> V>, opop: forall<e,a> ($9225<e,a>) -> clause1<($9219, $9220, $9221, $9222),$9223,$9225,e,a> : (forall<e1e1: E,rr: V> hh: (E, V) -> V<e1e1: E,rr: V> -> clause1std/core/hnd/clause1: (V, V, (E, V) -> V, E, V) -> V<(std/core/types/tuple4: (V, V, V, V) -> Va1a1: V,a2a2: V,a3a3: V,a4a4: V),bb: V,hh: (E, V) -> V,e1e1: E,rr: V>), x1x1: $9219 : a1a1: V, x2x2: $9220 : a2a2: V, x3x3: $9221 : a3a3: V, x4x4: $9222 : a4a4: V )result: -> 9312 9311 : ee: E bb: V - xperform1std/core/hnd/xperform1: (ev : ev<$9225>, op : forall<e,a> ($9225<e,a>) -> clause1<($9219, $9220, $9221, $9222),$9223,$9225,e,a>, x : ($9219, $9220, $9221, $9222)) -> $9224 $9223(evev: ev<$9225>,opop: forall<e,a> ($9225<e,a>) -> clause1<($9219, $9220, $9221, $9222),$9223,$9225,e,a>,(std/core/types/Tuple4: forall<a,b,c,d> (fst : a, snd : b, thd : c, field4 : d) -> (a, b, c, d)x1x1: $9219,x2x2: $9220,x3x3: $9221,x4x4: $9222)std/core/types/Tuple4: forall<a,b,c,d> (fst : a, snd : b, thd : c, field4 : d) -> (a, b, c, d)) +pub fun @perform4( evev: ev<$9225> : evstd/core/hnd/ev: ((E, V) -> V) -> V<hh: (E, V) -> V>, opop: forall<e,a> ($9225<e,a>) -> clause1<($9219, $9220, $9221, $9222),$9223,$9225,e,a> : (forall<e1e1: E,rr: V> hh: (E, V) -> V<e1e1: E,rr: V> -> clause1std/core/hnd/clause1: (V, V, (E, V) -> V, E, V) -> V<(std/core/types/tuple4: (V, V, V, V) -> Va1a1: V,a2a2: V,a3a3: V,a4a4: V),bb: V,hh: (E, V) -> V,e1e1: E,rr: V>), x1x1: $9219 : a1a1: V, x2x2: $9220 : a2a2: V, x3x3: $9221 : a3a3: V, x4x4: $9222 : a4a4: V )result: -> 9312 9311 : ee: E bb: V + xperform1std/core/hnd/xperform1: (ev : ev<$9225>, op : forall<e,a> ($9225<e,a>) -> clause1<($9219, $9220, $9221, $9222),$9223,$9225,e,a>, x : ($9219, $9220, $9221, $9222)) -> $9224 $9223(evev: ev<$9225>,opop: forall<e,a> ($9225<e,a>) -> clause1<($9219, $9220, $9221, $9222),$9223,$9225,e,a>,(std/core/types/Tuple4: forall<a,b,c,d> (fst : a, snd : b, thd : c, field4 : d) -> (a, b, c, d)x1x1: $9219,x2x2: $9220,x3x3: $9221,x4x4: $9222)std/core/types/Tuple4: forall<a,b,c,d> (fst : a, snd : b, thd : c, field4 : d) -> (a, b, c, d)) -fun under4std/core/hnd/under4: forall<a,b,c,d,a1,e,b1> (ev : ev<b1>, op : (a, b, c, d) -> e a1, x1 : a, x2 : b, x3 : c, x4 : d) -> e a1( evev: ev<$9343> : evstd/core/hnd/ev: ((E, V) -> V) -> V<hh: (E, V) -> V>, opop: ($9337, $9338, $9339, $9340) -> $9342 $9341 : (a1a1: V,a2a2: V,a3a3: V,a4a4: V) -> ee: E bb: V, x1x1: $9337 : a1a1: V, x2x2: $9338 : a2a2: V, x3x3: $9339 : a3a3: V, x4x4: $9340 : a4a4: V )result: -> 9448 9447 : ee: E bb: V +fun under4std/core/hnd/under4: forall<a,b,c,d,a1,e,b1> (ev : ev<b1>, op : (a, b, c, d) -> e a1, x1 : a, x2 : b, x3 : c, x4 : d) -> e a1( evev: ev<$9343> : evstd/core/hnd/ev: ((E, V) -> V) -> V<hh: (E, V) -> V>, opop: ($9337, $9338, $9339, $9340) -> $9342 $9341 : (a1a1: V,a2a2: V,a3a3: V,a4a4: V) -> ee: E bb: V, x1x1: $9337 : a1a1: V, x2x2: $9338 : a2a2: V, x3x3: $9339 : a3a3: V, x4x4: $9340 : a4a4: V )result: -> 9448 9447 : ee: E bb: V val w0w0: evv<_9351> = evv-swap-withstd/core/hnd/evv-swap-with: (ev : ev<$9343>) -> $9342 evv<_9351>(evev: ev<$9343>) val zz: $9341 = opop: ($9337, $9338, $9339, $9340) -> $9342 $9341(x1x1: $9337,x2x2: $9338,x3x3: $9339,x4x4: $9340) evv-setstd/core/hnd/evv-set: (w : evv<_9351>) -> $9342 ()(w0w0: evv<_9351>) - if yieldingstd/core/hnd/yielding: () -> $9342 bool() returnreturn: $9341 yield-contstd/core/hnd/yield-cont: (f : forall<a> ((a) -> $9342 $9341, a) -> $9342 $9341) -> $9342 $9341( fnfn: forall<a,b,e> (cont : (a) -> e b, res : a) -> e b(contcont: ($9382) -> $9342 $9341,resres: $9382) under1std/core/hnd/under1: (ev : ev<$9343>, op : ($9382) -> $9342 $9341, x : $9382) -> $9342 $9341(evev: ev<$9343>,contcont: ($9382) -> $9342 $9341,resres: $9382) )std/core/types/Unit: () + if yieldingstd/core/hnd/yielding: () -> $9342 bool() returnreturn: $9341 yield-contstd/core/hnd/yield-cont: (f : forall<a> ((a) -> $9342 $9341, a) -> $9342 $9341) -> $9342 $9341( fnfn: forall<a,b,e> (cont : (a) -> e b, res : a) -> e b(contcont: ($9382) -> $9342 $9341,resres: $9382) under1std/core/hnd/under1: (ev : ev<$9343>, op : ($9382) -> $9342 $9341, x : $9382) -> $9342 $9341(evev: ev<$9343>,contcont: ($9382) -> $9342 $9341,resres: $9382) )std/core/types/Unit: () zz: $9341 @@ -855,102 +855,102 @@ xx: $9769 -noinline fun open-at1std/core/hnd/open-at1: forall<a,b,e,e1> (i : ev-index, f : (a) -> e b, x : a) -> e1 b<aa: V,bb: V,e1e1: E,e2e2: E>( ii: ev-index: ev-indexstd/core/hnd/ev-index: V, ff: ($9871) -> $9873 $9872 : aa: V -> e1e1: E bb: V, xx: $9871 : aa: V )result: -> 9978 9976 : e2e2: E bb: V +noinline fun open-at1std/core/hnd/open-at1: forall<a,b,e,e1> (i : ev-index, f : (a) -> e b, x : a) -> e1 b<aa: V,bb: V,e1e1: E,e2e2: E>( ii: ev-index: ev-indexstd/core/hnd/ev-index: V, ff: ($9871) -> $9873 $9872 : aa: V -> e1e1: E bb: V, xx: $9871 : aa: V )result: -> 9978 9976 : e2e2: E bb: V val ww: evv<$9874> = evv-swap-create1std/core/hnd/evv-swap-create1: (i : ev-index) -> $9874 evv<$9874>(ii: ev-index) val yy: $9872 = cast-ev1std/core/hnd/cast-ev1: (f : ($9871) -> $9873 $9872) -> $9874 (($9871) -> $9874 $9872)(ff: ($9871) -> $9873 $9872)(xx: $9871) evv-setstd/core/hnd/evv-set: (w : evv<$9874>) -> $9874 ()(ww: evv<$9874>) - if yieldingstd/core/hnd/yielding: () -> $9874 bool() returnreturn: $9872 yield-contstd/core/hnd/yield-cont: (f : forall<a> ((a) -> $9874 $9872, a) -> $9874 $9872) -> $9874 $9872(fnfn: forall<a,b,e> (cont : (a) -> e b, res : a) -> e b(contcont: ($9920) -> $9874 $9872,resres: $9920){ open-at1std/core/hnd/open-at1: (i : ev-index, f : ($9920) -> $9874 $9872, x : $9920) -> $9874 $9872(pretend-decreasingstd/core/undiv/pretend-decreasing: (x : ev-index) -> $9874 ev-index(ii: ev-index),contcont: ($9920) -> $9874 $9872,resres: $9920) })std/core/types/Unit: () + if yieldingstd/core/hnd/yielding: () -> $9874 bool() returnreturn: $9872 yield-contstd/core/hnd/yield-cont: (f : forall<a> ((a) -> $9874 $9872, a) -> $9874 $9872) -> $9874 $9872(fnfn: forall<a,b,e> (cont : (a) -> e b, res : a) -> e b(contcont: ($9920) -> $9874 $9872,resres: $9920){ open-at1std/core/hnd/open-at1: (i : ev-index, f : ($9920) -> $9874 $9872, x : $9920) -> $9874 $9872(pretend-decreasingstd/core/undiv/pretend-decreasing: (x : ev-index) -> $9874 ev-index(ii: ev-index),contcont: ($9920) -> $9874 $9872,resres: $9920) })std/core/types/Unit: () yy: $9872 pub fun @open-at0<bb: V,e1e1: E,e2e2: E>( ii: ev-index: ev-indexstd/core/hnd/ev-index: V, ff: () -> $9992 $9991 : () -> e1e1: E bb: V )result: -> 10082 10080 : e2e2: E bb: V val ww: evv<$9993> = evv-swap-create1std/core/hnd/evv-swap-create1: (i : ev-index) -> $9993 evv<$9993>(ii: ev-index) val yy: $9991 = cast-ev0std/core/hnd/cast-ev0: (f : () -> $9992 $9991) -> $9993 (() -> $9993 $9991)(ff: () -> $9992 $9991)() evv-setstd/core/hnd/evv-set: (w : evv<$9993>) -> $9993 ()(ww: evv<$9993>) - if yieldingstd/core/hnd/yielding: () -> $9993 bool() returnreturn: $9991 yield-contstd/core/hnd/yield-cont: (f : forall<a> ((a) -> $9993 $9991, a) -> $9993 $9991) -> $9993 $9991(fnfn: forall<a,b,e> (cont : (a) -> e b, res : a) -> e b(contcont: ($10035) -> $9993 $9991,resres: $10035){ open-at1std/core/hnd/open-at1: (i : ev-index, f : ($10035) -> $9993 $9991, x : $10035) -> $9993 $9991(ii: ev-index,contcont: ($10035) -> $9993 $9991,resres: $10035) })std/core/types/Unit: () + if yieldingstd/core/hnd/yielding: () -> $9993 bool() returnreturn: $9991 yield-contstd/core/hnd/yield-cont: (f : forall<a> ((a) -> $9993 $9991, a) -> $9993 $9991) -> $9993 $9991(fnfn: forall<a,b,e> (cont : (a) -> e b, res : a) -> e b(contcont: ($10035) -> $9993 $9991,resres: $10035){ open-at1std/core/hnd/open-at1: (i : ev-index, f : ($10035) -> $9993 $9991, x : $10035) -> $9993 $9991(ii: ev-index,contcont: ($10035) -> $9993 $9991,resres: $10035) })std/core/types/Unit: () yy: $9991 pub fun @open-at1<aa: V,bb: V,e1e1: E,e2e2: E>( ii: ev-index: ev-indexstd/core/hnd/ev-index: V, ff: ($10092) -> $10094 $10093 : aa: V -> e1e1: E bb: V, xx: $10092 : aa: V )result: -> 10193 10191 : e2e2: E bb: V val ww: evv<$10095> = evv-swap-create1std/core/hnd/evv-swap-create1: (i : ev-index) -> $10095 evv<$10095>(ii: ev-index) val yy: $10093 = cast-ev1std/core/hnd/cast-ev1: (f : ($10092) -> $10094 $10093) -> $10095 (($10092) -> $10095 $10093)(ff: ($10092) -> $10094 $10093)(xx: $10092) evv-setstd/core/hnd/evv-set: (w : evv<$10095>) -> $10095 ()(ww: evv<$10095>) - if yieldingstd/core/hnd/yielding: () -> $10095 bool() returnreturn: $10093 yield-contstd/core/hnd/yield-cont: (f : forall<a> ((a) -> $10095 $10093, a) -> $10095 $10093) -> $10095 $10093(fnfn: forall<a,b,e> (cont : (a) -> e b, res : a) -> e b(contcont: ($10141) -> $10095 $10093,resres: $10141){ open-at1std/core/hnd/open-at1: (i : ev-index, f : ($10141) -> $10095 $10093, x : $10141) -> $10095 $10093(ii: ev-index,contcont: ($10141) -> $10095 $10093,resres: $10141) })std/core/types/Unit: () + if yieldingstd/core/hnd/yielding: () -> $10095 bool() returnreturn: $10093 yield-contstd/core/hnd/yield-cont: (f : forall<a> ((a) -> $10095 $10093, a) -> $10095 $10093) -> $10095 $10093(fnfn: forall<a,b,e> (cont : (a) -> e b, res : a) -> e b(contcont: ($10141) -> $10095 $10093,resres: $10141){ open-at1std/core/hnd/open-at1: (i : ev-index, f : ($10141) -> $10095 $10093, x : $10141) -> $10095 $10093(ii: ev-index,contcont: ($10141) -> $10095 $10093,resres: $10141) })std/core/types/Unit: () yy: $10093 pub fun @open-at2<a1a1: V,a2a2: V,bb: V,e1e1: E,e2e2: E> ( ii: ev-index: ev-indexstd/core/hnd/ev-index: V, ff: ($10206, $10207) -> $10209 $10208 : (a1a1: V,a2a2: V) -> e1e1: E bb: V, x1x1: $10206 : a1a1: V, x2x2: $10207 : a2a2: V )result: -> 10317 10315 : e2e2: E bb: V val ww: evv<$10210> = evv-swap-create1std/core/hnd/evv-swap-create1: (i : ev-index) -> $10210 evv<$10210>(ii: ev-index) val yy: $10208 = cast-ev2std/core/hnd/cast-ev2: (f : ($10206, $10207) -> $10209 $10208) -> $10210 (($10206, $10207) -> $10210 $10208)(ff: ($10206, $10207) -> $10209 $10208)(x1x1: $10206,x2x2: $10207) evv-setstd/core/hnd/evv-set: (w : evv<$10210>) -> $10210 ()(ww: evv<$10210>) - if yieldingstd/core/hnd/yielding: () -> $10210 bool() returnreturn: $10208 yield-contstd/core/hnd/yield-cont: (f : forall<a> ((a) -> $10210 $10208, a) -> $10210 $10208) -> $10210 $10208(fnfn: forall<a,b,e> (cont : (a) -> e b, res : a) -> e b(contcont: ($10260) -> $10210 $10208,resres: $10260){ open-at1std/core/hnd/open-at1: (i : ev-index, f : ($10260) -> $10210 $10208, x : $10260) -> $10210 $10208(ii: ev-index,contcont: ($10260) -> $10210 $10208,resres: $10260) })std/core/types/Unit: () + if yieldingstd/core/hnd/yielding: () -> $10210 bool() returnreturn: $10208 yield-contstd/core/hnd/yield-cont: (f : forall<a> ((a) -> $10210 $10208, a) -> $10210 $10208) -> $10210 $10208(fnfn: forall<a,b,e> (cont : (a) -> e b, res : a) -> e b(contcont: ($10260) -> $10210 $10208,resres: $10260){ open-at1std/core/hnd/open-at1: (i : ev-index, f : ($10260) -> $10210 $10208, x : $10260) -> $10210 $10208(ii: ev-index,contcont: ($10260) -> $10210 $10208,resres: $10260) })std/core/types/Unit: () yy: $10208 pub fun @open-at3<a1a1: V,a2a2: V,a3a3: V,bb: V,e1e1: E,e2e2: E> ( ii: ev-index: ev-indexstd/core/hnd/ev-index: V, ff: ($10333, $10334, $10335) -> $10337 $10336 : (a1a1: V,a2a2: V,a3a3: V) -> e1e1: E bb: V, x1x1: $10333 : a1a1: V, x2x2: $10334 : a2a2: V, x3x3: $10335 : a3a3: V )result: -> 10454 10452 : e2e2: E bb: V val ww: evv<$10338> = evv-swap-create1std/core/hnd/evv-swap-create1: (i : ev-index) -> $10338 evv<$10338>(ii: ev-index) val yy: $10336 = cast-ev3std/core/hnd/cast-ev3: (f : ($10333, $10334, $10335) -> $10337 $10336) -> $10338 (($10333, $10334, $10335) -> $10338 $10336)(ff: ($10333, $10334, $10335) -> $10337 $10336)(x1x1: $10333,x2x2: $10334,x3x3: $10335) evv-setstd/core/hnd/evv-set: (w : evv<$10338>) -> $10338 ()(ww: evv<$10338>) - if yieldingstd/core/hnd/yielding: () -> $10338 bool() returnreturn: $10336 yield-contstd/core/hnd/yield-cont: (f : forall<a> ((a) -> $10338 $10336, a) -> $10338 $10336) -> $10338 $10336(fnfn: forall<a,b,e> (cont : (a) -> e b, res : a) -> e b(contcont: ($10392) -> $10338 $10336,resres: $10392){ open-at1std/core/hnd/open-at1: (i : ev-index, f : ($10392) -> $10338 $10336, x : $10392) -> $10338 $10336(ii: ev-index,contcont: ($10392) -> $10338 $10336,resres: $10392) })std/core/types/Unit: () + if yieldingstd/core/hnd/yielding: () -> $10338 bool() returnreturn: $10336 yield-contstd/core/hnd/yield-cont: (f : forall<a> ((a) -> $10338 $10336, a) -> $10338 $10336) -> $10338 $10336(fnfn: forall<a,b,e> (cont : (a) -> e b, res : a) -> e b(contcont: ($10392) -> $10338 $10336,resres: $10392){ open-at1std/core/hnd/open-at1: (i : ev-index, f : ($10392) -> $10338 $10336, x : $10392) -> $10338 $10336(ii: ev-index,contcont: ($10392) -> $10338 $10336,resres: $10392) })std/core/types/Unit: () yy: $10336 pub fun @open-at4<a1a1: V,a2a2: V,a3a3: V,a4a4: V,bb: V,e1e1: E,e2e2: E> ( ii: ev-index: ev-indexstd/core/hnd/ev-index: V, ff: ($10473, $10474, $10475, $10476) -> $10478 $10477 : (a1a1: V,a2a2: V,a3a3: V,a4a4: V) -> e1e1: E bb: V, x1x1: $10473 : a1a1: V, x2x2: $10474 : a2a2: V, x3x3: $10475 : a3a3: V, x4x4: $10476 : a4a4: V )result: -> 10604 10602 : e2e2: E bb: V val ww: evv<$10479> = evv-swap-create1std/core/hnd/evv-swap-create1: (i : ev-index) -> $10479 evv<$10479>(ii: ev-index) val yy: $10477 = cast-ev4std/core/hnd/cast-ev4: (f : ($10473, $10474, $10475, $10476) -> $10478 $10477) -> $10479 (($10473, $10474, $10475, $10476) -> $10479 $10477)(ff: ($10473, $10474, $10475, $10476) -> $10478 $10477)(x1x1: $10473,x2x2: $10474,x3x3: $10475,x4x4: $10476) evv-setstd/core/hnd/evv-set: (w : evv<$10479>) -> $10479 ()(ww: evv<$10479>) - if yieldingstd/core/hnd/yielding: () -> $10479 bool() returnreturn: $10477 yield-contstd/core/hnd/yield-cont: (f : forall<a> ((a) -> $10479 $10477, a) -> $10479 $10477) -> $10479 $10477(fnfn: forall<a,b,e> (cont : (a) -> e b, res : a) -> e b(contcont: ($10537) -> $10479 $10477,resres: $10537){ open-at1std/core/hnd/open-at1: (i : ev-index, f : ($10537) -> $10479 $10477, x : $10537) -> $10479 $10477(ii: ev-index,contcont: ($10537) -> $10479 $10477,resres: $10537) })std/core/types/Unit: () + if yieldingstd/core/hnd/yielding: () -> $10479 bool() returnreturn: $10477 yield-contstd/core/hnd/yield-cont: (f : forall<a> ((a) -> $10479 $10477, a) -> $10479 $10477) -> $10479 $10477(fnfn: forall<a,b,e> (cont : (a) -> e b, res : a) -> e b(contcont: ($10537) -> $10479 $10477,resres: $10537){ open-at1std/core/hnd/open-at1: (i : ev-index, f : ($10537) -> $10479 $10477, x : $10537) -> $10479 $10477(ii: ev-index,contcont: ($10537) -> $10479 $10477,resres: $10537) })std/core/types/Unit: () yy: $10477 -noinline fun open1std/core/hnd/open1: forall<a,b,e,e1> (indices : vector<ev-index>, f : (a) -> e b, x : a) -> e1 b<aa: V,bb: V,e1e1: E,e2e2: E>( indicesindices: vector<ev-index> : vectorstd/core/types/vector: V -> V<ev-indexstd/core/hnd/ev-index: V>, ff: ($10626) -> $10628 $10627 : aa: V -> e1e1: E bb: V, xx: $10626 : aa: V )result: -> 10733 10731 : e2e2: E bb: V +noinline fun open1std/core/hnd/open1: forall<a,b,e,e1> (indices : vector<ev-index>, f : (a) -> e b, x : a) -> e1 b<aa: V,bb: V,e1e1: E,e2e2: E>( indicesindices: vector<ev-index> : vectorstd/core/types/vector: V -> V<ev-indexstd/core/hnd/ev-index: V>, ff: ($10626) -> $10628 $10627 : aa: V -> e1e1: E bb: V, xx: $10626 : aa: V )result: -> 10733 10731 : e2e2: E bb: V val ww: evv<$10629> = evv-swap-createstd/core/hnd/evv-swap-create: (indices : vector<ev-index>) -> $10629 evv<$10629>(indicesindices: vector<ev-index>) val yy: $10627 = cast-ev1std/core/hnd/cast-ev1: (f : ($10626) -> $10628 $10627) -> $10629 (($10626) -> $10629 $10627)(ff: ($10626) -> $10628 $10627)(xx: $10626) evv-setstd/core/hnd/evv-set: (w : evv<$10629>) -> $10629 ()(ww: evv<$10629>) - if yieldingstd/core/hnd/yielding: () -> $10629 bool() returnreturn: $10627 yield-contstd/core/hnd/yield-cont: (f : forall<a> ((a) -> $10629 $10627, a) -> $10629 $10627) -> $10629 $10627(fnfn: forall<a,b,e> (cont : (a) -> e b, res : a) -> e b(contcont: ($10675) -> $10629 $10627,resres: $10675){ open1std/core/hnd/open1: (indices : vector<ev-index>, f : ($10675) -> $10629 $10627, x : $10675) -> $10629 $10627(pretend-decreasingstd/core/undiv/pretend-decreasing: (x : vector<ev-index>) -> $10629 vector<ev-index>(indicesindices: vector<ev-index>),contcont: ($10675) -> $10629 $10627,resres: $10675) })std/core/types/Unit: () + if yieldingstd/core/hnd/yielding: () -> $10629 bool() returnreturn: $10627 yield-contstd/core/hnd/yield-cont: (f : forall<a> ((a) -> $10629 $10627, a) -> $10629 $10627) -> $10629 $10627(fnfn: forall<a,b,e> (cont : (a) -> e b, res : a) -> e b(contcont: ($10675) -> $10629 $10627,resres: $10675){ open1std/core/hnd/open1: (indices : vector<ev-index>, f : ($10675) -> $10629 $10627, x : $10675) -> $10629 $10627(pretend-decreasingstd/core/undiv/pretend-decreasing: (x : vector<ev-index>) -> $10629 vector<ev-index>(indicesindices: vector<ev-index>),contcont: ($10675) -> $10629 $10627,resres: $10675) })std/core/types/Unit: () yy: $10627 -pub fun @open0<bb: V,e1e1: E,e2e2: E>( indicesindices: vector<ev-index> : vectorstd/core/types/vector: V -> V<ev-indexstd/core/hnd/ev-index: V>, ff: () -> $10747 $10746 : () -> e1e1: E bb: V )result: -> 10837 10835 : e2e2: E bb: V +pub fun @open0<bb: V,e1e1: E,e2e2: E>( indicesindices: vector<ev-index> : vectorstd/core/types/vector: V -> V<ev-indexstd/core/hnd/ev-index: V>, ff: () -> $10747 $10746 : () -> e1e1: E bb: V )result: -> 10837 10835 : e2e2: E bb: V val ww: evv<$10748> = evv-swap-createstd/core/hnd/evv-swap-create: (indices : vector<ev-index>) -> $10748 evv<$10748>(indicesindices: vector<ev-index>) val yy: $10746 = cast-ev0std/core/hnd/cast-ev0: (f : () -> $10747 $10746) -> $10748 (() -> $10748 $10746)(ff: () -> $10747 $10746)() evv-setstd/core/hnd/evv-set: (w : evv<$10748>) -> $10748 ()(ww: evv<$10748>) - if yieldingstd/core/hnd/yielding: () -> $10748 bool() returnreturn: $10746 yield-contstd/core/hnd/yield-cont: (f : forall<a> ((a) -> $10748 $10746, a) -> $10748 $10746) -> $10748 $10746(fnfn: forall<a,b,e> (cont : (a) -> e b, res : a) -> e b(contcont: ($10790) -> $10748 $10746,resres: $10790){ open1std/core/hnd/open1: (indices : vector<ev-index>, f : ($10790) -> $10748 $10746, x : $10790) -> $10748 $10746(indicesindices: vector<ev-index>,contcont: ($10790) -> $10748 $10746,resres: $10790) })std/core/types/Unit: () + if yieldingstd/core/hnd/yielding: () -> $10748 bool() returnreturn: $10746 yield-contstd/core/hnd/yield-cont: (f : forall<a> ((a) -> $10748 $10746, a) -> $10748 $10746) -> $10748 $10746(fnfn: forall<a,b,e> (cont : (a) -> e b, res : a) -> e b(contcont: ($10790) -> $10748 $10746,resres: $10790){ open1std/core/hnd/open1: (indices : vector<ev-index>, f : ($10790) -> $10748 $10746, x : $10790) -> $10748 $10746(indicesindices: vector<ev-index>,contcont: ($10790) -> $10748 $10746,resres: $10790) })std/core/types/Unit: () yy: $10746 -pub fun @open1<aa: V,bb: V,e1e1: E,e2e2: E>( indicesindices: vector<ev-index> : vectorstd/core/types/vector: V -> V<ev-indexstd/core/hnd/ev-index: V>, ff: ($10847) -> $10849 $10848 : aa: V -> e1e1: E bb: V, xx: $10847 : aa: V )result: -> 10948 10946 : e2e2: E bb: V +pub fun @open1<aa: V,bb: V,e1e1: E,e2e2: E>( indicesindices: vector<ev-index> : vectorstd/core/types/vector: V -> V<ev-indexstd/core/hnd/ev-index: V>, ff: ($10847) -> $10849 $10848 : aa: V -> e1e1: E bb: V, xx: $10847 : aa: V )result: -> 10948 10946 : e2e2: E bb: V val ww: evv<$10850> = evv-swap-createstd/core/hnd/evv-swap-create: (indices : vector<ev-index>) -> $10850 evv<$10850>(indicesindices: vector<ev-index>) val yy: $10848 = cast-ev1std/core/hnd/cast-ev1: (f : ($10847) -> $10849 $10848) -> $10850 (($10847) -> $10850 $10848)(ff: ($10847) -> $10849 $10848)(xx: $10847) evv-setstd/core/hnd/evv-set: (w : evv<$10850>) -> $10850 ()(ww: evv<$10850>) - if yieldingstd/core/hnd/yielding: () -> $10850 bool() returnreturn: $10848 yield-contstd/core/hnd/yield-cont: (f : forall<a> ((a) -> $10850 $10848, a) -> $10850 $10848) -> $10850 $10848(fnfn: forall<a,b,e> (cont : (a) -> e b, res : a) -> e b(contcont: ($10896) -> $10850 $10848,resres: $10896){ open1std/core/hnd/open1: (indices : vector<ev-index>, f : ($10896) -> $10850 $10848, x : $10896) -> $10850 $10848(indicesindices: vector<ev-index>,contcont: ($10896) -> $10850 $10848,resres: $10896) })std/core/types/Unit: () + if yieldingstd/core/hnd/yielding: () -> $10850 bool() returnreturn: $10848 yield-contstd/core/hnd/yield-cont: (f : forall<a> ((a) -> $10850 $10848, a) -> $10850 $10848) -> $10850 $10848(fnfn: forall<a,b,e> (cont : (a) -> e b, res : a) -> e b(contcont: ($10896) -> $10850 $10848,resres: $10896){ open1std/core/hnd/open1: (indices : vector<ev-index>, f : ($10896) -> $10850 $10848, x : $10896) -> $10850 $10848(indicesindices: vector<ev-index>,contcont: ($10896) -> $10850 $10848,resres: $10896) })std/core/types/Unit: () yy: $10848 -pub fun @open2<a1a1: V,a2a2: V,bb: V,e1e1: E,e2e2: E>( indicesindices: vector<ev-index> : vectorstd/core/types/vector: V -> V<ev-indexstd/core/hnd/ev-index: V>, ff: ($10961, $10962) -> $10964 $10963 : (a1a1: V,a2a2: V) -> e1e1: E bb: V, x1x1: $10961 : a1a1: V, x2x2: $10962 : a2a2: V )result: -> 11072 11070 : e2e2: E bb: V +pub fun @open2<a1a1: V,a2a2: V,bb: V,e1e1: E,e2e2: E>( indicesindices: vector<ev-index> : vectorstd/core/types/vector: V -> V<ev-indexstd/core/hnd/ev-index: V>, ff: ($10961, $10962) -> $10964 $10963 : (a1a1: V,a2a2: V) -> e1e1: E bb: V, x1x1: $10961 : a1a1: V, x2x2: $10962 : a2a2: V )result: -> 11072 11070 : e2e2: E bb: V val ww: evv<$10965> = evv-swap-createstd/core/hnd/evv-swap-create: (indices : vector<ev-index>) -> $10965 evv<$10965>(indicesindices: vector<ev-index>) val yy: $10963 = cast-ev2std/core/hnd/cast-ev2: (f : ($10961, $10962) -> $10964 $10963) -> $10965 (($10961, $10962) -> $10965 $10963)(ff: ($10961, $10962) -> $10964 $10963)(x1x1: $10961,x2x2: $10962) evv-setstd/core/hnd/evv-set: (w : evv<$10965>) -> $10965 ()(ww: evv<$10965>) - if yieldingstd/core/hnd/yielding: () -> $10965 bool() returnreturn: $10963 yield-contstd/core/hnd/yield-cont: (f : forall<a> ((a) -> $10965 $10963, a) -> $10965 $10963) -> $10965 $10963(fnfn: forall<a,b,e> (cont : (a) -> e b, res : a) -> e b(contcont: ($11015) -> $10965 $10963,resres: $11015){ open1std/core/hnd/open1: (indices : vector<ev-index>, f : ($11015) -> $10965 $10963, x : $11015) -> $10965 $10963(indicesindices: vector<ev-index>,contcont: ($11015) -> $10965 $10963,resres: $11015) })std/core/types/Unit: () + if yieldingstd/core/hnd/yielding: () -> $10965 bool() returnreturn: $10963 yield-contstd/core/hnd/yield-cont: (f : forall<a> ((a) -> $10965 $10963, a) -> $10965 $10963) -> $10965 $10963(fnfn: forall<a,b,e> (cont : (a) -> e b, res : a) -> e b(contcont: ($11015) -> $10965 $10963,resres: $11015){ open1std/core/hnd/open1: (indices : vector<ev-index>, f : ($11015) -> $10965 $10963, x : $11015) -> $10965 $10963(indicesindices: vector<ev-index>,contcont: ($11015) -> $10965 $10963,resres: $11015) })std/core/types/Unit: () yy: $10963 -pub fun @open3<a1a1: V,a2a2: V,a3a3: V,bb: V,e1e1: E,e2e2: E>( indicesindices: vector<ev-index> : vectorstd/core/types/vector: V -> V<ev-indexstd/core/hnd/ev-index: V>, ff: ($11088, $11089, $11090) -> $11092 $11091 : (a1a1: V,a2a2: V,a3a3: V) -> e1e1: E bb: V, x1x1: $11088 : a1a1: V, x2x2: $11089 : a2a2: V, x3x3: $11090 : a3a3: V )result: -> 11209 11207 : e2e2: E bb: V +pub fun @open3<a1a1: V,a2a2: V,a3a3: V,bb: V,e1e1: E,e2e2: E>( indicesindices: vector<ev-index> : vectorstd/core/types/vector: V -> V<ev-indexstd/core/hnd/ev-index: V>, ff: ($11088, $11089, $11090) -> $11092 $11091 : (a1a1: V,a2a2: V,a3a3: V) -> e1e1: E bb: V, x1x1: $11088 : a1a1: V, x2x2: $11089 : a2a2: V, x3x3: $11090 : a3a3: V )result: -> 11209 11207 : e2e2: E bb: V val ww: evv<$11093> = evv-swap-createstd/core/hnd/evv-swap-create: (indices : vector<ev-index>) -> $11093 evv<$11093>(indicesindices: vector<ev-index>) val yy: $11091 = cast-ev3std/core/hnd/cast-ev3: (f : ($11088, $11089, $11090) -> $11092 $11091) -> $11093 (($11088, $11089, $11090) -> $11093 $11091)(ff: ($11088, $11089, $11090) -> $11092 $11091)(x1x1: $11088,x2x2: $11089,x3x3: $11090) evv-setstd/core/hnd/evv-set: (w : evv<$11093>) -> $11093 ()(ww: evv<$11093>) - if yieldingstd/core/hnd/yielding: () -> $11093 bool() returnreturn: $11091 yield-contstd/core/hnd/yield-cont: (f : forall<a> ((a) -> $11093 $11091, a) -> $11093 $11091) -> $11093 $11091(fnfn: forall<a,b,e> (cont : (a) -> e b, res : a) -> e b(contcont: ($11147) -> $11093 $11091,resres: $11147){ open1std/core/hnd/open1: (indices : vector<ev-index>, f : ($11147) -> $11093 $11091, x : $11147) -> $11093 $11091(indicesindices: vector<ev-index>,contcont: ($11147) -> $11093 $11091,resres: $11147) })std/core/types/Unit: () + if yieldingstd/core/hnd/yielding: () -> $11093 bool() returnreturn: $11091 yield-contstd/core/hnd/yield-cont: (f : forall<a> ((a) -> $11093 $11091, a) -> $11093 $11091) -> $11093 $11091(fnfn: forall<a,b,e> (cont : (a) -> e b, res : a) -> e b(contcont: ($11147) -> $11093 $11091,resres: $11147){ open1std/core/hnd/open1: (indices : vector<ev-index>, f : ($11147) -> $11093 $11091, x : $11147) -> $11093 $11091(indicesindices: vector<ev-index>,contcont: ($11147) -> $11093 $11091,resres: $11147) })std/core/types/Unit: () yy: $11091 -pub fun @open4<a1a1: V,a2a2: V,a3a3: V,a4a4: V,bb: V,e1e1: E,e2e2: E>( indicesindices: vector<ev-index> : vectorstd/core/types/vector: V -> V<ev-indexstd/core/hnd/ev-index: V>, ff: ($11228, $11229, $11230, $11231) -> $11233 $11232 : (a1a1: V,a2a2: V,a3a3: V,a4a4: V) -> e1e1: E bb: V, x1x1: $11228 : a1a1: V, x2x2: $11229 : a2a2: V, x3x3: $11230 : a3a3: V, x4x4: $11231 : a4a4: V )result: -> 11359 11357 : e2e2: E bb: V +pub fun @open4<a1a1: V,a2a2: V,a3a3: V,a4a4: V,bb: V,e1e1: E,e2e2: E>( indicesindices: vector<ev-index> : vectorstd/core/types/vector: V -> V<ev-indexstd/core/hnd/ev-index: V>, ff: ($11228, $11229, $11230, $11231) -> $11233 $11232 : (a1a1: V,a2a2: V,a3a3: V,a4a4: V) -> e1e1: E bb: V, x1x1: $11228 : a1a1: V, x2x2: $11229 : a2a2: V, x3x3: $11230 : a3a3: V, x4x4: $11231 : a4a4: V )result: -> 11359 11357 : e2e2: E bb: V val ww: evv<$11234> = evv-swap-createstd/core/hnd/evv-swap-create: (indices : vector<ev-index>) -> $11234 evv<$11234>(indicesindices: vector<ev-index>) val yy: $11232 = cast-ev4std/core/hnd/cast-ev4: (f : ($11228, $11229, $11230, $11231) -> $11233 $11232) -> $11234 (($11228, $11229, $11230, $11231) -> $11234 $11232)(ff: ($11228, $11229, $11230, $11231) -> $11233 $11232)(x1x1: $11228,x2x2: $11229,x3x3: $11230,x4x4: $11231) evv-setstd/core/hnd/evv-set: (w : evv<$11234>) -> $11234 ()(ww: evv<$11234>) - if yieldingstd/core/hnd/yielding: () -> $11234 bool() returnreturn: $11232 yield-contstd/core/hnd/yield-cont: (f : forall<a> ((a) -> $11234 $11232, a) -> $11234 $11232) -> $11234 $11232(fnfn: forall<a,b,e> (cont : (a) -> e b, res : a) -> e b(contcont: ($11292) -> $11234 $11232,resres: $11292){ open1std/core/hnd/open1: (indices : vector<ev-index>, f : ($11292) -> $11234 $11232, x : $11292) -> $11234 $11232(indicesindices: vector<ev-index>,contcont: ($11292) -> $11234 $11232,resres: $11292) })std/core/types/Unit: () + if yieldingstd/core/hnd/yielding: () -> $11234 bool() returnreturn: $11232 yield-contstd/core/hnd/yield-cont: (f : forall<a> ((a) -> $11234 $11232, a) -> $11234 $11232) -> $11234 $11232(fnfn: forall<a,b,e> (cont : (a) -> e b, res : a) -> e b(contcont: ($11292) -> $11234 $11232,resres: $11292){ open1std/core/hnd/open1: (indices : vector<ev-index>, f : ($11292) -> $11234 $11232, x : $11292) -> $11234 $11232(indicesindices: vector<ev-index>,contcont: ($11292) -> $11234 $11232,resres: $11292) })std/core/types/Unit: () yy: $11232 // ------------------------------------------- // capture yields // ------------------------------------------- -pub fun unsafe-try-finalizestd/core/hnd/unsafe-try-finalize: forall<a,e> (action : () -> e a) -> e either<yield-info,a>( actionaction: () -> $11486 $11485 : () -> ee: E aa: V )result: -> 11505 either<yield-info,11504> : ee: E eitherstd/core/types/either: (V, V) -> V<yield-infostd/core/hnd/yield-info: V,aa: V> +pub fun unsafe-try-finalizestd/core/hnd/unsafe-try-finalize: forall<a,e> (action : () -> e a) -> e either<yield-info,a>( actionaction: () -> $11486 $11485 : () -> ee: E aa: V )result: -> 11505 either<yield-info,11504> : ee: E eitherstd/core/types/either: (V, V) -> V<yield-infostd/core/hnd/yield-info: V,aa: V> try-finalize-promptstd/core/hnd/try-finalize-prompt: (res : $11485) -> $11486 either<yield-info,$11485>(actionaction: () -> $11486 $11485()); -fun try-finalize-promptstd/core/hnd/try-finalize-prompt: forall<a,e> (res : a) -> e either<yield-info,a>( resres: $11381 : aa: V )result: -> 11478 either<yield-info,11477> : ee: E eitherstd/core/types/either: (V, V) -> V<yield-infostd/core/hnd/yield-info: V,aa: V> - if yielding-non-finalstd/core/hnd/yielding-non-final: () -> $11382 bool() returnreturn: either<yield-info,$11381> yield-contstd/core/hnd/yield-cont: (f : forall<a> ((a) -> $11382 $11381, a) -> $11382 either<yield-info,$11381>) -> $11382 either<yield-info,$11381>(fnfn: forall<a,b,e> (cont : (a) -> e b, x : a) -> e either<yield-info,b>(contcont: ($11398) -> $11382 $11381,xx: $11398) try-finalize-promptstd/core/hnd/try-finalize-prompt: (res : $11381) -> $11382 either<yield-info,$11381>(pretend-decreasingstd/core/undiv/pretend-decreasing: (x : $11381) -> $11382 $11381(contcont: ($11398) -> $11382 $11381(xx: $11398))) )std/core/types/Unit: () - if !std/core/types/bool/(!): (b : bool) -> $11382 boolyieldingstd/core/hnd/yielding: () -> $11382 bool() then Rightstd/core/types/Right: forall<a,b> (right : b) -> either<a,b>(resres: $11381) else Leftstd/core/types/Left: forall<a,b> (left : a) -> either<a,b>(yield-capturestd/core/hnd/yield-capture: () -> $11382 yield-info()) +fun try-finalize-promptstd/core/hnd/try-finalize-prompt: forall<a,e> (res : a) -> e either<yield-info,a>( resres: $11381 : aa: V )result: -> 11478 either<yield-info,11477> : ee: E eitherstd/core/types/either: (V, V) -> V<yield-infostd/core/hnd/yield-info: V,aa: V> + if yielding-non-finalstd/core/hnd/yielding-non-final: () -> $11382 bool() returnreturn: either<yield-info,$11381> yield-contstd/core/hnd/yield-cont: (f : forall<a> ((a) -> $11382 $11381, a) -> $11382 either<yield-info,$11381>) -> $11382 either<yield-info,$11381>(fnfn: forall<a,b,e> (cont : (a) -> e b, x : a) -> e either<yield-info,b>(contcont: ($11398) -> $11382 $11381,xx: $11398) try-finalize-promptstd/core/hnd/try-finalize-prompt: (res : $11381) -> $11382 either<yield-info,$11381>(pretend-decreasingstd/core/undiv/pretend-decreasing: (x : $11381) -> $11382 $11381(contcont: ($11398) -> $11382 $11381(xx: $11398))) )std/core/types/Unit: () + if !std/core/types/bool/(!): (b : bool) -> $11382 boolyieldingstd/core/hnd/yielding: () -> $11382 bool() then Rightstd/core/types/Right: forall<a,b> (right : b) -> either<a,b>(resres: $11381) else Leftstd/core/types/Left: forall<a,b> (left : a) -> either<a,b>(yield-capturestd/core/hnd/yield-capture: () -> $11382 yield-info()) diff --git a/doc/std_core_hnd.html b/doc/std_core_hnd.html index eef4015e1..439662177 100644 --- a/doc/std_core_hnd.html +++ b/doc/std_core_hnd.html @@ -15,7 +15,7 @@ -

std/core/hnd▲toc

+

std/core/hnd▲toc

- -
fun clause-control1( clause : (x : a, k : (b) -> e d) -> e d ) : clause1std/core/hnd/clause1: (V, V, (E, V) -> V, E, V) -> V<a,b,c,e,d>
+ +
fun clause-control1( clause : (x : a, k : (b) -> e d) -> e d ) : clause1std/core/hnd/clause1: (V, V, (E, V) -> V, E, V) -> V<a,b,c,e,d>

Generic control clause.

fun clause-control3( op : (x1 : a, x2 : b, x3 : c, k : (d) -> e b1) -> e b1 ) : clause1std/core/hnd/clause1: (V, V, (E, V) -> V, E, V) -> V<(a, b, c),d,a1,e,b1>
fun clause-control4( op : (x1 : a, x2 : b, x3 : c, x4 : d, k : (a1) -> e c1) -> e c1 ) : clause1std/core/hnd/clause1: (V, V, (E, V) -> V, E, V) -> V<(a, b, c, d),a1,b1,e,c1>
@@ -162,38 +162,38 @@

Internal effect handler primitives.

Tail-resumptive clause: resumes exactly once at the end (these can be executed ‘in-place’ without capturing a resumption).

fun clause-tail3( op : (c, d, a1) -> e b1 ) : clause1std/core/hnd/clause1: (V, V, (E, V) -> V, E, V) -> V<(c, d, a1),b1,b,e,a>
fun clause-tail4( op : (c, d, a1, b1) -> e c1 ) : clause1std/core/hnd/clause1: (V, V, (E, V) -> V, E, V) -> V<(c, d, a1, b1),c1,b,e,a>
- -
+ +

Effect handler evidence of a handler h in the context.

-
-
+

Index into an evidence vector.

-
+

The tag of a handler identifies the type at runtime (e.g. "exn/core/std"). -

- - + +
fun finally( fin : () -> e (), action : () -> e a ) : e a
-
fun initially( init : (intstd/core/types/int: V) -> e (), action : () -> e a ) : e a
- - +
fun initially( init : (intstd/core/types/int: V) -> e (), action : () -> e a ) : e a
+ +
fun yield-bind( x : a, next : (a) -> e b ) : e b
fun yield-bind2( x : a, extend : (a) -> e b, next : (a) -> e b ) : e b
fun yield-extend( next : (a) -> e b ) : e b
- - - + + + diff --git a/doc/std_core_int-source.html b/doc/std_core_int-source.html index 0cc1d651d..a9af94f38 100644 --- a/doc/std_core_int-source.html +++ b/doc/std_core_int-source.html @@ -32,98 +32,98 @@ // > Daan Leijen, Technical report MSR-TR-2022-17, 2022-07-11, v1.0. Presented at the ML workshop 2022." // > <https://www.microsoft.com/en-us/research/uploads/prod/2022/07/int.pdf> // -module std/core/intstd/core/int +module std/core/intstd/core/int -import std/core/typesstd/core/types +import std/core/typesstd/core/types extern import c file "inline/int.h" js file "inline/int.js" -pub fip fun orderstd/core/int/order: (i : int) -> order( ii: int : intstd/core/types/int: V )result: -> total order : orderstd/core/types/order: V - if ii: int <std/core/int/(<): (x : int, y : int) -> bool 0literal: int
dec = 0
hex8 = 0x00
bit8 = 0b00000000
then Ltstd/core/types/Lt: order - elif ii: int >std/core/int/(>): (x : int, y : int) -> bool 0literal: int
dec = 0
hex8 = 0x00
bit8 = 0b00000000
then Gtstd/core/types/Gt: order - else Eqstd/core/types/Eq: order
+pub fip fun orderstd/core/int/order: (i : int) -> order( ii: int : intstd/core/types/int: V )result: -> total order : orderstd/core/types/order: V + if ii: int <std/core/int/(<): (x : int, y : int) -> bool 0literal: int
dec = 0
hex8 = 0x00
bit8 = 0b00000000
then Ltstd/core/types/Lt: order + elif ii: int >std/core/int/(>): (x : int, y : int) -> bool 0literal: int
dec = 0
hex8 = 0x00
bit8 = 0b00000000
then Gtstd/core/types/Gt: order + else Eqstd/core/types/Eq: order
// Compare two integers -pub inline fip fun cmpstd/core/int/cmp: (x : int, y : int) -> order(^xx: int : intstd/core/types/int: V, ^yy: int : intstd/core/types/int: V)result: -> total order : orderstd/core/types/order: V - if (xx: int==std/core/int/(==): (x : int, y : int) -> boolyy: int) then Eqstd/core/types/Eq: order elif (xx: int>std/core/int/(>): (x : int, y : int) -> boolyy: int) then Gtstd/core/types/Gt: order else Ltstd/core/types/Lt: order +pub inline fip fun cmpstd/core/int/cmp: (x : int, y : int) -> order(^xx: int : intstd/core/types/int: V, ^yy: int : intstd/core/types/int: V)result: -> total order : orderstd/core/types/order: V + if (xx: int==std/core/int/(==): (x : int, y : int) -> boolyy: int) then Eqstd/core/types/Eq: order elif (xx: int>std/core/int/(>): (x : int, y : int) -> boolyy: int) then Gtstd/core/types/Gt: order else Ltstd/core/types/Lt: order // c inline "kk_int_as_order(kk_integer_cmp_borrow(#1,#2,kk_context()),kk_context())" // cs "Primitive.IntCompare" // js "$std_core_types._int_compare" // Order two integers in ascending order. -pub inline fip fun order2std/core/int/order2: (x : int, y : int) -> order2<int>(xx: int : intstd/core/types/int: V, yy: int : intstd/core/types/int: V)result: -> total order2<int> : order2std/core/types/order2: V -> V<intstd/core/types/int: V> - if (xx: int==std/core/int/(==): (x : int, y : int) -> boolyy: int) then Eq2std/core/types/Eq2: forall<a> (eq : a) -> order2<a>(xx: int) elif (xx: int <std/core/int/(<): (x : int, y : int) -> bool yy: int) then Lt2std/core/types/Lt2: forall<a> (lt : a, gt : a) -> order2<a>(xx: int,yy: int) else Gt2std/core/types/Gt2: forall<a> (lt : a, gt : a) -> order2<a>(yy: int,xx: int) +pub inline fip fun order2std/core/int/order2: (x : int, y : int) -> order2<int>(xx: int : intstd/core/types/int: V, yy: int : intstd/core/types/int: V)result: -> total order2<int> : order2std/core/types/order2: V -> V<intstd/core/types/int: V> + if (xx: int==std/core/int/(==): (x : int, y : int) -> boolyy: int) then Eq2std/core/types/Eq2: forall<a> (eq : a) -> order2<a>(xx: int) elif (xx: int <std/core/int/(<): (x : int, y : int) -> bool yy: int) then Lt2std/core/types/Lt2: forall<a> (lt : a, gt : a) -> order2<a>(xx: int,yy: int) else Gt2std/core/types/Gt2: forall<a> (lt : a, gt : a) -> order2<a>(yy: int,xx: int) // Are two integers equal? -pub inline fip extern (==)std/core/int/(==): (x : int, y : int) -> bool(^x : intstd/core/types/int: V, ^y : intstd/core/types/int: V) : boolstd/core/types/bool: V +pub inline fip extern (==)std/core/int/(==): (x : int, y : int) -> bool(^x : intstd/core/types/int: V, ^y : intstd/core/types/int: V) : boolstd/core/types/bool: V c "kk_integer_eq_borrow" cs inline "(#1 == #2)" js "$std_core_types._int_eq" // Are two integers not equal? -pub inline fip extern (!=)std/core/int/(!=): (x : int, y : int) -> bool(^x : intstd/core/types/int: V, ^y : intstd/core/types/int: V) : boolstd/core/types/bool: V +pub inline fip extern (!=)std/core/int/(!=): (x : int, y : int) -> bool(^x : intstd/core/types/int: V, ^y : intstd/core/types/int: V) : boolstd/core/types/bool: V c "kk_integer_neq_borrow" cs inline "(#1 != #2)" js "$std_core_types._int_ne" // Is the first integer smaller or equal to the second? -pub inline fip extern (<=)std/core/int/(<=): (x : int, y : int) -> bool(^x : intstd/core/types/int: V, ^y : intstd/core/types/int: V) : boolstd/core/types/bool: V +pub inline fip extern (<=)std/core/int/(<=): (x : int, y : int) -> bool(^x : intstd/core/types/int: V, ^y : intstd/core/types/int: V) : boolstd/core/types/bool: V c "kk_integer_lte_borrow" cs inline "(#1 <= #2)" js "$std_core_types._int_le" // Is the first integer greater or equal to the second? -pub inline fip extern (>=)std/core/int/(>=): (x : int, y : int) -> bool(^x : intstd/core/types/int: V, ^y : intstd/core/types/int: V) : boolstd/core/types/bool: V +pub inline fip extern (>=)std/core/int/(>=): (x : int, y : int) -> bool(^x : intstd/core/types/int: V, ^y : intstd/core/types/int: V) : boolstd/core/types/bool: V c "kk_integer_gte_borrow" cs inline "(#1 >= #2)" js "$std_core_types._int_ge" // Is the first integer smaller than the second? -pub inline fip extern (<)std/core/int/(<): (x : int, y : int) -> bool(^x : intstd/core/types/int: V, ^y : intstd/core/types/int: V) : boolstd/core/types/bool: V +pub inline fip extern (<)std/core/int/(<): (x : int, y : int) -> bool(^x : intstd/core/types/int: V, ^y : intstd/core/types/int: V) : boolstd/core/types/bool: V c "kk_integer_lt_borrow" cs inline "(#1 < #2)" js "$std_core_types._int_lt" // Is the first integer greater than the second? -pub inline fip extern (>)std/core/int/(>): (x : int, y : int) -> bool(^x : intstd/core/types/int: V, ^y : intstd/core/types/int: V) : boolstd/core/types/bool: V +pub inline fip extern (>)std/core/int/(>): (x : int, y : int) -> bool(^x : intstd/core/types/int: V, ^y : intstd/core/types/int: V) : boolstd/core/types/bool: V c "kk_integer_gt_borrow" cs inline "(#1 > #2)" js "$std_core_types._int_gt" -inline fip extern int-addstd/core/int/int-add: (int, int) -> int : (intstd/core/types/int: V,intstd/core/types/int: V) -> intstd/core/types/int: V +inline fip extern int-addstd/core/int/int-add: (int, int) -> int : (intstd/core/types/int: V,intstd/core/types/int: V) -> intstd/core/types/int: V c "kk_integer_add" cs inline "(#1 + #2)" js "$std_core_types._int_add" // Add two integers. -pub fip fun (+)std/core/int/(+): (x : int, y : int) -> int(xx: int : intstd/core/types/int: V, yy: int : intstd/core/types/int: V )result: -> total int : intstd/core/types/int: V +pub fip fun (+)std/core/int/(+): (x : int, y : int) -> int(xx: int : intstd/core/types/int: V, yy: int : intstd/core/types/int: V )result: -> total int : intstd/core/types/int: V int-addstd/core/int/int-add: (int, int) -> int(xx: int,yy: int) -inline fip extern int-substd/core/int/int-sub: (int, int) -> int : (intstd/core/types/int: V,intstd/core/types/int: V) -> intstd/core/types/int: V +inline fip extern int-substd/core/int/int-sub: (int, int) -> int : (intstd/core/types/int: V,intstd/core/types/int: V) -> intstd/core/types/int: V c "kk_integer_sub" cs inline "(#1 - #2)" js "$std_core_types._int_sub" // Substract two integers. -pub fip fun (-)std/core/int/(-): (x : int, y : int) -> int(xx: int : intstd/core/types/int: V, yy: int : intstd/core/types/int: V )result: -> total int : intstd/core/types/int: V +pub fip fun (-)std/core/int/(-): (x : int, y : int) -> int(xx: int : intstd/core/types/int: V, yy: int : intstd/core/types/int: V )result: -> total int : intstd/core/types/int: V int-substd/core/int/int-sub: (int, int) -> int(xx: int,yy: int) // Multiply two integers. -pub inline fip extern (*)std/core/int/(*): (int, int) -> int : (intstd/core/types/int: V,intstd/core/types/int: V) -> intstd/core/types/int: V +pub inline fip extern (*)std/core/int/(*): (int, int) -> int : (intstd/core/types/int: V,intstd/core/types/int: V) -> intstd/core/types/int: V c "kk_integer_mul" cs inline "(#1 * #2)" js "$std_core_types._int_mul" // Euclidean-0 division of two integers. See also `divmod:(x : int, y : int) -> (int,int)`. -pub inline fip extern (/)std/core/int/(/): (x : int, y : int) -> int(x:intstd/core/types/int: V,y:intstd/core/types/int: V) : intstd/core/types/int: V +pub inline fip extern (/)std/core/int/(/): (x : int, y : int) -> int(x:intstd/core/types/int: V,y:intstd/core/types/int: V) : intstd/core/types/int: V c "kk_integer_div" cs "Primitive.IntDiv" js "$std_core_types._int_div" // Euclidean modulus of two integers; always a non-negative number. See also `divmod:(x : int, y : int) -> (int,int)`. -pub inline fip extern (%)std/core/int/(%): (int, int) -> int : (intstd/core/types/int: V,intstd/core/types/int: V) -> intstd/core/types/int: V +pub inline fip extern (%)std/core/int/(%): (int, int) -> int : (intstd/core/types/int: V,intstd/core/types/int: V) -> intstd/core/types/int: V c "kk_integer_mod" cs "Primitive.IntMod" js "$std_core_types._int_mod" @@ -147,34 +147,34 @@ See also _Division and modulus for computer scientists, Daan Leijen, 2001_ for further information (available at: <https://www.microsoft.com/en-us/research/wp-content/uploads/2016/02/divmodnote-letter.pdf>). */ -pub fip extern divmodstd/core/int/divmod: (x : int, y : int) -> (int, int)(xx: int:intstd/core/types/int: V,yy: int:intstd/core/types/int: V) : (std/core/types/tuple2: (V, V) -> Vintstd/core/types/int: V,intstd/core/types/int: V) +pub fip extern divmodstd/core/int/divmod: (x : int, y : int) -> (int, int)(xx: int:intstd/core/types/int: V,yy: int:intstd/core/types/int: V) : (std/core/types/tuple2: (V, V) -> Vintstd/core/types/int: V,intstd/core/types/int: V) c "kk_integer_div_mod_tuple" cs "Primitive.IntDivMod" js "$std_core_types._int_divmod" -pub fip fun negatestd/core/int/negate: (i : int) -> int(ii: int : intstd/core/types/int: V)result: -> total int : intstd/core/types/int: V +pub fip fun negatestd/core/int/negate: (i : int) -> int(ii: int : intstd/core/types/int: V)result: -> total int : intstd/core/types/int: V ~std/core/int/(~): (i : int) -> intii: int // Negate an integer. -pub inline fip extern (~)std/core/int/(~): (i : int) -> int(i:intstd/core/types/int: V) : intstd/core/types/int: V +pub inline fip extern (~)std/core/int/(~): (i : int) -> int(i:intstd/core/types/int: V) : intstd/core/types/int: V c "kk_integer_neg" cs inline "(-#1)" js "$std_core_types._int_negate" // Is this an odd integer? -pub inline fip extern is-oddstd/core/int/is-odd: (i : int) -> bool( i : intstd/core/types/int: V ) : boolstd/core/types/bool: V +pub inline fip extern is-oddstd/core/int/is-odd: (i : int) -> bool( i : intstd/core/types/int: V ) : boolstd/core/types/bool: V c "kk_integer_is_odd" cs inline "!(#1.IsEven)" js "$std_core_types._int_isodd" // Is this equal to zero? -pub inline fip extern is-zerostd/core/int/is-zero: (x : int) -> bool( ^x : intstd/core/types/int: V) : boolstd/core/types/bool: V +pub inline fip extern is-zerostd/core/int/is-zero: (x : int) -> bool( ^x : intstd/core/types/int: V) : boolstd/core/types/bool: V c inline "kk_integer_is_zero_borrow(#1)" cs inline "(#1.IsZero)" js "$std_core_types._int_iszero" // Return the absolute value of an integer. -pub inline fip extern absstd/core/int/abs: (i : int) -> int(i : intstd/core/types/int: V) : intstd/core/types/int: V +pub inline fip extern absstd/core/int/abs: (i : int) -> int(i : intstd/core/types/int: V) : intstd/core/types/int: V c "kk_integer_abs" cs "BigInteger.Abs" js "$std_core_types._int_abs" @@ -182,109 +182,109 @@ // Increment -pub fip fun incstd/core/int/inc: (i : int) -> int( ii: int : intstd/core/types/int: V )result: -> total int : intstd/core/types/int: V +pub fip fun incstd/core/int/inc: (i : int) -> int( ii: int : intstd/core/types/int: V )result: -> total int : intstd/core/types/int: V ii: int +std/core/int/(+): (x : int, y : int) -> int 1literal: int
dec = 1
hex8 = 0x01
bit8 = 0b00000001
// Decrement -pub fip fun decstd/core/int/dec: (i : int) -> int( ii: int : intstd/core/types/int: V )result: -> total int : intstd/core/types/int: V +pub fip fun decstd/core/int/dec: (i : int) -> int( ii: int : intstd/core/types/int: V )result: -> total int : intstd/core/types/int: V ii: int -std/core/int/(-): (x : int, y : int) -> int 1literal: int
dec = 1
hex8 = 0x01
bit8 = 0b00000001
// Calculate ``10^exp`` -pub fip fun exp10std/core/int/exp10: (exp : int) -> int( expexp: int : intstd/core/types/int: V )result: -> total int : intstd/core/types/int: V +pub fip fun exp10std/core/int/exp10: (exp : int) -> int( expexp: int : intstd/core/types/int: V )result: -> total int : intstd/core/types/int: V 1literal: int
dec = 1
hex8 = 0x01
bit8 = 0b00000001
.mul-exp10std/core/int/mul-exp10: (i : int, n : int) -> int(expexp: int
) // Raise an integer `i` to the power of `exp`. -pub fip extern powstd/core/int/pow: (i : int, exp : int) -> int( ii: int : intstd/core/types/int: V, expexp: int : intstd/core/types/int: V ) : intstd/core/types/int: V +pub fip extern powstd/core/int/pow: (i : int, exp : int) -> int( ii: int : intstd/core/types/int: V, expexp: int : intstd/core/types/int: V ) : intstd/core/types/int: V c "kk_integer_pow" cs "Primitive.IntPow" js "$std_core_types._int_pow" // Raise an integer `i` to the power of `exp`. -pub fip fun (^)std/core/int/(^): (i : int, exp : int) -> int(ii: int : intstd/core/types/int: V, expexp: int : intstd/core/types/int: V )result: -> total int : intstd/core/types/int: V +pub fip fun (^)std/core/int/(^): (i : int, exp : int) -> int(ii: int : intstd/core/types/int: V, expexp: int : intstd/core/types/int: V )result: -> total int : intstd/core/types/int: V powstd/core/int/pow: (i : int, exp : int) -> int(ii: int,expexp: int) // Calculate ``2^exp``. -pub fip fun exp2std/core/int/exp2: (exp : int) -> int( expexp: int : intstd/core/types/int: V )result: -> total int : intstd/core/types/int: V +pub fip fun exp2std/core/int/exp2: (exp : int) -> int( expexp: int : intstd/core/types/int: V )result: -> total int : intstd/core/types/int: V powstd/core/int/pow: (i : int, exp : int) -> int(2literal: int
dec = 2
hex8 = 0x02
bit8 = 0b00000010
,expexp: int
) // Return the number of ending `0` digits of `i`. Return `0` when `i==0`. -pub fip extern is-exp10std/core/int/is-exp10: (i : int) -> int( ii: int : intstd/core/types/int: V ) : intstd/core/types/int: V +pub fip extern is-exp10std/core/int/is-exp10: (i : int) -> int( ii: int : intstd/core/types/int: V ) : intstd/core/types/int: V c "kk_integer_ctz" cs "Primitive.IntCountPow10" js "$std_core_types._int_count_pow10" // Return the number of decimal digits of `i`. Return `0` when `i==0`. -pub fip extern count-digitsstd/core/int/count-digits: (i : int) -> int( ii: int : intstd/core/types/int: V ) : intstd/core/types/int: V +pub fip extern count-digitsstd/core/int/count-digits: (i : int) -> int( ii: int : intstd/core/types/int: V ) : intstd/core/types/int: V c "kk_integer_count_digits" cs "Primitive.IntCountDigits" js "$std_core_types._int_count_digits" -pub fip extern mul-exp10std/core/int/mul-exp10: (i : int, n : int) -> int( ii: int : intstd/core/types/int: V, nn: int : intstd/core/types/int: V ) : intstd/core/types/int: V +pub fip extern mul-exp10std/core/int/mul-exp10: (i : int, n : int) -> int( ii: int : intstd/core/types/int: V, nn: int : intstd/core/types/int: V ) : intstd/core/types/int: V c "kk_integer_mul_pow10" cs "Primitive.IntMulPow10" js "$std_core_types._int_mul_pow10" -pub fip extern cdiv-exp10std/core/int/cdiv-exp10: (i : int, n : int) -> int( ii: int : intstd/core/types/int: V, nn: int : intstd/core/types/int: V ) : intstd/core/types/int: V +pub fip extern cdiv-exp10std/core/int/cdiv-exp10: (i : int, n : int) -> int( ii: int : intstd/core/types/int: V, nn: int : intstd/core/types/int: V ) : intstd/core/types/int: V c "kk_integer_cdiv_pow10" cs "Primitive.IntCDivPow10" js "$std_core_types._int_cdiv_pow10" -pub fun cdivmod-exp10std/core/int/cdivmod-exp10: (i : int, n : int) -> (int, int)( ii: int : intstd/core/types/int: V, nn: int : intstd/core/types/int: V )result: -> total (int, int) : (std/core/types/tuple2: (V, V) -> Vintstd/core/types/int: V,intstd/core/types/int: V) - if nn: int <=std/core/int/(<=): (x : int, y : int) -> bool 0literal: int
dec = 0
hex8 = 0x00
bit8 = 0b00000000
returnreturn: (int, int) (std/core/types/Tuple2: forall<a,b> (fst : a, snd : b) -> (a, b)ii: int,0literal: int
dec = 0
hex8 = 0x00
bit8 = 0b00000000
)std/core/types/Tuple2: forall<a,b> (fst : a, snd : b) -> (a, b) +pub fun cdivmod-exp10std/core/int/cdivmod-exp10: (i : int, n : int) -> (int, int)( ii: int : intstd/core/types/int: V, nn: int : intstd/core/types/int: V )result: -> total (int, int) : (std/core/types/tuple2: (V, V) -> Vintstd/core/types/int: V,intstd/core/types/int: V) + if nn: int <=std/core/int/(<=): (x : int, y : int) -> bool 0literal: int
dec = 0
hex8 = 0x00
bit8 = 0b00000000
returnreturn: (int, int) (std/core/types/Tuple2: forall<a,b> (fst : a, snd : b) -> (a, b)ii: int,0literal: int
dec = 0
hex8 = 0x00
bit8 = 0b00000000
)std/core/types/Tuple2: forall<a,b> (fst : a, snd : b) -> (a, b) val cqcq: int = ii: int.cdiv-exp10std/core/int/cdiv-exp10: (i : int, n : int) -> int(nn: int) val crcr: int = ii: int -std/core/int/(-): (x : int, y : int) -> int cqcq: int.mul-exp10std/core/int/mul-exp10: (i : int, n : int) -> int(nn: int) - (std/core/types/Tuple2: forall<a,b> (fst : a, snd : b) -> (a, b)cqcq: int,crcr: int
)std/core/types/Tuple2: forall<a,b> (fst : a, snd : b) -> (a, b) + (std/core/types/Tuple2: forall<a,b> (fst : a, snd : b) -> (a, b)cqcq: int,crcr: int
)std/core/types/Tuple2: forall<a,b> (fst : a, snd : b) -> (a, b) -pub fun divmod-exp10std/core/int/divmod-exp10: (i : int, n : int) -> (int, int)( ii: int : intstd/core/types/int: V, nn: int : intstd/core/types/int: V )result: -> total (int, int) : (std/core/types/tuple2: (V, V) -> Vintstd/core/types/int: V,intstd/core/types/int: V) - val (std/core/types/Tuple2: forall<a,b> (fst : a, snd : b) -> (a, b)cqcq: int,crcr: int)std/core/types/Tuple2: forall<a,b> (fst : a, snd : b) -> (a, b) = cdivmod-exp10std/core/int/cdivmod-exp10: (i : int, n : int) -> (int, int)(ii: int,nn: int) - if !std/core/types/bool/(!): (b : bool) -> boolcrcr: int.is-negstd/core/int/is-neg: (i : int) -> bool then (std/core/types/Tuple2: forall<a,b> (fst : a, snd : b) -> (a, b)cqcq: int,crcr: int)std/core/types/Tuple2: forall<a,b> (fst : a, snd : b) -> (a, b) else (std/core/types/Tuple2: forall<a,b> (fst : a, snd : b) -> (a, b)cqcq: int.decstd/core/int/dec: (i : int) -> int, crcr: int +std/core/int/(+): (x : int, y : int) -> int exp10std/core/int/exp10: (exp : int) -> int(nn: int))std/core/types/Tuple2: forall<a,b> (fst : a, snd : b) -> (a, b) +pub fun divmod-exp10std/core/int/divmod-exp10: (i : int, n : int) -> (int, int)( ii: int : intstd/core/types/int: V, nn: int : intstd/core/types/int: V )result: -> total (int, int) : (std/core/types/tuple2: (V, V) -> Vintstd/core/types/int: V,intstd/core/types/int: V) + val (std/core/types/Tuple2: forall<a,b> (fst : a, snd : b) -> (a, b)cqcq: int,crcr: int)std/core/types/Tuple2: forall<a,b> (fst : a, snd : b) -> (a, b) = cdivmod-exp10std/core/int/cdivmod-exp10: (i : int, n : int) -> (int, int)(ii: int,nn: int) + if !std/core/types/bool/(!): (b : bool) -> boolcrcr: int.is-negstd/core/int/is-neg: (i : int) -> bool then (std/core/types/Tuple2: forall<a,b> (fst : a, snd : b) -> (a, b)cqcq: int,crcr: int)std/core/types/Tuple2: forall<a,b> (fst : a, snd : b) -> (a, b) else (std/core/types/Tuple2: forall<a,b> (fst : a, snd : b) -> (a, b)cqcq: int.decstd/core/int/dec: (i : int) -> int, crcr: int +std/core/int/(+): (x : int, y : int) -> int exp10std/core/int/exp10: (exp : int) -> int(nn: int))std/core/types/Tuple2: forall<a,b> (fst : a, snd : b) -> (a, b) // Is this an even integer? -pub fip fun is-evenstd/core/int/is-even: (i : int) -> bool(ii: int:intstd/core/types/int: V)result: -> total bool : boolstd/core/types/bool: V - !std/core/types/bool/(!): (b : bool) -> boolis-oddstd/core/int/is-odd: (i : int) -> bool(ii: int) +
pub fip fun is-evenstd/core/int/is-even: (i : int) -> bool(ii: int:intstd/core/types/int: V)result: -> total bool : boolstd/core/types/bool: V + !std/core/types/bool/(!): (b : bool) -> boolis-oddstd/core/int/is-odd: (i : int) -> bool(ii: int) // Is the integer positive (strictly greater than zero) -pub fip fun is-posstd/core/int/is-pos: (i : int) -> bool(ii: int : intstd/core/types/int: V )result: -> total bool : boolstd/core/types/bool: V +pub fip fun is-posstd/core/int/is-pos: (i : int) -> bool(ii: int : intstd/core/types/int: V )result: -> total bool : boolstd/core/types/bool: V ii: int >std/core/int/(>): (x : int, y : int) -> bool 0literal: int
dec = 0
hex8 = 0x00
bit8 = 0b00000000
// Is the integer negative (strictly smaller than zero) -pub fip fun is-negstd/core/int/is-neg: (i : int) -> bool(ii: int : intstd/core/types/int: V )result: -> total bool : boolstd/core/types/bool: V +pub fip fun is-negstd/core/int/is-neg: (i : int) -> bool(ii: int : intstd/core/types/int: V )result: -> total bool : boolstd/core/types/bool: V ii: int <std/core/int/(<): (x : int, y : int) -> bool 0literal: int
dec = 0
hex8 = 0x00
bit8 = 0b00000000
// Compare an integer `i` with zero -pub inline fip fun signstd/core/int/sign: (i : int) -> order( ^ii: int : intstd/core/types/int: V )result: -> total order : orderstd/core/types/order: V +pub inline fip fun signstd/core/int/sign: (i : int) -> order( ^ii: int : intstd/core/types/int: V )result: -> total order : orderstd/core/types/order: V cmpstd/core/int/cmp: (x : int, y : int) -> order(ii: int,0literal: int
dec = 0
hex8 = 0x00
bit8 = 0b00000000
) // c inline "kk_int_as_order(kk_integer_signum_borrow(#1,kk_context()),kk_context())" // cs "Primitive.IntSign" // js "$std_core_types._int_sign" // Return the minimum of two integers -pub fip fun minstd/core/int/min: (i : int, j : int) -> int( ii: int : intstd/core/types/int: V, jj: int : intstd/core/types/int: V )result: -> total int : intstd/core/types/int: V +pub fip fun minstd/core/int/min: (i : int, j : int) -> int( ii: int : intstd/core/types/int: V, jj: int : intstd/core/types/int: V )result: -> total int : intstd/core/types/int: V if ii: int <=std/core/int/(<=): (x : int, y : int) -> bool jj: int then ii: int else jj: int // Return the maximum of two integers -pub fip fun maxstd/core/int/max: (i : int, j : int) -> int( ii: int : intstd/core/types/int: V, jj: int : intstd/core/types/int: V )result: -> total int : intstd/core/types/int: V +pub fip fun maxstd/core/int/max: (i : int, j : int) -> int( ii: int : intstd/core/types/int: V, jj: int : intstd/core/types/int: V )result: -> total int : intstd/core/types/int: V if ii: int >=std/core/int/(>=): (x : int, y : int) -> bool jj: int then ii: int else jj: int // Transform an integer to a maybe type, using `Nothing` for `0` -pub fun maybestd/core/int/maybe: (i : int) -> maybe<int>( ii: int : intstd/core/types/int: V )result: -> total maybe<int> : maybestd/core/types/maybe: V -> V<intstd/core/types/int: V> - if ii: int==std/core/int/(==): (x : int, y : int) -> bool0literal: int
dec = 0
hex8 = 0x00
bit8 = 0b00000000
then Nothingstd/core/types/Nothing: forall<a> maybe<a> else Juststd/core/types/Just: forall<a> (value : a) -> maybe<a>(ii: int
) +
pub fun maybestd/core/int/maybe: (i : int) -> maybe<int>( ii: int : intstd/core/types/int: V )result: -> total maybe<int> : maybestd/core/types/maybe: V -> V<intstd/core/types/int: V> + if ii: int==std/core/int/(==): (x : int, y : int) -> bool0literal: int
dec = 0
hex8 = 0x00
bit8 = 0b00000000
then Nothingstd/core/types/Nothing: forall<a> maybe<a> else Juststd/core/types/Just: forall<a> (value : a) -> maybe<a>(ii: int
) // Convert an `:int` to a string -pub extern showstd/core/int/show: (i : int) -> string( ii: int : intstd/core/types/int: V ) : stringstd/core/types/string: V +pub extern showstd/core/int/show: (i : int) -> string( ii: int : intstd/core/types/int: V ) : stringstd/core/types/string: V c "kk_integer_to_string" cs inline "#1.ToString()" js inline "#1.toString()" // Convert an int to a boolean, using `False` for 0 and `True` otherwise. -pub fun boolstd/core/int/bool: (i : int) -> bool( ii: int : intstd/core/types/int: V )result: -> total bool : boolstd/core/types/bool: V +pub fun boolstd/core/int/bool: (i : int) -> bool( ii: int : intstd/core/types/int: V )result: -> total bool : boolstd/core/types/bool: V ii: int !=std/core/int/(!=): (x : int, y : int) -> bool 0literal: int
dec = 0
hex8 = 0x00
bit8 = 0b00000000
// Convert a `:maybe<int>` to an `:int` using zero for `Nothing` -pub fip fun mbintstd/core/int/mbint: (m : maybe<int>) -> int( mm: maybe<int> : maybestd/core/types/maybe: V -> V<intstd/core/types/int: V> )result: -> total int : intstd/core/types/int: V +pub fip fun mbintstd/core/int/mbint: (m : maybe<int>) -> int( mm: maybe<int> : maybestd/core/types/maybe: V -> V<intstd/core/types/int: V> )result: -> total int : intstd/core/types/int: V match mm: maybe<int> - Nothingstd/core/types/Nothing: forall<a> maybe<a> -> 0literal: int
dec = 0
hex8 = 0x00
bit8 = 0b00000000
- Juststd/core/types/Just: forall<a> (value : a) -> maybe<a>(ii: int) ->
ii: int + Nothingstd/core/types/Nothing: forall<a> maybe<a> -> 0literal: int
dec = 0
hex8 = 0x00
bit8 = 0b00000000
+ Juststd/core/types/Just: forall<a> (value : a) -> maybe<a>(ii: int) ->
ii: int // ---------------------------------------------------------------------------- @@ -301,10 +301,10 @@ // An empty string, or a string starting with white space will result in `Nothing` // A string can start with a `-` sign for negative numbers, // and with `0x` or `0X` for hexadecimal numbers (in which case the `hex` parameter is ignored). -pub fun parse-intstd/core/int/parse-int: (s : string, hex : ? bool) -> maybe<int>( ss: string : stringstd/core/types/string: V, hexhex: ? bool : boolstd/core/types/bool: V = Falsestd/core/types/False: bool)result: -> total maybe<int> : maybestd/core/types/maybe: V -> V<intstd/core/types/int: V> +pub fun parse-intstd/core/int/parse-int: (s : string, hex : ? bool) -> maybe<int>( ss: string : stringstd/core/types/string: V, hexhex: ? bool : boolstd/core/types/bool: V = Falsestd/core/types/False: bool)result: -> total maybe<int> : maybestd/core/types/maybe: V -> V<intstd/core/types/int: V> ss: string.xparsestd/core/int/xparse: (s : string, hex : bool) -> maybe<int>(hexhex: bool) -noinline extern xparsestd/core/int/xparse: (s : string, hex : bool) -> maybe<int>( ss: string : stringstd/core/types/string: V, hexhex: bool : boolstd/core/types/bool: V ) : maybestd/core/types/maybe: V -> V<intstd/core/types/int: V> +noinline extern xparsestd/core/int/xparse: (s : string, hex : bool) -> maybe<int>( ss: string : stringstd/core/types/string: V, hexhex: bool : boolstd/core/types/bool: V ) : maybestd/core/types/maybe: V -> V<intstd/core/types/int: V> c "kk_integer_xparse" cs "Primitive.IntParse" js "_int_parse" @@ -316,13 +316,13 @@ // ---------------------------------------------------------------------------- // clamp an `:int` to fit in an `:int8`. -pub fip extern int8std/core/int/int8: (i : int) -> int8( ii: int : intstd/core/types/int: V) : int8std/core/types/int8: V +pub fip extern int8std/core/int/int8: (i : int) -> int8( ii: int : intstd/core/types/int: V) : int8std/core/types/int8: V c "kk_integer_clamp_int8" cs "Primitive.IntToInt8" js "$std_core_types._int_clamp8" // Convert an `:int8` to an `:int`. -pub inline fip extern int8/intstd/core/int/int8/int: (i : int8) -> int( i : int8std/core/types/int8: V ) : intstd/core/types/int: V +pub inline fip extern int8/intstd/core/int/int8/int: (i : int8) -> int( i : int8std/core/types/int8: V ) : intstd/core/types/int: V c "kk_integer_from_int8" cs inline "(new BigInteger(#1))" js "$std_core_types._int_from_int32" @@ -330,26 +330,26 @@ // clamp an `:int` to fit in an `:int8` but interpret the `:int` as an unsigned 8-bit value, // and clamp between 0 and 255. -pub fip extern uint8std/core/int/uint8: (i : int) -> int8( ii: int : intstd/core/types/int: V) : int8std/core/types/int8: V +pub fip extern uint8std/core/int/uint8: (i : int) -> int8( ii: int : intstd/core/types/int: V) : int8std/core/types/int8: V c "kk_integer_clamp_byte" cs "Primitive.IntToUInt8" js "$std_core_types._int_clamp_byte" // Convert an `:int8` to an `:int` but interpret the `:int8` as an unsigned 8-bit value between 0 and 255. -pub inline fip extern int8/uintstd/core/int/int8/uint: (i : int8) -> int( i : int8std/core/types/int8: V ) : intstd/core/types/int: V +pub inline fip extern int8/uintstd/core/int/int8/uint: (i : int8) -> int( i : int8std/core/types/int8: V ) : intstd/core/types/int: V c "kk_integer_from_uint8" cs inline "(new BigInteger(#1 >= 0 ? #1 : 256 + #1))" js "$std_core_types._int_from_int32" // clamp an `:int` to fit in an `:int16`. -pub fip extern int16std/core/int/int16: (i : int) -> int16( ii: int : intstd/core/types/int: V) : int16std/core/types/int16: V +pub fip extern int16std/core/int/int16: (i : int) -> int16( ii: int : intstd/core/types/int: V) : int16std/core/types/int16: V c "kk_integer_clamp_int16" cs "Primitive.IntToInt16" js "$std_core_types._int_clamp16" // Convert an `:int16` to an `:int`. -pub inline fip extern int16/intstd/core/int/int16/int: (i : int16) -> int( i : int16std/core/types/int16: V ) : intstd/core/types/int: V +pub inline fip extern int16/intstd/core/int/int16/int: (i : int16) -> int( i : int16std/core/types/int16: V ) : intstd/core/types/int: V c "kk_integer_from_int16" cs inline "(new BigInteger(#1))" js "$std_core_types._int_from_int32" @@ -357,13 +357,13 @@ // clamp an `:int` to fit in an `:intptr_t`. -pub fip extern intptr_tstd/core/int/intptr_t: (i : int) -> intptr_t( ii: int : intstd/core/types/int: V) : intptr_tstd/core/types/intptr_t: V +pub fip extern intptr_tstd/core/int/intptr_t: (i : int) -> intptr_t( ii: int : intstd/core/types/int: V) : intptr_tstd/core/types/intptr_t: V c "kk_integer_clamp_intptr_t" cs "Primitive.IntToInt64" js "$std_core_types._int_clamp64" // Convert an `:intptr_t` to an `:int`. -pub inline fip extern intptr_t/intstd/core/int/intptr_t/int: (i : intptr_t) -> int( i : intptr_tstd/core/types/intptr_t: V ) : intstd/core/types/int: V +pub inline fip extern intptr_t/intstd/core/int/intptr_t/int: (i : intptr_t) -> int( i : intptr_tstd/core/types/intptr_t: V ) : intstd/core/types/int: V c "kk_integer_from_intptr_t" cs inline "(new BigInteger(#1))" js "$std_core_types._int_from_int64" @@ -371,13 +371,13 @@ // Convert an integer to an `:ssize_t`. The number is _clamped_ to the maximal or minimum `:ssize_t` // value if it is outside the range of an `:ssize_t`. // Needed for evidence indices in `module std/core/hnd` -pub fip extern ssize_tstd/core/int/ssize_t: (i : int) -> ssize_t( ii: int : intstd/core/types/int: V) : ssize_tstd/core/types/ssize_t: V +pub fip extern ssize_tstd/core/int/ssize_t: (i : int) -> ssize_t( ii: int : intstd/core/types/int: V) : ssize_tstd/core/types/ssize_t: V c "kk_integer_clamp_ssize_t" cs "Primitive.IntToInt32" js "$std_core_types._int_clamp32" // Convert an `:ssize_t` to an `:int`. -pub inline fip extern ssize_t/intstd/core/int/ssize_t/int: (i : ssize_t) -> int( i : ssize_tstd/core/types/ssize_t: V ) : intstd/core/types/int: V +pub inline fip extern ssize_t/intstd/core/int/ssize_t/int: (i : ssize_t) -> int( i : ssize_tstd/core/types/ssize_t: V ) : intstd/core/types/int: V c "kk_integer_from_ssize_t" cs inline "(new BigInteger(#1))" js "$std_core_types._int_from_int32" diff --git a/doc/std_core_int.html b/doc/std_core_int.html index 94bdc1708..5116090fd 100644 --- a/doc/std_core_int.html +++ b/doc/std_core_int.html @@ -15,10 +15,10 @@ -

std/core/int▲toc

+

std/core/int▲toc

-

Standard integer intstd/core/types/int: V functions.

+

Standard integer intstd/core/types/int: V functions.

@@ -32,101 +32,101 @@

Standard integer https://​www.​microsoft.​com/​en-​us/​research/​uploads/​prod/​2022/​07/​int.​pdf.

-
+ -
+ -
+
-

Convert an int8std/core/types/int8: V to an intstd/core/types/int: V but interpret the int8std/core/types/int8: V as an unsigned 8-bit value between 0 and 255. +

Convert an int8std/core/types/int8: V to an intstd/core/types/int: V but interpret the int8std/core/types/int8: V as an unsigned 8-bit value between 0 and 255.

-
+ -
+ -
+

Are two integers not equal?

-
+

Euclidean modulus of two integers; always a non-negative number. See also divmodstd/core/int/divmod: (x : int, y : int) -> (int, int).

-
+ -
+ -
+

Substract two integers.

-
+ -
+

Is the first integer smaller than the second?

-
+

Is the first integer smaller or equal to the second?

-
+

Are two integers equal?

-
+

Is the first integer greater than the second?

-
+

Is the first integer greater or equal to the second?

-
+

Raise an integer i to the power of exp.

-
+

Negate an integer.

-
+

Return the absolute value of an integer.

-
+
-

Convert an int to a boolean, using Falsestd/core/types/False: bool for 0 and Truestd/core/types/True: bool otherwise. +

Convert an int to a boolean, using Falsestd/core/types/False: bool for 0 and Truestd/core/types/True: bool otherwise.

- - -
+ + + -
+

Return the number of decimal digits of i. Return 0 when i(==)std/core/int/(==): (x : int, y : int) -> bool0.

-
+ -
+ - -
+ +

Calculate 10^exp.

-
+

Calculate 2^exp.

-
+ -
+ -
+ -
+ -
+

Is this an even integer?

-
+

Return the number of ending 0 digits of i. Return 0 when i(==)std/core/int/(==): (x : int, y : int) -> bool0.

-
+

Is the integer negative (strictly smaller than zero).

-
+

Is this an odd integer?

-
+

Is the integer positive (strictly greater than zero).

-
+

Is this equal to zero?

-
+

Return the maximum of two integers.

-
+
-

Transform an integer to a maybe type, using Nothingstd/core/types/Nothing: forall<a> maybe<a> for 0. +

Transform an integer to a maybe type, using Nothingstd/core/types/Nothing: forall<a> maybe<a> for 0.

-
+ -
+

Return the minimum of two integers.

- - - -
+ + + + -
+

Parse an integer. -If an illegal digit character is encountered Nothingstd/core/types/Nothing: forall<a> maybe<a> is returned. -An empty string, or a string starting with white space will result in Nothingstd/core/types/Nothing: forall<a> maybe<a> +If an illegal digit character is encountered Nothingstd/core/types/Nothing: forall<a> maybe<a> is returned. +An empty string, or a string starting with white space will result in Nothingstd/core/types/Nothing: forall<a> maybe<a> A string can start with a (-)std/core/int/(-): (x : int, y : int) -> int sign for negative numbers, and with 0x or 0X for hexadecimal numbers (in which case the hex parameter is ignored).

-
+

Raise an integer i to the power of exp.

-
+
-

Convert an intstd/core/types/int: V to a string. +

Convert an intstd/core/types/int: V to a string.

-
+

Compare an integer i with zero.

-
+
-

Convert an integer to an ssize_tstd/core/types/ssize_t: V. The number is clamped to the maximal or minimum ssize_tstd/core/types/ssize_t: V -value if it is outside the range of an ssize_tstd/core/types/ssize_t: V. -Needed for evidence indices in std/core/hnd. +

Convert an integer to an ssize_tstd/core/types/ssize_t: V. The number is clamped to the maximal or minimum ssize_tstd/core/types/ssize_t: V +value if it is outside the range of an ssize_tstd/core/types/ssize_t: V. +Needed for evidence indices in std/core/hndstd/core/hnd.

-
+
-

Clamp an intstd/core/types/int: V to fit in an int8std/core/types/int8: V but interpret the intstd/core/types/int: V as an unsigned 8-bit value, +

Clamp an intstd/core/types/int: V to fit in an int8std/core/types/int8: V but interpret the intstd/core/types/int: V as an unsigned 8-bit value, and clamp between 0 and 255.

- + diff --git a/doc/std_core_list-source.html b/doc/std_core_list-source.html index 6d038392d..abe687516 100644 --- a/doc/std_core_list-source.html +++ b/doc/std_core_list-source.html @@ -23,41 +23,41 @@ ---------------------------------------------------------------------------*/ // Standard `:list` functions. -module std/core/liststd/core/list +module std/core/liststd/core/list -import std/core/typesstd/core/types -import std/core/undivstd/core/undiv -import std/core/hndstd/core/hnd -import std/core/exnstd/core/exn -import std/core/charstd/core/char -import std/core/stringstd/core/string -import std/core/intstd/core/int -import std/core/vectorstd/core/vector +import std/core/typesstd/core/types +import std/core/undivstd/core/undiv +import std/core/hndstd/core/hnd +import std/core/exnstd/core/exn +import std/core/charstd/core/char +import std/core/stringstd/core/string +import std/core/intstd/core/int +import std/core/vectorstd/core/vector // Return the head of list if the list is not empty. -pub fun headstd/core/list/head: forall<a> (xs : list<a>) -> maybe<a>( xsxs: list<$562> : liststd/core/types/list: V -> V<aa: V> )result: -> total maybe<586> : maybestd/core/types/maybe: V -> V<aa: V> +pub fun headstd/core/list/head: forall<a> (xs : list<a>) -> maybe<a>( xsxs: list<$562> : liststd/core/types/list: V -> V<aa: V> )result: -> total maybe<586> : maybestd/core/types/maybe: V -> V<aa: V> match xsxs: list<$562> - Consstd/core/types/Cons: forall<a> (head : a, tail : list<a>) -> list<a>(xx: $562) -> Juststd/core/types/Just: forall<a> (value : a) -> maybe<a>(xx: $562) - _ -> Nothingstd/core/types/Nothing: forall<a> maybe<a> + Consstd/core/types/Cons: forall<a> (head : a, tail : list<a>) -> list<a>(xx: $562) -> Juststd/core/types/Just: forall<a> (value : a) -> maybe<a>(xx: $562) + _ -> Nothingstd/core/types/Nothing: forall<a> maybe<a> // Return the head of list with a default value in case the list is empty. -pub fun default/headstd/core/list/default/head: forall<a> (xs : list<a>, default : a) -> a( xsxs: list<$591> : liststd/core/types/list: V -> V<aa: V>, defaultdefault: $591 : aa: V )result: -> total 607 : astd/core/types/total: E +pub fun default/headstd/core/list/default/head: forall<a> (xs : list<a>, default : a) -> a( xsxs: list<$591> : liststd/core/types/list: V -> V<aa: V>, defaultdefault: $591 : aa: V )result: -> total 607 : astd/core/types/total: E match xsxs: list<$591> - Consstd/core/types/Cons: forall<a> (head : a, tail : list<a>) -> list<a>(xx: $591) -> xx: $591 + Consstd/core/types/Cons: forall<a> (head : a, tail : list<a>) -> list<a>(xx: $591) -> xx: $591 _ -> defaultdefault: $591 // Return the tail of list. Returns the empty list if `xs` is empty. -pub fun tailstd/core/list/tail: forall<a> (xs : list<a>) -> list<a>( xsxs: list<$612> : liststd/core/types/list: V -> V<aa: V> )result: -> total list<630> : liststd/core/types/list: V -> V<aa: V> +pub fun tailstd/core/list/tail: forall<a> (xs : list<a>) -> list<a>( xsxs: list<$612> : liststd/core/types/list: V -> V<aa: V> )result: -> total list<630> : liststd/core/types/list: V -> V<aa: V> match xsxs: list<$612> - Consstd/core/types/Cons: forall<a> (head : a, tail : list<a>) -> list<a>(_,xxxx: list<$612>) -> xxxx: list<$612> - _ -> [std/core/types/Nil: forall<a> list<a>]std/core/types/Nil: forall<a> list<a> + Consstd/core/types/Cons: forall<a> (head : a, tail : list<a>) -> list<a>(_,xxxx: list<$612>) -> xxxx: list<$612> + _ -> [std/core/types/Nil: forall<a> list<a>]std/core/types/Nil: forall<a> list<a> // Is the list empty? -pub fun is-emptystd/core/list/is-empty: forall<a> (xs : list<a>) -> bool( xsxs: list<$635> : liststd/core/types/list: V -> V<aa: V> )result: -> total bool : boolstd/core/types/bool: V +pub fun is-emptystd/core/list/is-empty: forall<a> (xs : list<a>) -> bool( xsxs: list<$635> : liststd/core/types/list: V -> V<aa: V> )result: -> total bool : boolstd/core/types/bool: V match xsxs: list<$635> - Nilstd/core/types/Nil: forall<a> list<a> -> Truestd/core/types/True: bool - _ -> Falsestd/core/types/False: bool + Nilstd/core/types/Nil: forall<a> list<a> -> Truestd/core/types/True: bool + _ -> Falsestd/core/types/False: bool // ---------------------------------------------------------------------------- @@ -65,498 +65,498 @@ // ---------------------------------------------------------------------------- // Returns a singleton list. -pub fun singlestd/core/list/single: forall<a> (x : a) -> list<a>(xx: _654)result: -> total list<667> - [std/core/types/Cons: forall<a> (head : a, tail : list<a>) -> list<a>xx: _654]std/core/types/Nil: forall<a> list<a> +pub fun singlestd/core/list/single: forall<a> (x : a) -> list<a>(xx: _654)result: -> total list<667> + [std/core/types/Cons: forall<a> (head : a, tail : list<a>) -> list<a>xx: _654]std/core/types/Nil: forall<a> list<a> // Returns the length of a list. -pub fun lengthstd/core/list/length: forall<a> (xs : list<a>) -> int(xsxs: list<_708>)result: -> total int +pub fun lengthstd/core/list/length: forall<a> (xs : list<a>) -> int(xsxs: list<_708>)result: -> total int fun lenlen: forall<a> (ys : list<a>, acc : int) -> int(ysys: list<_686>,accacc: int)result: -> total int match ysys: list<_686> - Consstd/core/types/Cons: forall<a> (head : a, tail : list<a>) -> list<a>(_,yyyy: list<_686>) -> yyyy: list<_686>.lenlen: (ys : list<_686>, acc : int) -> int(accacc: int+std/core/int/(+): (x : int, y : int) -> int1literal: int
dec = 1
hex8 = 0x01
bit8 = 0b00000001
) - Nilstd/core/types/Nil: forall<a> list<a> -> accacc: int
+ Consstd/core/types/Cons: forall<a> (head : a, tail : list<a>) -> list<a>(_,yyyy: list<_686>) -> yyyy: list<_686>.lenlen: (ys : list<_686>, acc : int) -> int(accacc: int+std/core/int/(+): (x : int, y : int) -> int1literal: int
dec = 1
hex8 = 0x01
bit8 = 0b00000001
) + Nilstd/core/types/Nil: forall<a> list<a> -> accacc: int
xsxs: list<_708>.lenlen: (ys : list<_708>, acc : int) -> int(0literal: int
dec = 0
hex8 = 0x00
bit8 = 0b00000000
) // Returns an integer list of increasing elements from `lo` to `hi` // (including both `lo` and `hi` ). // If `lo > hi` the function returns the empty list. -pub fun liststd/core/list/list: (lo : int, hi : int) -> list<int>( lolo: int: intstd/core/types/int: V, hihi: int: intstd/core/types/int: V )result: -> total list<int> : totalstd/core/types/total: E liststd/core/types/list: V -> V<intstd/core/types/int: V> - if lolo: int <=std/core/int/(<=): (x : int, y : int) -> bool hihi: int - then Consstd/core/types/Cons: forall<a> (head : a, tail : list<a>) -> list<a>( lolo: int, liststd/core/list/list: (lo : int, hi : int) -> list<int>( pretend-decreasingstd/core/undiv/pretend-decreasing: (x : int) -> int(lolo: int.incstd/core/int/inc: (i : int) -> int), hihi: int ) ) - else Nilstd/core/types/Nil: forall<a> list<a> +pub fun liststd/core/list/list: (lo : int, hi : int) -> list<int>( lolo: int: intstd/core/types/int: V, hihi: int: intstd/core/types/int: V )result: -> total list<int> : totalstd/core/types/total: E liststd/core/types/list: V -> V<intstd/core/types/int: V> + if lolo: int <=std/core/int/(<=): (x : int, y : int) -> bool hihi: int + then Consstd/core/types/Cons: forall<a> (head : a, tail : list<a>) -> list<a>( lolo: int, liststd/core/list/list: (lo : int, hi : int) -> list<int>( pretend-decreasingstd/core/undiv/pretend-decreasing: (x : int) -> int(lolo: int.incstd/core/int/inc: (i : int) -> int), hihi: int ) ) + else Nilstd/core/types/Nil: forall<a> list<a> // Returns an integer list of increasing elements from `lo` to `hi` with stride `stride`. // If `lo > hi` the function returns the empty list. -pub fun stride/liststd/core/list/stride/list: (lo : int, hi : int, stride : int) -> list<int>( lolo: int: intstd/core/types/int: V, hihi: int: intstd/core/types/int: V, stridestride: int : intstd/core/types/int: V )result: -> total list<int> : totalstd/core/types/total: E liststd/core/types/list: V -> V<intstd/core/types/int: V> - if lolo: int <=std/core/int/(<=): (x : int, y : int) -> bool hihi: int - then Consstd/core/types/Cons: forall<a> (head : a, tail : list<a>) -> list<a>( lolo: int, liststd/core/list/stride/list: (lo : int, hi : int, stride : int) -> list<int>( pretend-decreasingstd/core/undiv/pretend-decreasing: (x : int) -> int(lolo: int +std/core/int/(+): (x : int, y : int) -> int stridestride: int), hihi: int, stridestride: int )) - else Nilstd/core/types/Nil: forall<a> list<a> +pub fun stride/liststd/core/list/stride/list: (lo : int, hi : int, stride : int) -> list<int>( lolo: int: intstd/core/types/int: V, hihi: int: intstd/core/types/int: V, stridestride: int : intstd/core/types/int: V )result: -> total list<int> : totalstd/core/types/total: E liststd/core/types/list: V -> V<intstd/core/types/int: V> + if lolo: int <=std/core/int/(<=): (x : int, y : int) -> bool hihi: int + then Consstd/core/types/Cons: forall<a> (head : a, tail : list<a>) -> list<a>( lolo: int, liststd/core/list/stride/list: (lo : int, hi : int, stride : int) -> list<int>( pretend-decreasingstd/core/undiv/pretend-decreasing: (x : int) -> int(lolo: int +std/core/int/(+): (x : int, y : int) -> int stridestride: int), hihi: int, stridestride: int )) + else Nilstd/core/types/Nil: forall<a> list<a> // Applies a function `f` to list of increasing elements from `lo` to `hi` // (including both `lo` and `hi` ). // If `lo > hi` the function returns the empty list. -pub fun function/liststd/core/list/function/list: forall<a,e> (lo : int, hi : int, f : (int) -> e a) -> e list<a>( lolo: int: intstd/core/types/int: V, hihi: int: intstd/core/types/int: V, ff: (int) -> $1792 $1791 : intstd/core/types/int: V -> ee: E aa: V )result: -> 1846 list<1845> : ee: E liststd/core/types/list: V -> V<aa: V> - if lolo: int <=std/core/int/(<=): (x : int, y : int) -> $1792 bool hihi: int - then Consstd/core/types/Cons: forall<a> (head : a, tail : list<a>) -> list<a>( ff: (int) -> $1792 $1791(lolo: int), liststd/core/list/function/list: (lo : int, hi : int, f : (int) -> $1792 $1791) -> $1792 list<$1791>( pretend-decreasingstd/core/undiv/pretend-decreasing: (x : int) -> $1792 int(lolo: int.incstd/core/int/inc: (i : int) -> $1792 int), hihi: int, ff: (int) -> $1792 $1791 )) - else Nilstd/core/types/Nil: forall<a> list<a> +pub fun function/liststd/core/list/function/list: forall<a,e> (lo : int, hi : int, f : (int) -> e a) -> e list<a>( lolo: int: intstd/core/types/int: V, hihi: int: intstd/core/types/int: V, ff: (int) -> $1792 $1791 : intstd/core/types/int: V -> ee: E aa: V )result: -> 1846 list<1845> : ee: E liststd/core/types/list: V -> V<aa: V> + if lolo: int <=std/core/int/(<=): (x : int, y : int) -> $1792 bool hihi: int + then Consstd/core/types/Cons: forall<a> (head : a, tail : list<a>) -> list<a>( ff: (int) -> $1792 $1791(lolo: int), liststd/core/list/function/list: (lo : int, hi : int, f : (int) -> $1792 $1791) -> $1792 list<$1791>( pretend-decreasingstd/core/undiv/pretend-decreasing: (x : int) -> $1792 int(lolo: int.incstd/core/int/inc: (i : int) -> $1792 int), hihi: int, ff: (int) -> $1792 $1791 )) + else Nilstd/core/types/Nil: forall<a> list<a> // Returns an integer list of increasing elements from `lo` to `hi` with stride `stride`. // If `lo > hi` the function returns the empty list. -pub fun stridefunction/liststd/core/list/stridefunction/list: forall<a,e> (lo : int, hi : int, stride : int, f : (int) -> e a) -> e list<a>( lolo: int: intstd/core/types/int: V, hihi: int: intstd/core/types/int: V, stridestride: int : intstd/core/types/int: V, ff: (int) -> $1913 $1912 : intstd/core/types/int: V -> ee: E aa: V )result: -> 1969 list<1968> : ee: E liststd/core/types/list: V -> V<aa: V> - if lolo: int <=std/core/int/(<=): (x : int, y : int) -> $1913 bool hihi: int - then Consstd/core/types/Cons: forall<a> (head : a, tail : list<a>) -> list<a>( ff: (int) -> $1913 $1912(lolo: int), liststd/core/list/stridefunction/list: (lo : int, hi : int, stride : int, f : (int) -> $1913 $1912) -> $1913 list<$1912>( pretend-decreasingstd/core/undiv/pretend-decreasing: (x : int) -> $1913 int(lolo: int +std/core/int/(+): (x : int, y : int) -> $1913 int stridestride: int), hihi: int, stridestride: int, ff: (int) -> $1913 $1912 )) - else Nilstd/core/types/Nil: forall<a> list<a> +pub fun stridefunction/liststd/core/list/stridefunction/list: forall<a,e> (lo : int, hi : int, stride : int, f : (int) -> e a) -> e list<a>( lolo: int: intstd/core/types/int: V, hihi: int: intstd/core/types/int: V, stridestride: int : intstd/core/types/int: V, ff: (int) -> $1913 $1912 : intstd/core/types/int: V -> ee: E aa: V )result: -> 1969 list<1968> : ee: E liststd/core/types/list: V -> V<aa: V> + if lolo: int <=std/core/int/(<=): (x : int, y : int) -> $1913 bool hihi: int + then Consstd/core/types/Cons: forall<a> (head : a, tail : list<a>) -> list<a>( ff: (int) -> $1913 $1912(lolo: int), liststd/core/list/stridefunction/list: (lo : int, hi : int, stride : int, f : (int) -> $1913 $1912) -> $1913 list<$1912>( pretend-decreasingstd/core/undiv/pretend-decreasing: (x : int) -> $1913 int(lolo: int +std/core/int/(+): (x : int, y : int) -> $1913 int stridestride: int), hihi: int, stridestride: int, ff: (int) -> $1913 $1912 )) + else Nilstd/core/types/Nil: forall<a> list<a> // Create a list of characters from `lo` to `hi` (including `hi`). -pub fun char/liststd/core/list/char/list: (lo : char, hi : char) -> list<char>( lolo: char : charstd/core/types/char: V, hihi: char : charstd/core/types/char: V )result: -> total list<char> : totalstd/core/types/total: E liststd/core/types/list: V -> V<charstd/core/types/char: V> - liststd/core/list/list: (lo : int, hi : int) -> list<int>(lolo: char.intstd/core/char/int: (char) -> int, hihi: char.intstd/core/char/int: (char) -> int).mapstd/core/list/map: (xs : list<int>, f : (int) -> char) -> list<char>( charstd/core/char/int/char: (i : int) -> char ) +pub fun char/liststd/core/list/char/list: (lo : char, hi : char) -> list<char>( lolo: char : charstd/core/types/char: V, hihi: char : charstd/core/types/char: V )result: -> total list<char> : totalstd/core/types/total: E liststd/core/types/list: V -> V<charstd/core/types/char: V> + liststd/core/list/list: (lo : int, hi : int) -> list<int>(lolo: char.intstd/core/char/int: (char) -> int, hihi: char.intstd/core/char/int: (char) -> int).mapstd/core/list/map: (xs : list<int>, f : (int) -> char) -> list<char>( charstd/core/char/int/char: (i : int) -> char ) // Element-wise list equality -pub fun (==)std/core/list/(==): forall<a> (xs : list<a>, ys : list<a>, @implicit/(==) : (a, a) -> bool) -> bool( xsxs: list<$718> : liststd/core/types/list: V -> V<aa: V>, ysys: list<$718> : liststd/core/types/list: V -> V<aa: V>, (@implicit/==)?(==): ($718, $718) -> bool : (aa: V,aa: V) -> boolstd/core/types/bool: V )result: -> total bool : boolstd/core/types/bool: V +pub fun (==)std/core/list/(==): forall<a> (xs : list<a>, ys : list<a>, @implicit/(==) : (a, a) -> bool) -> bool( xsxs: list<$718> : liststd/core/types/list: V -> V<aa: V>, ysys: list<$718> : liststd/core/types/list: V -> V<aa: V>, (@implicit/==)?(==): ($718, $718) -> bool : (aa: V,aa: V) -> boolstd/core/types/bool: V )result: -> total bool : boolstd/core/types/bool: V match xsxs: list<$718> - Consstd/core/types/Cons: forall<a> (head : a, tail : list<a>) -> list<a>(xx: $718,xxxx: list<$718>) -> match ysys: list<$718> - Nilstd/core/types/Nil: forall<a> list<a> -> Falsestd/core/types/False: bool - Consstd/core/types/Cons: forall<a> (head : a, tail : list<a>) -> list<a>(yy: $718,yyyy: list<$718>) -> (xx: $718==?(==): ($718, $718) -> boolyy: $718) &&std/core/types/(&&): (x : bool, y : bool) -> bool (xxxx: list<$718>==std/core/list/(==): (xs : list<$718>, ys : list<$718>, @implicit/(==) : ($718, $718) -> bool) -> bool
?(==)=?(==)
yyyy: list<$718>) - Nilstd/core/types/Nil: forall<a> list<a> -> match ysys: list<$718> - Nilstd/core/types/Nil: forall<a> list<a> -> Truestd/core/types/True: bool - Consstd/core/types/Cons: forall<a> (head : a, tail : list<a>) -> list<a> -> Falsestd/core/types/False: bool
+ Consstd/core/types/Cons: forall<a> (head : a, tail : list<a>) -> list<a>(xx: $718,xxxx: list<$718>) -> match ysys: list<$718> + Nilstd/core/types/Nil: forall<a> list<a> -> Falsestd/core/types/False: bool + Consstd/core/types/Cons: forall<a> (head : a, tail : list<a>) -> list<a>(yy: $718,yyyy: list<$718>) -> (xx: $718==?(==): ($718, $718) -> boolyy: $718) &&std/core/types/(&&): (x : bool, y : bool) -> bool (xxxx: list<$718>==std/core/list/(==): (xs : list<$718>, ys : list<$718>, @implicit/(==) : ($718, $718) -> bool) -> bool
?(==)=?(==)
yyyy: list<$718>) + Nilstd/core/types/Nil: forall<a> list<a> -> match ysys: list<$718> + Nilstd/core/types/Nil: forall<a> list<a> -> Truestd/core/types/True: bool + Consstd/core/types/Cons: forall<a> (head : a, tail : list<a>) -> list<a> -> Falsestd/core/types/False: bool // Order on lists -pub fun cmpstd/core/list/cmp: forall<a> (xs : list<a>, ys : list<a>, @implicit/cmp : (a, a) -> order) -> order( xsxs: list<$795> : liststd/core/types/list: V -> V<aa: V>, ysys: list<$795> : liststd/core/types/list: V -> V<aa: V>, @implicit/cmp?cmp: ($795, $795) -> order : (aa: V,aa: V) -> orderstd/core/types/order: V )result: -> total order : orderstd/core/types/order: V +pub fun cmpstd/core/list/cmp: forall<a> (xs : list<a>, ys : list<a>, @implicit/cmp : (a, a) -> order) -> order( xsxs: list<$795> : liststd/core/types/list: V -> V<aa: V>, ysys: list<$795> : liststd/core/types/list: V -> V<aa: V>, @implicit/cmp?cmp: ($795, $795) -> order : (aa: V,aa: V) -> orderstd/core/types/order: V )result: -> total order : orderstd/core/types/order: V match xsxs: list<$795> - Consstd/core/types/Cons: forall<a> (head : a, tail : list<a>) -> list<a>(xx: $795,xxxx: list<$795>) -> match ysys: list<$795> - Nilstd/core/types/Nil: forall<a> list<a> -> Gtstd/core/types/Gt: order - Consstd/core/types/Cons: forall<a> (head : a, tail : list<a>) -> list<a>(yy: $795,yyyy: list<$795>) -> match cmp?cmp: ($795, $795) -> order(xx: $795,yy: $795) - Eqstd/core/types/Eq: order -> cmpstd/core/list/cmp: (xs : list<$795>, ys : list<$795>, @implicit/cmp : ($795, $795) -> order) -> order
?cmp=?cmp
(xxxx: list<$795>,yyyy: list<$795>) + Consstd/core/types/Cons: forall<a> (head : a, tail : list<a>) -> list<a>(xx: $795,xxxx: list<$795>) -> match ysys: list<$795> + Nilstd/core/types/Nil: forall<a> list<a> -> Gtstd/core/types/Gt: order + Consstd/core/types/Cons: forall<a> (head : a, tail : list<a>) -> list<a>(yy: $795,yyyy: list<$795>) -> match cmp?cmp: ($795, $795) -> order(xx: $795,yy: $795) + Eqstd/core/types/Eq: order -> cmpstd/core/list/cmp: (xs : list<$795>, ys : list<$795>, @implicit/cmp : ($795, $795) -> order) -> order
?cmp=?cmp
(xxxx: list<$795>,yyyy: list<$795>) lglg: order -> lglg: order - Nilstd/core/types/Nil: forall<a> list<a> -> match ysys: list<$795> - Nilstd/core/types/Nil: forall<a> list<a> -> Eqstd/core/types/Eq: order - Consstd/core/types/Cons: forall<a> (head : a, tail : list<a>) -> list<a> -> Ltstd/core/types/Lt: order
+ Nilstd/core/types/Nil: forall<a> list<a> -> match ysys: list<$795> + Nilstd/core/types/Nil: forall<a> list<a> -> Eqstd/core/types/Eq: order + Consstd/core/types/Cons: forall<a> (head : a, tail : list<a>) -> list<a> -> Ltstd/core/types/Lt: order // Show a list -pub fun showstd/core/list/show: forall<a,e> (xs : list<a>, @implicit/show : (a) -> e string) -> e string( xsxs: list<$3230> : liststd/core/types/list: V -> V<aa: V>, @implicit/show?show: ($3230) -> $3231 string : aa: V -> ee: E stringstd/core/types/string: V )result: -> 3296 string : ee: E stringstd/core/types/string: V - "["literal: string
count= 1
++std/core/types/(++): (x : string, y : string) -> $3231 string xsxs: list<$3230>.mapstd/core/list/map: (xs : list<$3230>, f : ($3230) -> $3231 string) -> $3231 list<string>(show?show: ($3230) -> $3231 string).joinstd/core/list/joinsep/join: (xs : list<string>, sep : string) -> $3231 string(","literal: string
count= 1
) ++std/core/types/(++): (x : string, y : string) -> $3231 string "]"literal: string
count= 1
+pub fun showstd/core/list/show: forall<a,e> (xs : list<a>, @implicit/show : (a) -> e string) -> e string( xsxs: list<$3230> : liststd/core/types/list: V -> V<aa: V>, @implicit/show?show: ($3230) -> $3231 string : aa: V -> ee: E stringstd/core/types/string: V )result: -> 3296 string : ee: E stringstd/core/types/string: V + "["literal: string
count= 1
++std/core/types/(++): (x : string, y : string) -> $3231 string xsxs: list<$3230>.mapstd/core/list/map: (xs : list<$3230>, f : ($3230) -> $3231 string) -> $3231 list<string>(show?show: ($3230) -> $3231 string).joinstd/core/list/joinsep/join: (xs : list<string>, sep : string) -> $3231 string(","literal: string
count= 1
) ++std/core/types/(++): (x : string, y : string) -> $3231 string "]"literal: string
count= 1
// _deprecated_, use `list/show` instead. -pub fun show-liststd/core/list/show-list: forall<a,e> (xs : list<a>, show-elem : (a) -> e string) -> e string( xsxs: list<$3313> : liststd/core/types/list: V -> V<aa: V>, show-elemshow-elem: ($3313) -> $3314 string : (aa: V) -> ee: E stringstd/core/types/string: V )result: -> 3335 string : ee: E stringstd/core/types/string: V +pub fun show-liststd/core/list/show-list: forall<a,e> (xs : list<a>, show-elem : (a) -> e string) -> e string( xsxs: list<$3313> : liststd/core/types/list: V -> V<aa: V>, show-elemshow-elem: ($3313) -> $3314 string : (aa: V) -> ee: E stringstd/core/types/string: V )result: -> 3335 string : ee: E stringstd/core/types/string: V showstd/core/list/show: (xs : list<$3313>, @implicit/show : ($3313) -> $3314 string) -> $3314 string(xsxs: list<$3313>,@implicit/show=show-elemshow-elem: ($3313) -> $3314 string) // Zip two lists together by pairing the corresponding elements. // The returned list is only as long as the smallest input list. -pub fun zipstd/core/list/zip: forall<a,b> (xs : list<a>, ys : list<b>) -> list<(a, b)>( xsxs: list<$3342> : liststd/core/types/list: V -> V<aa: V>, ysys: list<$3343> : liststd/core/types/list: V -> V<bb: V> )result: -> total list<(3404, 3405)> : liststd/core/types/list: V -> V<(std/core/types/tuple2: (V, V) -> Vaa: V,bb: V)> +pub fun zipstd/core/list/zip: forall<a,b> (xs : list<a>, ys : list<b>) -> list<(a, b)>( xsxs: list<$3342> : liststd/core/types/list: V -> V<aa: V>, ysys: list<$3343> : liststd/core/types/list: V -> V<bb: V> )result: -> total list<(3404, 3405)> : liststd/core/types/list: V -> V<(std/core/types/tuple2: (V, V) -> Vaa: V,bb: V)> match xsxs: list<$3342> - Consstd/core/types/Cons: forall<a> (head : a, tail : list<a>) -> list<a>(xx: $3342,xxxx: list<$3342>) -> match ysys: list<$3343> - Consstd/core/types/Cons: forall<a> (head : a, tail : list<a>) -> list<a>(yy: $3343,yyyy: list<$3343>) -> Consstd/core/types/Cons: forall<a> (head : a, tail : list<a>) -> list<a>((std/core/types/Tuple2: forall<a,b> (fst : a, snd : b) -> (a, b)xx: $3342,yy: $3343)std/core/types/Tuple2: forall<a,b> (fst : a, snd : b) -> (a, b),zipstd/core/list/zip: (xs : list<$3342>, ys : list<$3343>) -> list<($3342, $3343)>(xxxx: list<$3342>,yyyy: list<$3343>)) - Nilstd/core/types/Nil: forall<a> list<a> -> Nilstd/core/types/Nil: forall<a> list<a> - Nilstd/core/types/Nil: forall<a> list<a> -> Nilstd/core/types/Nil: forall<a> list<a> + Consstd/core/types/Cons: forall<a> (head : a, tail : list<a>) -> list<a>(xx: $3342,xxxx: list<$3342>) -> match ysys: list<$3343> + Consstd/core/types/Cons: forall<a> (head : a, tail : list<a>) -> list<a>(yy: $3343,yyyy: list<$3343>) -> Consstd/core/types/Cons: forall<a> (head : a, tail : list<a>) -> list<a>((std/core/types/Tuple2: forall<a,b> (fst : a, snd : b) -> (a, b)xx: $3342,yy: $3343)std/core/types/Tuple2: forall<a,b> (fst : a, snd : b) -> (a, b),zipstd/core/list/zip: (xs : list<$3342>, ys : list<$3343>) -> list<($3342, $3343)>(xxxx: list<$3342>,yyyy: list<$3343>)) + Nilstd/core/types/Nil: forall<a> list<a> -> Nilstd/core/types/Nil: forall<a> list<a> + Nilstd/core/types/Nil: forall<a> list<a> -> Nilstd/core/types/Nil: forall<a> list<a> // Zip two lists together by apply a function `f` to all corresponding elements. // The returned list is only as long as the smallest input list. -pub fun zipwithstd/core/list/zipwith: forall<a,b,c,e> (xs : list<a>, ys : list<b>, f : (a, b) -> e c) -> e list<c>( xsxs: list<$3413> : liststd/core/types/list: V -> V<aa: V>, ysys: list<$3414> :liststd/core/types/list: V -> V<bb: V>, ff: ($3413, $3414) -> $3416 $3415 : (aa: V,bb: V) -> ee: E cc: V )result: -> 3483 list<3482> : ee: E liststd/core/types/list: V -> V<cc: V> +pub fun zipwithstd/core/list/zipwith: forall<a,b,c,e> (xs : list<a>, ys : list<b>, f : (a, b) -> e c) -> e list<c>( xsxs: list<$3413> : liststd/core/types/list: V -> V<aa: V>, ysys: list<$3414> :liststd/core/types/list: V -> V<bb: V>, ff: ($3413, $3414) -> $3416 $3415 : (aa: V,bb: V) -> ee: E cc: V )result: -> 3483 list<3482> : ee: E liststd/core/types/list: V -> V<cc: V> match xsxs: list<$3413> - Consstd/core/types/Cons: forall<a> (head : a, tail : list<a>) -> list<a>(xx: $3413,xxxx: list<$3413>) -> match ysys: list<$3414> - Consstd/core/types/Cons: forall<a> (head : a, tail : list<a>) -> list<a>(yy: $3414,yyyy: list<$3414>) -> Consstd/core/types/Cons: forall<a> (head : a, tail : list<a>) -> list<a>(ff: ($3413, $3414) -> $3416 $3415(xx: $3413,yy: $3414),zipwithstd/core/list/zipwith: (xs : list<$3413>, ys : list<$3414>, f : ($3413, $3414) -> $3416 $3415) -> $3416 list<$3415>(xxxx: list<$3413>,yyyy: list<$3414>,ff: ($3413, $3414) -> $3416 $3415)) - Nilstd/core/types/Nil: forall<a> list<a> -> Nilstd/core/types/Nil: forall<a> list<a> - _ -> Nilstd/core/types/Nil: forall<a> list<a> + Consstd/core/types/Cons: forall<a> (head : a, tail : list<a>) -> list<a>(xx: $3413,xxxx: list<$3413>) -> match ysys: list<$3414> + Consstd/core/types/Cons: forall<a> (head : a, tail : list<a>) -> list<a>(yy: $3414,yyyy: list<$3414>) -> Consstd/core/types/Cons: forall<a> (head : a, tail : list<a>) -> list<a>(ff: ($3413, $3414) -> $3416 $3415(xx: $3413,yy: $3414),zipwithstd/core/list/zipwith: (xs : list<$3413>, ys : list<$3414>, f : ($3413, $3414) -> $3416 $3415) -> $3416 list<$3415>(xxxx: list<$3413>,yyyy: list<$3414>,ff: ($3413, $3414) -> $3416 $3415)) + Nilstd/core/types/Nil: forall<a> list<a> -> Nilstd/core/types/Nil: forall<a> list<a> + _ -> Nilstd/core/types/Nil: forall<a> list<a> // Zip two lists together by apply a function `f` to all corresponding elements // and their index in the list. // The returned list is only as long as the smallest input list. -pub fun zipwith-indexedstd/core/list/zipwith-indexed: forall<a,b,c,e> (xs0 : list<a>, ys0 : list<b>, f : (int, a, b) -> e c) -> e list<c>( xs0xs0: list<$3496> : liststd/core/types/list: V -> V<aa: V>, ys0ys0: list<$3497> :liststd/core/types/list: V -> V<bb: V>, ff: (int, $3496, $3497) -> $3499 $3498 : (intstd/core/types/int: V,aa: V,bb: V) -> ee: E cc: V )result: -> 3576 list<3575> : ee: E liststd/core/types/list: V -> V<cc: V> +pub fun zipwith-indexedstd/core/list/zipwith-indexed: forall<a,b,c,e> (xs0 : list<a>, ys0 : list<b>, f : (int, a, b) -> e c) -> e list<c>( xs0xs0: list<$3496> : liststd/core/types/list: V -> V<aa: V>, ys0ys0: list<$3497> :liststd/core/types/list: V -> V<bb: V>, ff: (int, $3496, $3497) -> $3499 $3498 : (intstd/core/types/int: V,aa: V,bb: V) -> ee: E cc: V )result: -> 3576 list<3575> : ee: E liststd/core/types/list: V -> V<cc: V> fun zipwith-iterzipwith-iter: (i : int, xs : list<$3496>, ys : list<$3497>) -> $3499 list<$3498>( ii: int, xsxs: list<$3496>, ysys: list<$3497> )result: -> $3499 list<$3498> match xsxs: list<$3496> - Consstd/core/types/Cons: forall<a> (head : a, tail : list<a>) -> list<a>(xx: $3496,xxxx: list<$3496>) -> match ysys: list<$3497> - Consstd/core/types/Cons: forall<a> (head : a, tail : list<a>) -> list<a>(yy: $3497,yyyy: list<$3497>) -> Consstd/core/types/Cons: forall<a> (head : a, tail : list<a>) -> list<a>(ff: (int, $3496, $3497) -> $3499 $3498(ii: int,xx: $3496,yy: $3497),zipwith-iterzipwith-iter: (i : int, xs : list<$3496>, ys : list<$3497>) -> $3499 list<$3498>(ii: int+std/core/int/(+): (x : int, y : int) -> $3499 int1literal: int
dec = 1
hex8 = 0x01
bit8 = 0b00000001
,xxxx: list<$3496>,yyyy: list<$3497>)) - Nilstd/core/types/Nil: forall<a> list<a> -> Nilstd/core/types/Nil: forall<a> list<a> - Nilstd/core/types/Nil: forall<a> list<a> -> Nilstd/core/types/Nil: forall<a> list<a>
+ Consstd/core/types/Cons: forall<a> (head : a, tail : list<a>) -> list<a>(xx: $3496,xxxx: list<$3496>) -> match ysys: list<$3497> + Consstd/core/types/Cons: forall<a> (head : a, tail : list<a>) -> list<a>(yy: $3497,yyyy: list<$3497>) -> Consstd/core/types/Cons: forall<a> (head : a, tail : list<a>) -> list<a>(ff: (int, $3496, $3497) -> $3499 $3498(ii: int,xx: $3496,yy: $3497),zipwith-iterzipwith-iter: (i : int, xs : list<$3496>, ys : list<$3497>) -> $3499 list<$3498>(ii: int+std/core/int/(+): (x : int, y : int) -> $3499 int1literal: int
dec = 1
hex8 = 0x01
bit8 = 0b00000001
,xxxx: list<$3496>,yyyy: list<$3497>)) + Nilstd/core/types/Nil: forall<a> list<a> -> Nilstd/core/types/Nil: forall<a> list<a> + Nilstd/core/types/Nil: forall<a> list<a> -> Nilstd/core/types/Nil: forall<a> list<a>
zipwith-iterzipwith-iter: (i : int, xs : list<$3496>, ys : list<$3497>) -> $3499 list<$3498>(0literal: int
dec = 0
hex8 = 0x00
bit8 = 0b00000000
,xs0xs0: list<$3496>,ys0ys0: list<$3497>) // Unzip a list of pairs into two lists -pub fun unzipstd/core/list/unzip: forall<a,b> (xs : list<(a, b)>) -> (list<a>, list<b>)( xsxs: list<($3589, $3590)> : liststd/core/types/list: V -> V<(std/core/types/tuple2: (V, V) -> Vaa: V,bb: V)> )result: -> total (list<3782>, list<3783>) : (std/core/types/tuple2: (V, V) -> Vliststd/core/types/list: V -> V<aa: V>,liststd/core/types/list: V -> V<bb: V>) +pub fun unzipstd/core/list/unzip: forall<a,b> (xs : list<(a, b)>) -> (list<a>, list<b>)( xsxs: list<($3589, $3590)> : liststd/core/types/list: V -> V<(std/core/types/tuple2: (V, V) -> Vaa: V,bb: V)> )result: -> total (list<3782>, list<3783>) : (std/core/types/tuple2: (V, V) -> Vliststd/core/types/list: V -> V<aa: V>,liststd/core/types/list: V -> V<bb: V>) // todo: implement TRMC for multiple results fun iteriter: forall<a,b,c,d> (ys : list<(a, b)>, acc1 : cctx<c,list<a>>, acc2 : cctx<d,list<b>>) -> (c, d)( ysys: list<(_3607, _3608)>, acc1acc1: cctx<_3649,list<_3607>>, acc2acc2: cctx<_3689,list<_3608>> )result: -> total (_3649, _3689) match ysys: list<(_3607, _3608)> - Consstd/core/types/Cons: forall<a> (head : a, tail : list<a>) -> list<a>((std/core/types/Tuple2: forall<a,b> (fst : a, snd : b) -> (a, b)xx: _3607,yy: _3608)std/core/types/Tuple2: forall<a,b> (fst : a, snd : b) -> (a, b),xxxx: list<(_3607, _3608)>) -> iteriter: (ys : list<(_3607, _3608)>, acc1 : cctx<_3649,list<_3607>>, acc2 : cctx<_3689,list<_3608>>) -> (_3649, _3689)(xxxx: list<(_3607, _3608)>,acc1acc1: cctx<_3649,list<_3607>> ++std/core/types/cctx/(++): (c1 : cctx<_3649,list<_3607>>, c2 : cctx<list<_3607>,list<_3607>>) -> cctx<_3649,list<_3607>> ctxctx: cctx<list<_3607>,list<_3607>> Consstd/core/types/Cons: forall<a> (head : a, tail : list<a>) -> list<a>(xx: _3607,_hole: list<_3607>),acc2acc2: cctx<_3689,list<_3608>> ++std/core/types/cctx/(++): (c1 : cctx<_3689,list<_3608>>, c2 : cctx<list<_3608>,list<_3608>>) -> cctx<_3689,list<_3608>> ctxctx: cctx<list<_3608>,list<_3608>> Consstd/core/types/Cons: forall<a> (head : a, tail : list<a>) -> list<a>(yy: _3608,_hole: list<_3608>)) - Nilstd/core/types/Nil: forall<a> list<a> -> (std/core/types/Tuple2: forall<a,b> (fst : a, snd : b) -> (a, b)acc1acc1: cctx<_3649,list<_3607>> ++.std/core/types/cctx/(++.): (c : cctx<_3649,list<_3607>>, x : list<_3607>) -> _3649 Nilstd/core/types/Nil: forall<a> list<a>,acc2acc2: cctx<_3689,list<_3608>> ++.std/core/types/cctx/(++.): (c : cctx<_3689,list<_3608>>, x : list<_3608>) -> _3689 Nilstd/core/types/Nil: forall<a> list<a>)std/core/types/Tuple2: forall<a,b> (fst : a, snd : b) -> (a, b) + Consstd/core/types/Cons: forall<a> (head : a, tail : list<a>) -> list<a>((std/core/types/Tuple2: forall<a,b> (fst : a, snd : b) -> (a, b)xx: _3607,yy: _3608)std/core/types/Tuple2: forall<a,b> (fst : a, snd : b) -> (a, b),xxxx: list<(_3607, _3608)>) -> iteriter: (ys : list<(_3607, _3608)>, acc1 : cctx<_3649,list<_3607>>, acc2 : cctx<_3689,list<_3608>>) -> (_3649, _3689)(xxxx: list<(_3607, _3608)>,acc1acc1: cctx<_3649,list<_3607>> ++std/core/types/cctx/(++): (c1 : cctx<_3649,list<_3607>>, c2 : cctx<list<_3607>,list<_3607>>) -> cctx<_3649,list<_3607>> ctxctx: cctx<list<_3607>,list<_3607>> Consstd/core/types/Cons: forall<a> (head : a, tail : list<a>) -> list<a>(xx: _3607,_hole: list<_3607>),acc2acc2: cctx<_3689,list<_3608>> ++std/core/types/cctx/(++): (c1 : cctx<_3689,list<_3608>>, c2 : cctx<list<_3608>,list<_3608>>) -> cctx<_3689,list<_3608>> ctxctx: cctx<list<_3608>,list<_3608>> Consstd/core/types/Cons: forall<a> (head : a, tail : list<a>) -> list<a>(yy: _3608,_hole: list<_3608>)) + Nilstd/core/types/Nil: forall<a> list<a> -> (std/core/types/Tuple2: forall<a,b> (fst : a, snd : b) -> (a, b)acc1acc1: cctx<_3649,list<_3607>> ++.std/core/types/cctx/(++.): (c : cctx<_3649,list<_3607>>, x : list<_3607>) -> _3649 Nilstd/core/types/Nil: forall<a> list<a>,acc2acc2: cctx<_3689,list<_3608>> ++.std/core/types/cctx/(++.): (c : cctx<_3689,list<_3608>>, x : list<_3608>) -> _3689 Nilstd/core/types/Nil: forall<a> list<a>)std/core/types/Tuple2: forall<a,b> (fst : a, snd : b) -> (a, b) iteriter: (ys : list<($3589, $3590)>, acc1 : cctx<list<$3589>,list<$3589>>, acc2 : cctx<list<$3590>,list<$3590>>) -> (list<$3589>, list<$3590>)(xsxs: list<($3589, $3590)>,ctxctx: ctx<list<$3589>> _hole: list<$3589>,ctxctx: ctx<list<$3590>> _hole: list<$3590>) // Unzip a list of triples into three lists -pub fun unzip3std/core/list/unzip3: forall<a,b,c> (xs : list<(a, b, c)>) -> (list<a>, list<b>, list<c>)( xsxs: list<($3791, $3792, $3793)> : liststd/core/types/list: V -> V<(std/core/types/tuple3: (V, V, V) -> Vaa: V,bb: V,cc: V)>)result: -> total (list<4067>, list<4068>, list<4069>) : (std/core/types/tuple3: (V, V, V) -> Vliststd/core/types/list: V -> V<aa: V>,liststd/core/types/list: V -> V<bb: V>,liststd/core/types/list: V -> V<cc: V>) +pub fun unzip3std/core/list/unzip3: forall<a,b,c> (xs : list<(a, b, c)>) -> (list<a>, list<b>, list<c>)( xsxs: list<($3791, $3792, $3793)> : liststd/core/types/list: V -> V<(std/core/types/tuple3: (V, V, V) -> Vaa: V,bb: V,cc: V)>)result: -> total (list<4067>, list<4068>, list<4069>) : (std/core/types/tuple3: (V, V, V) -> Vliststd/core/types/list: V -> V<aa: V>,liststd/core/types/list: V -> V<bb: V>,liststd/core/types/list: V -> V<cc: V>) // todo: implement TRMC for multiple results fun iteriter: forall<a,b,c,d,a1,b1> (ys : list<(a, b, c)>, acc1 : cctx<d,list<a>>, acc2 : cctx<a1,list<b>>, acc3 : cctx<b1,list<c>>) -> (d, a1, b1)( ysys: list<(_3813, _3814, _3815)>, acc1acc1: cctx<_3856,list<_3813>>, acc2acc2: cctx<_3896,list<_3814>>, acc3acc3: cctx<_3936,list<_3815>> )result: -> total (_3856, _3896, _3936) match ysys: list<(_3813, _3814, _3815)> - Consstd/core/types/Cons: forall<a> (head : a, tail : list<a>) -> list<a>((std/core/types/Tuple3: forall<a,b,c> (fst : a, snd : b, thd : c) -> (a, b, c)xx: _3813,yy: _3814,zz: _3815)std/core/types/Tuple3: forall<a,b,c> (fst : a, snd : b, thd : c) -> (a, b, c),xxxx: list<(_3813, _3814, _3815)>) -> iteriter: (ys : list<(_3813, _3814, _3815)>, acc1 : cctx<_3856,list<_3813>>, acc2 : cctx<_3896,list<_3814>>, acc3 : cctx<_3936,list<_3815>>) -> (_3856, _3896, _3936)(xxxx: list<(_3813, _3814, _3815)>,acc1acc1: cctx<_3856,list<_3813>> ++std/core/types/cctx/(++): (c1 : cctx<_3856,list<_3813>>, c2 : cctx<list<_3813>,list<_3813>>) -> cctx<_3856,list<_3813>> ctxctx: cctx<list<_3813>,list<_3813>> Consstd/core/types/Cons: forall<a> (head : a, tail : list<a>) -> list<a>(xx: _3813,_hole: list<_3813>),acc2acc2: cctx<_3896,list<_3814>> ++std/core/types/cctx/(++): (c1 : cctx<_3896,list<_3814>>, c2 : cctx<list<_3814>,list<_3814>>) -> cctx<_3896,list<_3814>> ctxctx: cctx<list<_3814>,list<_3814>> Consstd/core/types/Cons: forall<a> (head : a, tail : list<a>) -> list<a>(yy: _3814,_hole: list<_3814>),acc3acc3: cctx<_3936,list<_3815>> ++std/core/types/cctx/(++): (c1 : cctx<_3936,list<_3815>>, c2 : cctx<list<_3815>,list<_3815>>) -> cctx<_3936,list<_3815>> ctxctx: cctx<list<_3815>,list<_3815>> Consstd/core/types/Cons: forall<a> (head : a, tail : list<a>) -> list<a>(zz: _3815,_hole: list<_3815>)) - Nilstd/core/types/Nil: forall<a> list<a> -> (std/core/types/Tuple3: forall<a,b,c> (fst : a, snd : b, thd : c) -> (a, b, c)acc1acc1: cctx<_3856,list<_3813>> ++.std/core/types/cctx/(++.): (c : cctx<_3856,list<_3813>>, x : list<_3813>) -> _3856 Nilstd/core/types/Nil: forall<a> list<a>,acc2acc2: cctx<_3896,list<_3814>> ++.std/core/types/cctx/(++.): (c : cctx<_3896,list<_3814>>, x : list<_3814>) -> _3896 Nilstd/core/types/Nil: forall<a> list<a>,acc3acc3: cctx<_3936,list<_3815>> ++.std/core/types/cctx/(++.): (c : cctx<_3936,list<_3815>>, x : list<_3815>) -> _3936 Nilstd/core/types/Nil: forall<a> list<a>)std/core/types/Tuple3: forall<a,b,c> (fst : a, snd : b, thd : c) -> (a, b, c) + Consstd/core/types/Cons: forall<a> (head : a, tail : list<a>) -> list<a>((std/core/types/Tuple3: forall<a,b,c> (fst : a, snd : b, thd : c) -> (a, b, c)xx: _3813,yy: _3814,zz: _3815)std/core/types/Tuple3: forall<a,b,c> (fst : a, snd : b, thd : c) -> (a, b, c),xxxx: list<(_3813, _3814, _3815)>) -> iteriter: (ys : list<(_3813, _3814, _3815)>, acc1 : cctx<_3856,list<_3813>>, acc2 : cctx<_3896,list<_3814>>, acc3 : cctx<_3936,list<_3815>>) -> (_3856, _3896, _3936)(xxxx: list<(_3813, _3814, _3815)>,acc1acc1: cctx<_3856,list<_3813>> ++std/core/types/cctx/(++): (c1 : cctx<_3856,list<_3813>>, c2 : cctx<list<_3813>,list<_3813>>) -> cctx<_3856,list<_3813>> ctxctx: cctx<list<_3813>,list<_3813>> Consstd/core/types/Cons: forall<a> (head : a, tail : list<a>) -> list<a>(xx: _3813,_hole: list<_3813>),acc2acc2: cctx<_3896,list<_3814>> ++std/core/types/cctx/(++): (c1 : cctx<_3896,list<_3814>>, c2 : cctx<list<_3814>,list<_3814>>) -> cctx<_3896,list<_3814>> ctxctx: cctx<list<_3814>,list<_3814>> Consstd/core/types/Cons: forall<a> (head : a, tail : list<a>) -> list<a>(yy: _3814,_hole: list<_3814>),acc3acc3: cctx<_3936,list<_3815>> ++std/core/types/cctx/(++): (c1 : cctx<_3936,list<_3815>>, c2 : cctx<list<_3815>,list<_3815>>) -> cctx<_3936,list<_3815>> ctxctx: cctx<list<_3815>,list<_3815>> Consstd/core/types/Cons: forall<a> (head : a, tail : list<a>) -> list<a>(zz: _3815,_hole: list<_3815>)) + Nilstd/core/types/Nil: forall<a> list<a> -> (std/core/types/Tuple3: forall<a,b,c> (fst : a, snd : b, thd : c) -> (a, b, c)acc1acc1: cctx<_3856,list<_3813>> ++.std/core/types/cctx/(++.): (c : cctx<_3856,list<_3813>>, x : list<_3813>) -> _3856 Nilstd/core/types/Nil: forall<a> list<a>,acc2acc2: cctx<_3896,list<_3814>> ++.std/core/types/cctx/(++.): (c : cctx<_3896,list<_3814>>, x : list<_3814>) -> _3896 Nilstd/core/types/Nil: forall<a> list<a>,acc3acc3: cctx<_3936,list<_3815>> ++.std/core/types/cctx/(++.): (c : cctx<_3936,list<_3815>>, x : list<_3815>) -> _3936 Nilstd/core/types/Nil: forall<a> list<a>)std/core/types/Tuple3: forall<a,b,c> (fst : a, snd : b, thd : c) -> (a, b, c) iteriter: (ys : list<($3791, $3792, $3793)>, acc1 : cctx<list<$3791>,list<$3791>>, acc2 : cctx<list<$3792>,list<$3792>>, acc3 : cctx<list<$3793>,list<$3793>>) -> (list<$3791>, list<$3792>, list<$3793>)(xsxs: list<($3791, $3792, $3793)>,ctxctx: ctx<list<$3791>> _hole: list<$3791>,ctxctx: ctx<list<$3792>> _hole: list<$3792>,ctxctx: ctx<list<$3793>> _hole: list<$3793>) // Unzip a list of quadruples into four lists -pub fun unzip4std/core/list/unzip4: forall<a,b,c,d> (xs : list<(a, b, c, d)>) -> (list<a>, list<b>, list<c>, list<d>)( xsxs: list<($4080, $4081, $4082, $4083)> : liststd/core/types/list: V -> V<(std/core/types/tuple4: (V, V, V, V) -> Vaa: V,bb: V,cc: V,dd: V)>)result: -> total (list<4439>, list<4440>, list<4441>, list<4442>) : (std/core/types/tuple4: (V, V, V, V) -> Vliststd/core/types/list: V -> V<aa: V>,liststd/core/types/list: V -> V<bb: V>,liststd/core/types/list: V -> V<cc: V>,liststd/core/types/list: V -> V<dd: V>) +pub fun unzip4std/core/list/unzip4: forall<a,b,c,d> (xs : list<(a, b, c, d)>) -> (list<a>, list<b>, list<c>, list<d>)( xsxs: list<($4080, $4081, $4082, $4083)> : liststd/core/types/list: V -> V<(std/core/types/tuple4: (V, V, V, V) -> Vaa: V,bb: V,cc: V,dd: V)>)result: -> total (list<4439>, list<4440>, list<4441>, list<4442>) : (std/core/types/tuple4: (V, V, V, V) -> Vliststd/core/types/list: V -> V<aa: V>,liststd/core/types/list: V -> V<bb: V>,liststd/core/types/list: V -> V<cc: V>,liststd/core/types/list: V -> V<dd: V>) // todo: implement TRMC for multiple results fun iteriter: forall<a,b,c,d,a1,b1,c1,d1> (ys : list<(a, b, c, d)>, acc1 : cctx<a1,list<a>>, acc2 : cctx<b1,list<b>>, acc3 : cctx<c1,list<c>>, acc4 : cctx<d1,list<d>>) -> (a1, b1, c1, d1)( ysys: list<(_4106, _4107, _4108, _4109)>, acc1acc1: cctx<_4150,list<_4106>>, acc2acc2: cctx<_4190,list<_4107>>, acc3acc3: cctx<_4230,list<_4108>>, acc4acc4: cctx<_4270,list<_4109>> )result: -> total (_4150, _4190, _4230, _4270) match ysys: list<(_4106, _4107, _4108, _4109)> - Consstd/core/types/Cons: forall<a> (head : a, tail : list<a>) -> list<a>((std/core/types/Tuple4: forall<a,b,c,d> (fst : a, snd : b, thd : c, field4 : d) -> (a, b, c, d)xx: _4106,yy: _4107,zz: _4108,ww: _4109)std/core/types/Tuple4: forall<a,b,c,d> (fst : a, snd : b, thd : c, field4 : d) -> (a, b, c, d),xxxx: list<(_4106, _4107, _4108, _4109)>) -> iteriter: (ys : list<(_4106, _4107, _4108, _4109)>, acc1 : cctx<_4150,list<_4106>>, acc2 : cctx<_4190,list<_4107>>, acc3 : cctx<_4230,list<_4108>>, acc4 : cctx<_4270,list<_4109>>) -> (_4150, _4190, _4230, _4270)(xxxx: list<(_4106, _4107, _4108, _4109)>,acc1acc1: cctx<_4150,list<_4106>> ++std/core/types/cctx/(++): (c1 : cctx<_4150,list<_4106>>, c2 : cctx<list<_4106>,list<_4106>>) -> cctx<_4150,list<_4106>> ctxctx: cctx<list<_4106>,list<_4106>> Consstd/core/types/Cons: forall<a> (head : a, tail : list<a>) -> list<a>(xx: _4106,_hole: list<_4106>),acc2acc2: cctx<_4190,list<_4107>> ++std/core/types/cctx/(++): (c1 : cctx<_4190,list<_4107>>, c2 : cctx<list<_4107>,list<_4107>>) -> cctx<_4190,list<_4107>> ctxctx: cctx<list<_4107>,list<_4107>> Consstd/core/types/Cons: forall<a> (head : a, tail : list<a>) -> list<a>(yy: _4107,_hole: list<_4107>),acc3acc3: cctx<_4230,list<_4108>> ++std/core/types/cctx/(++): (c1 : cctx<_4230,list<_4108>>, c2 : cctx<list<_4108>,list<_4108>>) -> cctx<_4230,list<_4108>> ctxctx: cctx<list<_4108>,list<_4108>> Consstd/core/types/Cons: forall<a> (head : a, tail : list<a>) -> list<a>(zz: _4108,_hole: list<_4108>),acc4acc4: cctx<_4270,list<_4109>> ++std/core/types/cctx/(++): (c1 : cctx<_4270,list<_4109>>, c2 : cctx<list<_4109>,list<_4109>>) -> cctx<_4270,list<_4109>> ctxctx: cctx<list<_4109>,list<_4109>> Consstd/core/types/Cons: forall<a> (head : a, tail : list<a>) -> list<a>(ww: _4109,_hole: list<_4109>)) - Nilstd/core/types/Nil: forall<a> list<a> -> (std/core/types/Tuple4: forall<a,b,c,d> (fst : a, snd : b, thd : c, field4 : d) -> (a, b, c, d)acc1acc1: cctx<_4150,list<_4106>> ++.std/core/types/cctx/(++.): (c : cctx<_4150,list<_4106>>, x : list<_4106>) -> _4150 Nilstd/core/types/Nil: forall<a> list<a>,acc2acc2: cctx<_4190,list<_4107>> ++.std/core/types/cctx/(++.): (c : cctx<_4190,list<_4107>>, x : list<_4107>) -> _4190 Nilstd/core/types/Nil: forall<a> list<a>,acc3acc3: cctx<_4230,list<_4108>> ++.std/core/types/cctx/(++.): (c : cctx<_4230,list<_4108>>, x : list<_4108>) -> _4230 Nilstd/core/types/Nil: forall<a> list<a>,acc4acc4: cctx<_4270,list<_4109>> ++.std/core/types/cctx/(++.): (c : cctx<_4270,list<_4109>>, x : list<_4109>) -> _4270 Nilstd/core/types/Nil: forall<a> list<a>)std/core/types/Tuple4: forall<a,b,c,d> (fst : a, snd : b, thd : c, field4 : d) -> (a, b, c, d) + Consstd/core/types/Cons: forall<a> (head : a, tail : list<a>) -> list<a>((std/core/types/Tuple4: forall<a,b,c,d> (fst : a, snd : b, thd : c, field4 : d) -> (a, b, c, d)xx: _4106,yy: _4107,zz: _4108,ww: _4109)std/core/types/Tuple4: forall<a,b,c,d> (fst : a, snd : b, thd : c, field4 : d) -> (a, b, c, d),xxxx: list<(_4106, _4107, _4108, _4109)>) -> iteriter: (ys : list<(_4106, _4107, _4108, _4109)>, acc1 : cctx<_4150,list<_4106>>, acc2 : cctx<_4190,list<_4107>>, acc3 : cctx<_4230,list<_4108>>, acc4 : cctx<_4270,list<_4109>>) -> (_4150, _4190, _4230, _4270)(xxxx: list<(_4106, _4107, _4108, _4109)>,acc1acc1: cctx<_4150,list<_4106>> ++std/core/types/cctx/(++): (c1 : cctx<_4150,list<_4106>>, c2 : cctx<list<_4106>,list<_4106>>) -> cctx<_4150,list<_4106>> ctxctx: cctx<list<_4106>,list<_4106>> Consstd/core/types/Cons: forall<a> (head : a, tail : list<a>) -> list<a>(xx: _4106,_hole: list<_4106>),acc2acc2: cctx<_4190,list<_4107>> ++std/core/types/cctx/(++): (c1 : cctx<_4190,list<_4107>>, c2 : cctx<list<_4107>,list<_4107>>) -> cctx<_4190,list<_4107>> ctxctx: cctx<list<_4107>,list<_4107>> Consstd/core/types/Cons: forall<a> (head : a, tail : list<a>) -> list<a>(yy: _4107,_hole: list<_4107>),acc3acc3: cctx<_4230,list<_4108>> ++std/core/types/cctx/(++): (c1 : cctx<_4230,list<_4108>>, c2 : cctx<list<_4108>,list<_4108>>) -> cctx<_4230,list<_4108>> ctxctx: cctx<list<_4108>,list<_4108>> Consstd/core/types/Cons: forall<a> (head : a, tail : list<a>) -> list<a>(zz: _4108,_hole: list<_4108>),acc4acc4: cctx<_4270,list<_4109>> ++std/core/types/cctx/(++): (c1 : cctx<_4270,list<_4109>>, c2 : cctx<list<_4109>,list<_4109>>) -> cctx<_4270,list<_4109>> ctxctx: cctx<list<_4109>,list<_4109>> Consstd/core/types/Cons: forall<a> (head : a, tail : list<a>) -> list<a>(ww: _4109,_hole: list<_4109>)) + Nilstd/core/types/Nil: forall<a> list<a> -> (std/core/types/Tuple4: forall<a,b,c,d> (fst : a, snd : b, thd : c, field4 : d) -> (a, b, c, d)acc1acc1: cctx<_4150,list<_4106>> ++.std/core/types/cctx/(++.): (c : cctx<_4150,list<_4106>>, x : list<_4106>) -> _4150 Nilstd/core/types/Nil: forall<a> list<a>,acc2acc2: cctx<_4190,list<_4107>> ++.std/core/types/cctx/(++.): (c : cctx<_4190,list<_4107>>, x : list<_4107>) -> _4190 Nilstd/core/types/Nil: forall<a> list<a>,acc3acc3: cctx<_4230,list<_4108>> ++.std/core/types/cctx/(++.): (c : cctx<_4230,list<_4108>>, x : list<_4108>) -> _4230 Nilstd/core/types/Nil: forall<a> list<a>,acc4acc4: cctx<_4270,list<_4109>> ++.std/core/types/cctx/(++.): (c : cctx<_4270,list<_4109>>, x : list<_4109>) -> _4270 Nilstd/core/types/Nil: forall<a> list<a>)std/core/types/Tuple4: forall<a,b,c,d> (fst : a, snd : b, thd : c, field4 : d) -> (a, b, c, d) iteriter: (ys : list<($4080, $4081, $4082, $4083)>, acc1 : cctx<list<$4080>,list<$4080>>, acc2 : cctx<list<$4081>,list<$4081>>, acc3 : cctx<list<$4082>,list<$4082>>, acc4 : cctx<list<$4083>,list<$4083>>) -> (list<$4080>, list<$4081>, list<$4082>, list<$4083>)(xsxs: list<($4080, $4081, $4082, $4083)>,ctxctx: ctx<list<$4080>> _hole: list<$4080>,ctxctx: ctx<list<$4081>> _hole: list<$4081>,ctxctx: ctx<list<$4082>> _hole: list<$4082>,ctxctx: ctx<list<$4083>> _hole: list<$4083>) // Take the first `n` elements of a list (or fewer if the list is shorter than `n`) -pub fun takestd/core/list/take: forall<a> (xs : list<a>, n : int) -> list<a>( xsxs: list<$865> : liststd/core/types/list: V -> V<aa: V>, nn: int : intstd/core/types/int: V )result: -> total list<906> : liststd/core/types/list: V -> V<aa: V> +pub fun takestd/core/list/take: forall<a> (xs : list<a>, n : int) -> list<a>( xsxs: list<$865> : liststd/core/types/list: V -> V<aa: V>, nn: int : intstd/core/types/int: V )result: -> total list<906> : liststd/core/types/list: V -> V<aa: V> match xsxs: list<$865> - Consstd/core/types/Cons: forall<a> (head : a, tail : list<a>) -> list<a>(xx: $865,xxxx: list<$865>) | nn: int >std/core/int/(>): (x : int, y : int) -> bool 0literal: int
dec = 0
hex8 = 0x00
bit8 = 0b00000000
-> Consstd/core/types/Cons: forall<a> (head : a, tail : list<a>) -> list<a>(xx: $865, takestd/core/list/take: (xs : list<$865>, n : int) -> list<$865>(xxxx: list<$865>, nn: int -std/core/int/(-): (x : int, y : int) -> int 1literal: int
dec = 1
hex8 = 0x01
bit8 = 0b00000001
)) - _ -> Nilstd/core/types/Nil: forall<a> list<a>
+ Consstd/core/types/Cons: forall<a> (head : a, tail : list<a>) -> list<a>(xx: $865,xxxx: list<$865>) | nn: int >std/core/int/(>): (x : int, y : int) -> bool 0literal: int
dec = 0
hex8 = 0x00
bit8 = 0b00000000
-> Consstd/core/types/Cons: forall<a> (head : a, tail : list<a>) -> list<a>(xx: $865, takestd/core/list/take: (xs : list<$865>, n : int) -> list<$865>(xxxx: list<$865>, nn: int -std/core/int/(-): (x : int, y : int) -> int 1literal: int
dec = 1
hex8 = 0x01
bit8 = 0b00000001
)) + _ -> Nilstd/core/types/Nil: forall<a> list<a> // Drop the first `n` elements of a list (or fewer if the list is shorter than `n`) -pub fun dropstd/core/list/drop: forall<a> (xs : list<a>, n : int) -> list<a>( xsxs: list<$911> : liststd/core/types/list: V -> V<aa: V>, nn: int : intstd/core/types/int: V )result: -> total list<943> : liststd/core/types/list: V -> V<aa: V> +pub fun dropstd/core/list/drop: forall<a> (xs : list<a>, n : int) -> list<a>( xsxs: list<$911> : liststd/core/types/list: V -> V<aa: V>, nn: int : intstd/core/types/int: V )result: -> total list<943> : liststd/core/types/list: V -> V<aa: V> match xsxs: list<$911> - Consstd/core/types/Cons: forall<a> (head : a, tail : list<a>) -> list<a>(_,xxxx: list<$911>) | nn: int >std/core/int/(>): (x : int, y : int) -> bool 0literal: int
dec = 0
hex8 = 0x00
bit8 = 0b00000000
-> dropstd/core/list/drop: (xs : list<$911>, n : int) -> list<$911>(xxxx: list<$911>, nn: int -std/core/int/(-): (x : int, y : int) -> int 1literal: int
dec = 1
hex8 = 0x01
bit8 = 0b00000001
) + Consstd/core/types/Cons: forall<a> (head : a, tail : list<a>) -> list<a>(_,xxxx: list<$911>) | nn: int >std/core/int/(>): (x : int, y : int) -> bool 0literal: int
dec = 0
hex8 = 0x00
bit8 = 0b00000000
-> dropstd/core/list/drop: (xs : list<$911>, n : int) -> list<$911>(xxxx: list<$911>, nn: int -std/core/int/(-): (x : int, y : int) -> int 1literal: int
dec = 1
hex8 = 0x01
bit8 = 0b00000001
) _ -> xsxs: list<$911>
// Apply a function `f` to each element of the input list in sequence. -pub fun mapstd/core/list/map: forall<a,b,e> (xs : list<a>, f : (a) -> e b) -> e list<b>(xsxs: list<$2019> : liststd/core/types/list: V -> V<aa: V>, ff: ($2019) -> $2021 $2020 : aa: V -> ee: E bb: V)result: -> 2072 list<2071> : ee: E liststd/core/types/list: V -> V<bb: V> +pub fun mapstd/core/list/map: forall<a,b,e> (xs : list<a>, f : (a) -> e b) -> e list<b>(xsxs: list<$2019> : liststd/core/types/list: V -> V<aa: V>, ff: ($2019) -> $2021 $2020 : aa: V -> ee: E bb: V)result: -> 2072 list<2071> : ee: E liststd/core/types/list: V -> V<bb: V> match xsxs: list<$2019> - Consstd/core/types/Cons: forall<a> (head : a, tail : list<a>) -> list<a>(xx: $2019,xxxx: list<$2019>) -> Consstd/core/types/Cons: forall<a> (head : a, tail : list<a>) -> list<a>(ff: ($2019) -> $2021 $2020(xx: $2019), xxxx: list<$2019>.mapstd/core/list/map: (xs : list<$2019>, f : ($2019) -> $2021 $2020) -> $2021 list<$2020>(ff: ($2019) -> $2021 $2020)) - Nilstd/core/types/Nil: forall<a> list<a> -> Nilstd/core/types/Nil: forall<a> list<a> + Consstd/core/types/Cons: forall<a> (head : a, tail : list<a>) -> list<a>(xx: $2019,xxxx: list<$2019>) -> Consstd/core/types/Cons: forall<a> (head : a, tail : list<a>) -> list<a>(ff: ($2019) -> $2021 $2020(xx: $2019), xxxx: list<$2019>.mapstd/core/list/map: (xs : list<$2019>, f : ($2019) -> $2021 $2020) -> $2021 list<$2020>(ff: ($2019) -> $2021 $2020)) + Nilstd/core/types/Nil: forall<a> list<a> -> Nilstd/core/types/Nil: forall<a> list<a> // Apply a function `f` to each element of the input list in sequence where takes // both the index of the current element and the element itself as arguments. -pub fun map-indexedstd/core/list/map-indexed: forall<a,b,e> (xs : list<a>, f : (idx : int, value : a) -> e b) -> e list<b>(xsxs: list<$2121> : liststd/core/types/list: V -> V<aa: V>, ff: (idx : int, value : $2121) -> $2123 $2122 : (idx : intstd/core/types/int: V, value : aa: V) -> ee: E bb: V)result: -> 2179 list<2178> : ee: E liststd/core/types/list: V -> V<bb: V> +pub fun map-indexedstd/core/list/map-indexed: forall<a,b,e> (xs : list<a>, f : (idx : int, value : a) -> e b) -> e list<b>(xsxs: list<$2121> : liststd/core/types/list: V -> V<aa: V>, ff: (idx : int, value : $2121) -> $2123 $2122 : (idx : intstd/core/types/int: V, value : aa: V) -> ee: E bb: V)result: -> 2179 list<2178> : ee: E liststd/core/types/list: V -> V<bb: V> fun map-idxmap-idx: (ys : list<$2121>, i : int) -> $2123 list<$2122>(ysys: list<$2121>,ii: int)result: -> $2123 list<$2122> match ysys: list<$2121> - Consstd/core/types/Cons: forall<a> (head : a, tail : list<a>) -> list<a>(yy: $2121,yyyy: list<$2121>) -> Consstd/core/types/Cons: forall<a> (head : a, tail : list<a>) -> list<a>(ff: (idx : int, value : $2121) -> $2123 $2122(ii: int,yy: $2121), map-idxmap-idx: (ys : list<$2121>, i : int) -> $2123 list<$2122>(yyyy: list<$2121>,ii: int+std/core/int/(+): (x : int, y : int) -> $2123 int1literal: int
dec = 1
hex8 = 0x01
bit8 = 0b00000001
)) - Nilstd/core/types/Nil: forall<a> list<a> -> Nilstd/core/types/Nil: forall<a> list<a>
+ Consstd/core/types/Cons: forall<a> (head : a, tail : list<a>) -> list<a>(yy: $2121,yyyy: list<$2121>) -> Consstd/core/types/Cons: forall<a> (head : a, tail : list<a>) -> list<a>(ff: (idx : int, value : $2121) -> $2123 $2122(ii: int,yy: $2121), map-idxmap-idx: (ys : list<$2121>, i : int) -> $2123 list<$2122>(yyyy: list<$2121>,ii: int+std/core/int/(+): (x : int, y : int) -> $2123 int1literal: int
dec = 1
hex8 = 0x01
bit8 = 0b00000001
)) + Nilstd/core/types/Nil: forall<a> list<a> -> Nilstd/core/types/Nil: forall<a> list<a>
map-idxmap-idx: (ys : list<$2121>, i : int) -> $2123 list<$2122>(xsxs: list<$2121>,0literal: int
dec = 0
hex8 = 0x00
bit8 = 0b00000000
) // Apply a function `f` to each element of the input list in sequence where `f` takes // both the current element and the tail list as arguments. -pub fun map-peekstd/core/list/map-peek: forall<a,b,e> (xs : list<a>, f : (value : a, rest : list<a>) -> e b) -> e list<b>(xsxs: list<$2189> : liststd/core/types/list: V -> V<aa: V>, ff: (value : $2189, rest : list<$2189>) -> $2191 $2190 : (value : aa: V, rest : liststd/core/types/list: V -> V<aa: V>) -> ee: E bb: V)result: -> 2238 list<2237> : ee: E liststd/core/types/list: V -> V<bb: V> +pub fun map-peekstd/core/list/map-peek: forall<a,b,e> (xs : list<a>, f : (value : a, rest : list<a>) -> e b) -> e list<b>(xsxs: list<$2189> : liststd/core/types/list: V -> V<aa: V>, ff: (value : $2189, rest : list<$2189>) -> $2191 $2190 : (value : aa: V, rest : liststd/core/types/list: V -> V<aa: V>) -> ee: E bb: V)result: -> 2238 list<2237> : ee: E liststd/core/types/list: V -> V<bb: V> fun mappeekmappeek: (ys : list<$2189>) -> $2191 list<$2190>(ysys: list<$2189>)result: -> $2191 list<$2190> match ysys: list<$2189> - Consstd/core/types/Cons: forall<a> (head : a, tail : list<a>) -> list<a>(yy: $2189,yyyy: list<$2189>) -> Consstd/core/types/Cons: forall<a> (head : a, tail : list<a>) -> list<a>(ff: (value : $2189, rest : list<$2189>) -> $2191 $2190(yy: $2189,yyyy: list<$2189>), yyyy: list<$2189>.mappeekmappeek: (ys : list<$2189>) -> $2191 list<$2190>) - Nilstd/core/types/Nil: forall<a> list<a> -> Nilstd/core/types/Nil: forall<a> list<a> + Consstd/core/types/Cons: forall<a> (head : a, tail : list<a>) -> list<a>(yy: $2189,yyyy: list<$2189>) -> Consstd/core/types/Cons: forall<a> (head : a, tail : list<a>) -> list<a>(ff: (value : $2189, rest : list<$2189>) -> $2191 $2190(yy: $2189,yyyy: list<$2189>), yyyy: list<$2189>.mappeekmappeek: (ys : list<$2189>) -> $2191 list<$2190>) + Nilstd/core/types/Nil: forall<a> list<a> -> Nilstd/core/types/Nil: forall<a> list<a> mappeekmappeek: (ys : list<$2189>) -> $2191 list<$2190>(xsxs: list<$2189>) // Apply a function `f` to each element of the input list in sequence where takes // both the index of the current element, the element itself, and the tail list as arguments. -pub fun map-indexed-peekstd/core/list/map-indexed-peek: forall<a,b,e> (xs : list<a>, f : (idx : int, value : a, rest : list<a>) -> e b) -> e list<b>(xsxs: list<$2248> : liststd/core/types/list: V -> V<aa: V>, ff: (idx : int, value : $2248, rest : list<$2248>) -> $2250 $2249 : (idx : intstd/core/types/int: V, value : aa: V, rest : liststd/core/types/list: V -> V<aa: V> ) -> ee: E bb: V)result: -> 2307 list<2306> : ee: E liststd/core/types/list: V -> V<bb: V> +pub fun map-indexed-peekstd/core/list/map-indexed-peek: forall<a,b,e> (xs : list<a>, f : (idx : int, value : a, rest : list<a>) -> e b) -> e list<b>(xsxs: list<$2248> : liststd/core/types/list: V -> V<aa: V>, ff: (idx : int, value : $2248, rest : list<$2248>) -> $2250 $2249 : (idx : intstd/core/types/int: V, value : aa: V, rest : liststd/core/types/list: V -> V<aa: V> ) -> ee: E bb: V)result: -> 2307 list<2306> : ee: E liststd/core/types/list: V -> V<bb: V> fun mapidxmapidx: (ys : list<$2248>, i : int) -> $2250 list<$2249>(ysys: list<$2248>,ii: int)result: -> $2250 list<$2249> match ysys: list<$2248> - Consstd/core/types/Cons: forall<a> (head : a, tail : list<a>) -> list<a>(yy: $2248,yyyy: list<$2248>) -> Consstd/core/types/Cons: forall<a> (head : a, tail : list<a>) -> list<a>(ff: (idx : int, value : $2248, rest : list<$2248>) -> $2250 $2249(ii: int,yy: $2248,yyyy: list<$2248>), mapidxmapidx: (ys : list<$2248>, i : int) -> $2250 list<$2249>(yyyy: list<$2248>,ii: int+std/core/int/(+): (x : int, y : int) -> $2250 int1literal: int
dec = 1
hex8 = 0x01
bit8 = 0b00000001
)) - Nilstd/core/types/Nil: forall<a> list<a> -> Nilstd/core/types/Nil: forall<a> list<a>
+ Consstd/core/types/Cons: forall<a> (head : a, tail : list<a>) -> list<a>(yy: $2248,yyyy: list<$2248>) -> Consstd/core/types/Cons: forall<a> (head : a, tail : list<a>) -> list<a>(ff: (idx : int, value : $2248, rest : list<$2248>) -> $2250 $2249(ii: int,yy: $2248,yyyy: list<$2248>), mapidxmapidx: (ys : list<$2248>, i : int) -> $2250 list<$2249>(yyyy: list<$2248>,ii: int+std/core/int/(+): (x : int, y : int) -> $2250 int1literal: int
dec = 1
hex8 = 0x01
bit8 = 0b00000001
)) + Nilstd/core/types/Nil: forall<a> list<a> -> Nilstd/core/types/Nil: forall<a> list<a>
mapidxmapidx: (ys : list<$2248>, i : int) -> $2250 list<$2249>(xsxs: list<$2248>,0literal: int
dec = 0
hex8 = 0x00
bit8 = 0b00000000
) // Reverse a list. -pub fun reversestd/core/list/reverse: forall<a> (xs : list<a>) -> list<a>(xsxs: list<$1003> : liststd/core/types/list: V -> V<aa: V>)result: -> total list<1020> : liststd/core/types/list: V -> V<aa: V> - reverse-appendstd/core/list/reverse-append: (xs : list<$1003>, tl : list<$1003>) -> list<$1003>( xsxs: list<$1003>, Nilstd/core/types/Nil: forall<a> list<a> ) +pub fun reversestd/core/list/reverse: forall<a> (xs : list<a>) -> list<a>(xsxs: list<$1003> : liststd/core/types/list: V -> V<aa: V>)result: -> total list<1020> : liststd/core/types/list: V -> V<aa: V> + reverse-appendstd/core/list/reverse-append: (xs : list<$1003>, tl : list<$1003>) -> list<$1003>( xsxs: list<$1003>, Nilstd/core/types/Nil: forall<a> list<a> ) // Efficiently reverse a list `xs` and append it to `tl`: // `reverse-append(xs,tl) == reserve(xs) ++ tl -pub fun reverse-appendstd/core/list/reverse-append: forall<a> (xs : list<a>, tl : list<a>) -> list<a>( xsxs: list<$948> : liststd/core/types/list: V -> V<aa: V>, tltl: list<$948> : liststd/core/types/list: V -> V<aa: V> )result: -> total list<998> : liststd/core/types/list: V -> V<aa: V> - fun reverse-accreverse-acc: forall<a> (acc : list<a>, ys : list<a>) -> list<a>(accacc: list<$949> : liststd/core/types/list: V -> V<aa: V>, ysys: list<$949> : liststd/core/types/list: V -> V<aa: V> )result: -> total list<979> : liststd/core/types/list: V -> V<aa: V> +pub fun reverse-appendstd/core/list/reverse-append: forall<a> (xs : list<a>, tl : list<a>) -> list<a>( xsxs: list<$948> : liststd/core/types/list: V -> V<aa: V>, tltl: list<$948> : liststd/core/types/list: V -> V<aa: V> )result: -> total list<998> : liststd/core/types/list: V -> V<aa: V> + fun reverse-accreverse-acc: forall<a> (acc : list<a>, ys : list<a>) -> list<a>(accacc: list<$949> : liststd/core/types/list: V -> V<aa: V>, ysys: list<$949> : liststd/core/types/list: V -> V<aa: V> )result: -> total list<979> : liststd/core/types/list: V -> V<aa: V> match ysys: list<$949> - Consstd/core/types/Cons: forall<a> (head : a, tail : list<a>) -> list<a>(xx: $949,xxxx: list<$949>) -> reverse-accreverse-acc: (acc : list<$949>, ys : list<$949>) -> list<$949>(Consstd/core/types/Cons: forall<a> (head : a, tail : list<a>) -> list<a>(xx: $949,accacc: list<$949>),xxxx: list<$949>) + Consstd/core/types/Cons: forall<a> (head : a, tail : list<a>) -> list<a>(xx: $949,xxxx: list<$949>) -> reverse-accreverse-acc: (acc : list<$949>, ys : list<$949>) -> list<$949>(Consstd/core/types/Cons: forall<a> (head : a, tail : list<a>) -> list<a>(xx: $949,accacc: list<$949>),xxxx: list<$949>) _ -> accacc: list<$949> reverse-accreverse-acc: (acc : list<$948>, ys : list<$948>) -> list<$948>(tltl: list<$948>,xsxs: list<$948>) // Append two lists. -pub fun (++)std/core/list/(++): forall<a> (xs : list<a>, ys : list<a>) -> list<a>(xsxs: list<$1061> : liststd/core/types/list: V -> V<aa: V>, ysys: list<$1061> : liststd/core/types/list: V -> V<aa: V> )result: -> total list<1076> : liststd/core/types/list: V -> V<aa: V> +pub fun (++)std/core/list/(++): forall<a> (xs : list<a>, ys : list<a>) -> list<a>(xsxs: list<$1061> : liststd/core/types/list: V -> V<aa: V>, ysys: list<$1061> : liststd/core/types/list: V -> V<aa: V> )result: -> total list<1076> : liststd/core/types/list: V -> V<aa: V> appendstd/core/list/append: (xs : list<$1061>, ys : list<$1061>) -> list<$1061>(xsxs: list<$1061>,ysys: list<$1061>) // Append two lists. -pub fun appendstd/core/list/append: forall<a> (xs : list<a>, ys : list<a>) -> list<a>(xsxs: list<$1025> : liststd/core/types/list: V -> V<aa: V>, ysys: list<$1025> : liststd/core/types/list: V -> V<aa: V> )result: -> total list<1056> : liststd/core/types/list: V -> V<aa: V> +pub fun appendstd/core/list/append: forall<a> (xs : list<a>, ys : list<a>) -> list<a>(xsxs: list<$1025> : liststd/core/types/list: V -> V<aa: V>, ysys: list<$1025> : liststd/core/types/list: V -> V<aa: V> )result: -> total list<1056> : liststd/core/types/list: V -> V<aa: V> match xsxs: list<$1025> - Consstd/core/types/Cons: forall<a> (head : a, tail : list<a>) -> list<a>(xx: $1025,xxxx: list<$1025>) -> Consstd/core/types/Cons: forall<a> (head : a, tail : list<a>) -> list<a>(xx: $1025,appendstd/core/list/append: (xs : list<$1025>, ys : list<$1025>) -> list<$1025>(xxxx: list<$1025>,ysys: list<$1025>)) - Nilstd/core/types/Nil: forall<a> list<a> -> ysys: list<$1025> + Consstd/core/types/Cons: forall<a> (head : a, tail : list<a>) -> list<a>(xx: $1025,xxxx: list<$1025>) -> Consstd/core/types/Cons: forall<a> (head : a, tail : list<a>) -> list<a>(xx: $1025,appendstd/core/list/append: (xs : list<$1025>, ys : list<$1025>) -> list<$1025>(xxxx: list<$1025>,ysys: list<$1025>)) + Nilstd/core/types/Nil: forall<a> list<a> -> ysys: list<$1025> // Fold a list from the right, i.e. `foldr([1,2],0,(+)) == 1+(2+0)` // Note, `foldr` is less efficient than `foldl` as it reverses the list first. -pub fun foldrstd/core/list/foldr: forall<a,b,e> (xs : list<a>, z : b, f : (a, b) -> e b) -> e b(xsxs: list<$1133> : liststd/core/types/list: V -> V<aa: V>, zz: $1134 : bb: V, ff: ($1133, $1134) -> $1135 $1134 : (aa: V, bb: V) -> ee: E bb: V)result: -> 1173 1172 : ee: E bb: V +pub fun foldrstd/core/list/foldr: forall<a,b,e> (xs : list<a>, z : b, f : (a, b) -> e b) -> e b(xsxs: list<$1133> : liststd/core/types/list: V -> V<aa: V>, zz: $1134 : bb: V, ff: ($1133, $1134) -> $1135 $1134 : (aa: V, bb: V) -> ee: E bb: V)result: -> 1173 1172 : ee: E bb: V xsxs: list<$1133>.reversestd/core/list/reverse: (xs : list<$1133>) -> $1135 list<$1133>.foldlstd/core/list/foldl: (xs : list<$1133>, z : $1134, f : ($1134, $1133) -> $1135 $1134) -> $1135 $1134(zz: $1134) fnfn: (x : $1134, y : $1133) -> $1135 $1134(xx: $1134,yy: $1133) ff: ($1133, $1134) -> $1135 $1134(yy: $1133,xx: $1134) // Fold a list from the left, i.e. `foldl([1,2],0,(+)) == (0+1)+2` // Since `foldl` is tail recursive, it is preferred over `foldr` when using an associative function `f` -pub fun foldlstd/core/list/foldl: forall<a,b,e> (xs : list<a>, z : b, f : (b, a) -> e b) -> e b(xsxs: list<$1081> : liststd/core/types/list: V -> V<aa: V>, zz: $1082 : bb: V, ff: ($1082, $1081) -> $1083 $1082 : (bb: V, aa: V) -> ee: E bb: V)result: -> 1123 1122 : ee: E bb: V +pub fun foldlstd/core/list/foldl: forall<a,b,e> (xs : list<a>, z : b, f : (b, a) -> e b) -> e b(xsxs: list<$1081> : liststd/core/types/list: V -> V<aa: V>, zz: $1082 : bb: V, ff: ($1082, $1081) -> $1083 $1082 : (bb: V, aa: V) -> ee: E bb: V)result: -> 1123 1122 : ee: E bb: V match xsxs: list<$1081> - Consstd/core/types/Cons: forall<a> (head : a, tail : list<a>) -> list<a>(xx: $1081,xxxx: list<$1081>) -> foldlstd/core/list/foldl: (xs : list<$1081>, z : $1082, f : ($1082, $1081) -> $1083 $1082) -> $1083 $1082(xxxx: list<$1081>,ff: ($1082, $1081) -> $1083 $1082(zz: $1082,xx: $1081),ff: ($1082, $1081) -> $1083 $1082) - Nilstd/core/types/Nil: forall<a> list<a> -> zz: $1082 + Consstd/core/types/Cons: forall<a> (head : a, tail : list<a>) -> list<a>(xx: $1081,xxxx: list<$1081>) -> foldlstd/core/list/foldl: (xs : list<$1081>, z : $1082, f : ($1082, $1081) -> $1083 $1082) -> $1083 $1082(xxxx: list<$1081>,ff: ($1082, $1081) -> $1083 $1082(zz: $1082,xx: $1081),ff: ($1082, $1081) -> $1083 $1082) + Nilstd/core/types/Nil: forall<a> list<a> -> zz: $1082 -pub fun foldl1std/core/list/foldl1: forall<a,e> (xs : list<a>, f : (a, a) -> <exn|e> a) -> <exn|e> a(xsxs: list<$1183> : liststd/core/types/list: V -> V<aa: V>, ff: ($1183, $1183) -> <exn|$1184> $1183 : (aa: V,aa: V) -> <exnstd/core/exn/exn: (E, V) -> V|std/core/types/effect-extend: (X, E) -> Eee: E> aa: V)result: -> <exn|1226> 1225 : <exnstd/core/exn/exn: (E, V) -> V|std/core/types/effect-extend: (X, E) -> Eee: E> aa: V +pub fun foldl1std/core/list/foldl1: forall<a,e> (xs : list<a>, f : (a, a) -> <exn|e> a) -> <exn|e> a(xsxs: list<$1183> : liststd/core/types/list: V -> V<aa: V>, ff: ($1183, $1183) -> <exn|$1184> $1183 : (aa: V,aa: V) -> <exnstd/core/exn/exn: (E, V) -> V|std/core/types/effect-extend: (X, E) -> Eee: E> aa: V)result: -> <exn|1226> 1225 : <exnstd/core/exn/exn: (E, V) -> V|std/core/types/effect-extend: (X, E) -> Eee: E> aa: V match xsxs: list<$1183> - Consstd/core/types/Cons: forall<a> (head : a, tail : list<a>) -> list<a>(xx: $1183,xxxx: list<$1183>) -> xxxx: list<$1183>.foldlstd/core/list/foldl: (xs : list<$1183>, z : $1183, f : ($1183, $1183) -> <exn|$1184> $1183) -> <exn|$1184> $1183(xx: $1183,ff: ($1183, $1183) -> <exn|$1184> $1183) - Nilstd/core/types/Nil: forall<a> list<a> -> throwstd/core/exn/throw: (message : string, info : ? exception-info) -> <exn|$1184> $1183("unexpected Nil in std/core/foldl1"literal: string
count= 33
) + Consstd/core/types/Cons: forall<a> (head : a, tail : list<a>) -> list<a>(xx: $1183,xxxx: list<$1183>) -> xxxx: list<$1183>.foldlstd/core/list/foldl: (xs : list<$1183>, z : $1183, f : ($1183, $1183) -> <exn|$1184> $1183) -> <exn|$1184> $1183(xx: $1183,ff: ($1183, $1183) -> <exn|$1184> $1183) + Nilstd/core/types/Nil: forall<a> list<a> -> throwstd/core/exn/throw: (message : string, info : ? exception-info) -> <exn|$1184> $1183("unexpected Nil in std/core/foldl1"literal: string
count= 33
) -pub fun foldr1std/core/list/foldr1: forall<a,e> (xs : list<a>, f : (a, a) -> <exn|e> a) -> <exn|e> a(xsxs: list<$1233> : liststd/core/types/list: V -> V<aa: V>, ff: ($1233, $1233) -> <exn|$1234> $1233 : (aa: V,aa: V) -> <exnstd/core/exn/exn: (E, V) -> V|std/core/types/effect-extend: (X, E) -> Eee: E> aa: V)result: -> <exn|1260> 1259 : <exnstd/core/exn/exn: (E, V) -> V|std/core/types/effect-extend: (X, E) -> Eee: E> aa: V +pub fun foldr1std/core/list/foldr1: forall<a,e> (xs : list<a>, f : (a, a) -> <exn|e> a) -> <exn|e> a(xsxs: list<$1233> : liststd/core/types/list: V -> V<aa: V>, ff: ($1233, $1233) -> <exn|$1234> $1233 : (aa: V,aa: V) -> <exnstd/core/exn/exn: (E, V) -> V|std/core/types/effect-extend: (X, E) -> Eee: E> aa: V)result: -> <exn|1260> 1259 : <exnstd/core/exn/exn: (E, V) -> V|std/core/types/effect-extend: (X, E) -> Eee: E> aa: V xsxs: list<$1233>.reversestd/core/list/reverse: (xs : list<$1233>) -> <exn|$1234> list<$1233>.foldl1std/core/list/foldl1: (xs : list<$1233>, f : ($1233, $1233) -> <exn|$1234> $1233) -> <exn|$1234> $1233(ff: ($1233, $1233) -> <exn|$1234> $1233) // Create a list of `n` repeated elements `x` -pub fun replicatestd/core/list/replicate: forall<a> (x : a, n : int) -> list<a>( xx: $2317 : aa: V, nn: int : intstd/core/types/int: V )result: -> total list<2360> : liststd/core/types/list: V -> V<aa: V> - if nn: int >std/core/int/(>): (x : int, y : int) -> bool 0literal: int
dec = 0
hex8 = 0x00
bit8 = 0b00000000
- then Consstd/core/types/Cons: forall<a> (head : a, tail : list<a>) -> list<a>(xx: $2317, replicatestd/core/list/replicate: (x : $2317, n : int) -> list<$2317>(xx: $2317,pretend-decreasingstd/core/undiv/pretend-decreasing: (x : int) -> int(nn: int.decstd/core/int/dec: (i : int) -> int))) - else Nilstd/core/types/Nil: forall<a> list<a>
+
pub fun replicatestd/core/list/replicate: forall<a> (x : a, n : int) -> list<a>( xx: $2317 : aa: V, nn: int : intstd/core/types/int: V )result: -> total list<2360> : liststd/core/types/list: V -> V<aa: V> + if nn: int >std/core/int/(>): (x : int, y : int) -> bool 0literal: int
dec = 0
hex8 = 0x00
bit8 = 0b00000000
+ then Consstd/core/types/Cons: forall<a> (head : a, tail : list<a>) -> list<a>(xx: $2317, replicatestd/core/list/replicate: (x : $2317, n : int) -> list<$2317>(xx: $2317,pretend-decreasingstd/core/undiv/pretend-decreasing: (x : int) -> int(nn: int.decstd/core/int/dec: (i : int) -> int))) + else Nilstd/core/types/Nil: forall<a> list<a>
// split a list at position `n` -pub fun splitstd/core/list/split: forall<a> (xs : list<a>, n : int) -> (list<a>, list<a>)( xsxs: list<$1267> : liststd/core/types/list: V -> V<aa: V>, nn: int : intstd/core/types/int: V )result: -> total (list<1299>, list<1299>) : (std/core/types/tuple2: (V, V) -> Vliststd/core/types/list: V -> V<aa: V>, liststd/core/types/list: V -> V<aa: V>) - (std/core/types/Tuple2: forall<a,b> (fst : a, snd : b) -> (a, b)xsxs: list<$1267>.takestd/core/list/take: (xs : list<$1267>, n : int) -> list<$1267>(nn: int), xsxs: list<$1267>.dropstd/core/list/drop: (xs : list<$1267>, n : int) -> list<$1267>(nn: int))std/core/types/Tuple2: forall<a,b> (fst : a, snd : b) -> (a, b) +pub fun splitstd/core/list/split: forall<a> (xs : list<a>, n : int) -> (list<a>, list<a>)( xsxs: list<$1267> : liststd/core/types/list: V -> V<aa: V>, nn: int : intstd/core/types/int: V )result: -> total (list<1299>, list<1299>) : (std/core/types/tuple2: (V, V) -> Vliststd/core/types/list: V -> V<aa: V>, liststd/core/types/list: V -> V<aa: V>) + (std/core/types/Tuple2: forall<a,b> (fst : a, snd : b) -> (a, b)xsxs: list<$1267>.takestd/core/list/take: (xs : list<$1267>, n : int) -> list<$1267>(nn: int), xsxs: list<$1267>.dropstd/core/list/drop: (xs : list<$1267>, n : int) -> list<$1267>(nn: int))std/core/types/Tuple2: forall<a,b> (fst : a, snd : b) -> (a, b) -pub fun spanstd/core/list/span: forall<a,e> (xs : list<a>, predicate : (a) -> e bool) -> e (list<a>, list<a>)( xsxs: list<$4456> : liststd/core/types/list: V -> V<aa: V>, predicatepredicate: ($4456) -> $4457 bool : aa: V -> ee: E boolstd/core/types/bool: V )result: -> 4538 (list<4537>, list<4537>) : ee: E (std/core/types/tuple2: (V, V) -> Vliststd/core/types/list: V -> V<aa: V>,liststd/core/types/list: V -> V<aa: V>) +pub fun spanstd/core/list/span: forall<a,e> (xs : list<a>, predicate : (a) -> e bool) -> e (list<a>, list<a>)( xsxs: list<$4456> : liststd/core/types/list: V -> V<aa: V>, predicatepredicate: ($4456) -> $4457 bool : aa: V -> ee: E boolstd/core/types/bool: V )result: -> 4538 (list<4537>, list<4537>) : ee: E (std/core/types/tuple2: (V, V) -> Vliststd/core/types/list: V -> V<aa: V>,liststd/core/types/list: V -> V<aa: V>) // todo: implement TRMC with multiple results to avoid the reverse fun span-accspan-acc: (ys : list<$4456>, acc : list<$4456>) -> $4457 (list<$4456>, list<$4456>)( ysys: list<$4456>, accacc: list<$4456>)result: -> $4457 (list<$4456>, list<$4456>) match ysys: list<$4456> - Consstd/core/types/Cons: forall<a> (head : a, tail : list<a>) -> list<a>(yy: $4456,yyyy: list<$4456>) -> if yy: $4456.predicatepredicate: ($4456) -> $4457 bool then yyyy: list<$4456>.span-accspan-acc: (ys : list<$4456>, acc : list<$4456>) -> $4457 (list<$4456>, list<$4456>)(Consstd/core/types/Cons: forall<a> (head : a, tail : list<a>) -> list<a>(yy: $4456,accacc: list<$4456>)) else (std/core/types/Tuple2: forall<a,b> (fst : a, snd : b) -> (a, b)accacc: list<$4456>.reversestd/core/list/reverse: (xs : list<$4456>) -> $4457 list<$4456>,ysys: list<$4456>)std/core/types/Tuple2: forall<a,b> (fst : a, snd : b) -> (a, b) - _ -> (std/core/types/Tuple2: forall<a,b> (fst : a, snd : b) -> (a, b)accacc: list<$4456>.reversestd/core/list/reverse: (xs : list<$4456>) -> $4457 list<$4456>, ysys: list<$4456>)std/core/types/Tuple2: forall<a,b> (fst : a, snd : b) -> (a, b) - xsxs: list<$4456>.span-accspan-acc: (ys : list<$4456>, acc : list<$4456>) -> $4457 (list<$4456>, list<$4456>)( [std/core/types/Nil: forall<a> list<a>]std/core/types/Nil: forall<a> list<a> ) + Consstd/core/types/Cons: forall<a> (head : a, tail : list<a>) -> list<a>(yy: $4456,yyyy: list<$4456>) -> if yy: $4456.predicatepredicate: ($4456) -> $4457 bool then yyyy: list<$4456>.span-accspan-acc: (ys : list<$4456>, acc : list<$4456>) -> $4457 (list<$4456>, list<$4456>)(Consstd/core/types/Cons: forall<a> (head : a, tail : list<a>) -> list<a>(yy: $4456,accacc: list<$4456>)) else (std/core/types/Tuple2: forall<a,b> (fst : a, snd : b) -> (a, b)accacc: list<$4456>.reversestd/core/list/reverse: (xs : list<$4456>) -> $4457 list<$4456>,ysys: list<$4456>)std/core/types/Tuple2: forall<a,b> (fst : a, snd : b) -> (a, b) + _ -> (std/core/types/Tuple2: forall<a,b> (fst : a, snd : b) -> (a, b)accacc: list<$4456>.reversestd/core/list/reverse: (xs : list<$4456>) -> $4457 list<$4456>, ysys: list<$4456>)std/core/types/Tuple2: forall<a,b> (fst : a, snd : b) -> (a, b) + xsxs: list<$4456>.span-accspan-acc: (ys : list<$4456>, acc : list<$4456>) -> $4457 (list<$4456>, list<$4456>)( [std/core/types/Nil: forall<a> list<a>]std/core/types/Nil: forall<a> list<a> ) // Keep only those initial elements that satisfy `predicate` -pub fun take-whilestd/core/list/take-while: forall<a,e> (xs : list<a>, predicate : (a) -> e bool) -> e list<a>( xsxs: list<$4545> : liststd/core/types/list: V -> V<aa: V>, predicatepredicate: ($4545) -> $4546 bool : aa: V -> ee: E boolstd/core/types/bool: V )result: -> 4592 list<4591> : ee: E liststd/core/types/list: V -> V<aa: V> +pub fun take-whilestd/core/list/take-while: forall<a,e> (xs : list<a>, predicate : (a) -> e bool) -> e list<a>( xsxs: list<$4545> : liststd/core/types/list: V -> V<aa: V>, predicatepredicate: ($4545) -> $4546 bool : aa: V -> ee: E boolstd/core/types/bool: V )result: -> 4592 list<4591> : ee: E liststd/core/types/list: V -> V<aa: V> match xsxs: list<$4545> - Consstd/core/types/Cons: forall<a> (head : a, tail : list<a>) -> list<a>(xx: $4545,xxxx: list<$4545>) -> if xx: $4545.predicatepredicate: ($4545) -> $4546 bool then Consstd/core/types/Cons: forall<a> (head : a, tail : list<a>) -> list<a>(xx: $4545, xxxx: list<$4545>.take-whilestd/core/list/take-while: (xs : list<$4545>, predicate : ($4545) -> $4546 bool) -> $4546 list<$4545>(predicatepredicate: ($4545) -> $4546 bool) ) else Nilstd/core/types/Nil: forall<a> list<a> - Nilstd/core/types/Nil: forall<a> list<a> -> Nilstd/core/types/Nil: forall<a> list<a> + Consstd/core/types/Cons: forall<a> (head : a, tail : list<a>) -> list<a>(xx: $4545,xxxx: list<$4545>) -> if xx: $4545.predicatepredicate: ($4545) -> $4546 bool then Consstd/core/types/Cons: forall<a> (head : a, tail : list<a>) -> list<a>(xx: $4545, xxxx: list<$4545>.take-whilestd/core/list/take-while: (xs : list<$4545>, predicate : ($4545) -> $4546 bool) -> $4546 list<$4545>(predicatepredicate: ($4545) -> $4546 bool) ) else Nilstd/core/types/Nil: forall<a> list<a> + Nilstd/core/types/Nil: forall<a> list<a> -> Nilstd/core/types/Nil: forall<a> list<a> // Drop all initial elements that satisfy `predicate` -pub fun drop-whilestd/core/list/drop-while: forall<a,e> (xs : list<a>, predicate : (a) -> e bool) -> e list<a>( xsxs: list<$1304> : liststd/core/types/list: V -> V<aa: V>, predicatepredicate: ($1304) -> $1305 bool : aa: V -> ee: E boolstd/core/types/bool: V )result: -> 1342 list<1341> : ee: E liststd/core/types/list: V -> V<aa: V> +pub fun drop-whilestd/core/list/drop-while: forall<a,e> (xs : list<a>, predicate : (a) -> e bool) -> e list<a>( xsxs: list<$1304> : liststd/core/types/list: V -> V<aa: V>, predicatepredicate: ($1304) -> $1305 bool : aa: V -> ee: E boolstd/core/types/bool: V )result: -> 1342 list<1341> : ee: E liststd/core/types/list: V -> V<aa: V> match xsxs: list<$1304> - Consstd/core/types/Cons: forall<a> (head : a, tail : list<a>) -> list<a>(xx: $1304,xxxx: list<$1304>) -> if xx: $1304.predicatepredicate: ($1304) -> $1305 bool then xxxx: list<$1304>.drop-whilestd/core/list/drop-while: (xs : list<$1304>, predicate : ($1304) -> $1305 bool) -> $1305 list<$1304>(predicatepredicate: ($1304) -> $1305 bool) else xsxs: list<$1304> - Nilstd/core/types/Nil: forall<a> list<a> -> Nilstd/core/types/Nil: forall<a> list<a> + Consstd/core/types/Cons: forall<a> (head : a, tail : list<a>) -> list<a>(xx: $1304,xxxx: list<$1304>) -> if xx: $1304.predicatepredicate: ($1304) -> $1305 bool then xxxx: list<$1304>.drop-whilestd/core/list/drop-while: (xs : list<$1304>, predicate : ($1304) -> $1305 bool) -> $1305 list<$1304>(predicatepredicate: ($1304) -> $1305 bool) else xsxs: list<$1304> + Nilstd/core/types/Nil: forall<a> list<a> -> Nilstd/core/types/Nil: forall<a> list<a> // Retain only those elements of a list that satisfy the given predicate `pred`. // For example: `filter([1,2,3],odd?) == [1,3]` -pub fun filterstd/core/list/filter: forall<a,e> (xs : list<a>, pred : (a) -> e bool) -> e list<a>( xsxs: list<$1349> : liststd/core/types/list: V -> V<aa: V>, predpred: ($1349) -> $1350 bool : aa: V -> ee: E boolstd/core/types/bool: V )result: -> 1402 list<1401> : ee: E liststd/core/types/list: V -> V<aa: V> +pub fun filterstd/core/list/filter: forall<a,e> (xs : list<a>, pred : (a) -> e bool) -> e list<a>( xsxs: list<$1349> : liststd/core/types/list: V -> V<aa: V>, predpred: ($1349) -> $1350 bool : aa: V -> ee: E boolstd/core/types/bool: V )result: -> 1402 list<1401> : ee: E liststd/core/types/list: V -> V<aa: V> match xsxs: list<$1349> - Consstd/core/types/Cons: forall<a> (head : a, tail : list<a>) -> list<a>(xx: $1349,xxxx: list<$1349>) -> if predpred: ($1349) -> $1350 bool(xx: $1349) then Consstd/core/types/Cons: forall<a> (head : a, tail : list<a>) -> list<a>(xx: $1349,xxxx: list<$1349>.filterstd/core/list/filter: (xs : list<$1349>, pred : ($1349) -> $1350 bool) -> $1350 list<$1349>(predpred: ($1349) -> $1350 bool)) else xxxx: list<$1349>.filterstd/core/list/filter: (xs : list<$1349>, pred : ($1349) -> $1350 bool) -> $1350 list<$1349>(predpred: ($1349) -> $1350 bool) - Nilstd/core/types/Nil: forall<a> list<a> -> Nilstd/core/types/Nil: forall<a> list<a> + Consstd/core/types/Cons: forall<a> (head : a, tail : list<a>) -> list<a>(xx: $1349,xxxx: list<$1349>) -> if predpred: ($1349) -> $1350 bool(xx: $1349) then Consstd/core/types/Cons: forall<a> (head : a, tail : list<a>) -> list<a>(xx: $1349,xxxx: list<$1349>.filterstd/core/list/filter: (xs : list<$1349>, pred : ($1349) -> $1350 bool) -> $1350 list<$1349>(predpred: ($1349) -> $1350 bool)) else xxxx: list<$1349>.filterstd/core/list/filter: (xs : list<$1349>, pred : ($1349) -> $1350 bool) -> $1350 list<$1349>(predpred: ($1349) -> $1350 bool) + Nilstd/core/types/Nil: forall<a> list<a> -> Nilstd/core/types/Nil: forall<a> list<a> // Remove those elements of a list that satisfy the given predicate `pred`. // For example: `remove([1,2,3],odd?) == [2]` -pub fun removestd/core/list/remove: forall<a,e> (xs : list<a>, pred : (a) -> e bool) -> e list<a>( xsxs: list<$2365> : liststd/core/types/list: V -> V<aa: V>, predpred: ($2365) -> $2366 bool : aa: V -> ee: E boolstd/core/types/bool: V )result: -> 2399 list<2398> : ee: E liststd/core/types/list: V -> V<aa: V> - xsxs: list<$2365>.filterstd/core/list/filter: (xs : list<$2365>, pred : ($2365) -> $2366 bool) -> $2366 list<$2365>( fnfn: (x : $2365) -> $2366 bool(xx: $2365) !std/core/types/bool/(!): (b : bool) -> $2366 boolpredpred: ($2365) -> $2366 bool(xx: $2365) ) +pub fun removestd/core/list/remove: forall<a,e> (xs : list<a>, pred : (a) -> e bool) -> e list<a>( xsxs: list<$2365> : liststd/core/types/list: V -> V<aa: V>, predpred: ($2365) -> $2366 bool : aa: V -> ee: E boolstd/core/types/bool: V )result: -> 2399 list<2398> : ee: E liststd/core/types/list: V -> V<aa: V> + xsxs: list<$2365>.filterstd/core/list/filter: (xs : list<$2365>, pred : ($2365) -> $2366 bool) -> $2366 list<$2365>( fnfn: (x : $2365) -> $2366 bool(xx: $2365) !std/core/types/bool/(!): (b : bool) -> $2366 boolpredpred: ($2365) -> $2366 bool(xx: $2365) ) // Partition a list in two lists where the first list contains // those elements that satisfy the given predicate `pred`. // For example: `partition([1,2,3],odd?) == ([1,3],[2])` -pub fun partitionstd/core/list/partition: forall<a,e> (xs : list<a>, pred : (a) -> e bool) -> e (list<a>, list<a>)( xsxs: list<$2555> : liststd/core/types/list: V -> V<aa: V>, ^predpred: ($2555) -> $2556 bool : aa: V -> ee: E boolstd/core/types/bool: V )result: -> 2592 (list<2591>, list<2591>) : ee: E (std/core/types/tuple2: (V, V) -> Vliststd/core/types/list: V -> V<aa: V>,liststd/core/types/list: V -> V<aa: V>) +pub fun partitionstd/core/list/partition: forall<a,e> (xs : list<a>, pred : (a) -> e bool) -> e (list<a>, list<a>)( xsxs: list<$2555> : liststd/core/types/list: V -> V<aa: V>, ^predpred: ($2555) -> $2556 bool : aa: V -> ee: E boolstd/core/types/bool: V )result: -> 2592 (list<2591>, list<2591>) : ee: E (std/core/types/tuple2: (V, V) -> Vliststd/core/types/list: V -> V<aa: V>,liststd/core/types/list: V -> V<aa: V>) partition-accstd/core/list/partition-acc: (xs : list<$2555>, pred : ($2555) -> $2556 bool, acc1 : ctx<list<$2555>>, acc2 : ctx<list<$2555>>) -> $2556 (list<$2555>, list<$2555>)(xsxs: list<$2555>, predpred: ($2555) -> $2556 bool, ctxctx: ctx<list<$2555>> _hole: list<$2555>, ctxctx: ctx<list<$2555>> _hole: list<$2555>) -fun partition-accstd/core/list/partition-acc: forall<a,e> (xs : list<a>, pred : (a) -> e bool, acc1 : ctx<list<a>>, acc2 : ctx<list<a>>) -> e (list<a>, list<a>)(xsxs: list<$2406> : liststd/core/types/list: V -> V<aa: V>, ^predpred: ($2406) -> $2407 bool : aa: V -> ee: E boolstd/core/types/bool: V, acc1acc1: ctx<list<$2406>> : ctxstd/core/types/ctx: V -> V<liststd/core/types/list: V -> V<aa: V>>, acc2acc2: ctx<list<$2406>> : ctxstd/core/types/ctx: V -> V<liststd/core/types/list: V -> V<aa: V>>)result: -> 2548 (list<2547>, list<2547>): ee: E (std/core/types/tuple2: (V, V) -> Vliststd/core/types/list: V -> V<aa: V>, liststd/core/types/list: V -> V<aa: V>) +fun partition-accstd/core/list/partition-acc: forall<a,e> (xs : list<a>, pred : (a) -> e bool, acc1 : ctx<list<a>>, acc2 : ctx<list<a>>) -> e (list<a>, list<a>)(xsxs: list<$2406> : liststd/core/types/list: V -> V<aa: V>, ^predpred: ($2406) -> $2407 bool : aa: V -> ee: E boolstd/core/types/bool: V, acc1acc1: ctx<list<$2406>> : ctxstd/core/types/ctx: V -> V<liststd/core/types/list: V -> V<aa: V>>, acc2acc2: ctx<list<$2406>> : ctxstd/core/types/ctx: V -> V<liststd/core/types/list: V -> V<aa: V>>)result: -> 2548 (list<2547>, list<2547>): ee: E (std/core/types/tuple2: (V, V) -> Vliststd/core/types/list: V -> V<aa: V>, liststd/core/types/list: V -> V<aa: V>) match xsxs: list<$2406> - Nilstd/core/types/Nil: forall<a> list<a> -> (std/core/types/Tuple2: forall<a,b> (fst : a, snd : b) -> (a, b)acc1acc1: ctx<list<$2406>> ++.std/core/types/cctx/(++.): (c : cctx<list<$2406>,list<$2406>>, x : list<$2406>) -> $2407 list<$2406> Nilstd/core/types/Nil: forall<a> list<a>, acc2acc2: ctx<list<$2406>> ++.std/core/types/cctx/(++.): (c : cctx<list<$2406>,list<$2406>>, x : list<$2406>) -> $2407 list<$2406> Nilstd/core/types/Nil: forall<a> list<a>)std/core/types/Tuple2: forall<a,b> (fst : a, snd : b) -> (a, b) - Consstd/core/types/Cons: forall<a> (head : a, tail : list<a>) -> list<a>(xx: $2406,xxxx: list<$2406>) -> if predpred: ($2406) -> $2407 bool(xx: $2406) - then partition-accstd/core/list/partition-acc: (xs : list<$2406>, pred : ($2406) -> $2407 bool, acc1 : ctx<list<$2406>>, acc2 : ctx<list<$2406>>) -> $2407 (list<$2406>, list<$2406>)(xxxx: list<$2406>,predpred: ($2406) -> $2407 bool,acc1acc1: ctx<list<$2406>> ++std/core/types/cctx/(++): (c1 : cctx<list<$2406>,list<$2406>>, c2 : cctx<list<$2406>,list<$2406>>) -> $2407 cctx<list<$2406>,list<$2406>> ctxctx: cctx<list<$2406>,list<$2406>> Consstd/core/types/Cons: forall<a> (head : a, tail : list<a>) -> list<a>(xx: $2406,_hole: list<$2406>),acc2acc2: ctx<list<$2406>>) - else partition-accstd/core/list/partition-acc: (xs : list<$2406>, pred : ($2406) -> $2407 bool, acc1 : ctx<list<$2406>>, acc2 : ctx<list<$2406>>) -> $2407 (list<$2406>, list<$2406>)(xxxx: list<$2406>,predpred: ($2406) -> $2407 bool,acc1acc1: ctx<list<$2406>>,acc2acc2: ctx<list<$2406>> ++std/core/types/cctx/(++): (c1 : cctx<list<$2406>,list<$2406>>, c2 : cctx<list<$2406>,list<$2406>>) -> $2407 cctx<list<$2406>,list<$2406>> ctxctx: cctx<list<$2406>,list<$2406>> Consstd/core/types/Cons: forall<a> (head : a, tail : list<a>) -> list<a>(xx: $2406,_hole: list<$2406>)) + Nilstd/core/types/Nil: forall<a> list<a> -> (std/core/types/Tuple2: forall<a,b> (fst : a, snd : b) -> (a, b)acc1acc1: ctx<list<$2406>> ++.std/core/types/cctx/(++.): (c : cctx<list<$2406>,list<$2406>>, x : list<$2406>) -> $2407 list<$2406> Nilstd/core/types/Nil: forall<a> list<a>, acc2acc2: ctx<list<$2406>> ++.std/core/types/cctx/(++.): (c : cctx<list<$2406>,list<$2406>>, x : list<$2406>) -> $2407 list<$2406> Nilstd/core/types/Nil: forall<a> list<a>)std/core/types/Tuple2: forall<a,b> (fst : a, snd : b) -> (a, b) + Consstd/core/types/Cons: forall<a> (head : a, tail : list<a>) -> list<a>(xx: $2406,xxxx: list<$2406>) -> if predpred: ($2406) -> $2407 bool(xx: $2406) + then partition-accstd/core/list/partition-acc: (xs : list<$2406>, pred : ($2406) -> $2407 bool, acc1 : ctx<list<$2406>>, acc2 : ctx<list<$2406>>) -> $2407 (list<$2406>, list<$2406>)(xxxx: list<$2406>,predpred: ($2406) -> $2407 bool,acc1acc1: ctx<list<$2406>> ++std/core/types/cctx/(++): (c1 : cctx<list<$2406>,list<$2406>>, c2 : cctx<list<$2406>,list<$2406>>) -> $2407 cctx<list<$2406>,list<$2406>> ctxctx: cctx<list<$2406>,list<$2406>> Consstd/core/types/Cons: forall<a> (head : a, tail : list<a>) -> list<a>(xx: $2406,_hole: list<$2406>),acc2acc2: ctx<list<$2406>>) + else partition-accstd/core/list/partition-acc: (xs : list<$2406>, pred : ($2406) -> $2407 bool, acc1 : ctx<list<$2406>>, acc2 : ctx<list<$2406>>) -> $2407 (list<$2406>, list<$2406>)(xxxx: list<$2406>,predpred: ($2406) -> $2407 bool,acc1acc1: ctx<list<$2406>>,acc2acc2: ctx<list<$2406>> ++std/core/types/cctx/(++): (c1 : cctx<list<$2406>,list<$2406>>, c2 : cctx<list<$2406>,list<$2406>>) -> $2407 cctx<list<$2406>,list<$2406>> ctxctx: cctx<list<$2406>,list<$2406>> Consstd/core/types/Cons: forall<a> (head : a, tail : list<a>) -> list<a>(xx: $2406,_hole: list<$2406>)) // Retain only those elements of a list that satisfy the given predicate `pred`. // For example: `filterMap([1,2,3],fn(i) { if i.odd? then Nothing else Just(i*i) }) == [4]` -pub fun filter-mapstd/core/list/filter-map: forall<a,b,e> (xs : list<a>, pred : (a) -> e maybe<b>) -> e list<b>( xsxs: list<$1409> : liststd/core/types/list: V -> V<aa: V>, predpred: ($1409) -> $1411 maybe<$1410> : aa: V -> ee: E maybestd/core/types/maybe: V -> V<bb: V> )result: -> 1478 list<1477> : ee: E liststd/core/types/list: V -> V<bb: V> +pub fun filter-mapstd/core/list/filter-map: forall<a,b,e> (xs : list<a>, pred : (a) -> e maybe<b>) -> e list<b>( xsxs: list<$1409> : liststd/core/types/list: V -> V<aa: V>, predpred: ($1409) -> $1411 maybe<$1410> : aa: V -> ee: E maybestd/core/types/maybe: V -> V<bb: V> )result: -> 1478 list<1477> : ee: E liststd/core/types/list: V -> V<bb: V> match xsxs: list<$1409> - Nilstd/core/types/Nil: forall<a> list<a> -> Nilstd/core/types/Nil: forall<a> list<a> - Consstd/core/types/Cons: forall<a> (head : a, tail : list<a>) -> list<a>(xx: $1409,xxxx: list<$1409>) -> match predpred: ($1409) -> $1411 maybe<$1410>(xx: $1409) - Nothingstd/core/types/Nothing: forall<a> maybe<a> -> xxxx: list<$1409>.filter-mapstd/core/list/filter-map: (xs : list<$1409>, pred : ($1409) -> $1411 maybe<$1410>) -> $1411 list<$1410>(predpred: ($1409) -> $1411 maybe<$1410>) - Juststd/core/types/Just: forall<a> (value : a) -> maybe<a>(yy: $1410) -> Consstd/core/types/Cons: forall<a> (head : a, tail : list<a>) -> list<a>(yy: $1410,xxxx: list<$1409>.filter-mapstd/core/list/filter-map: (xs : list<$1409>, pred : ($1409) -> $1411 maybe<$1410>) -> $1411 list<$1410>(predpred: ($1409) -> $1411 maybe<$1410>)) + Nilstd/core/types/Nil: forall<a> list<a> -> Nilstd/core/types/Nil: forall<a> list<a> + Consstd/core/types/Cons: forall<a> (head : a, tail : list<a>) -> list<a>(xx: $1409,xxxx: list<$1409>) -> match predpred: ($1409) -> $1411 maybe<$1410>(xx: $1409) + Nothingstd/core/types/Nothing: forall<a> maybe<a> -> xxxx: list<$1409>.filter-mapstd/core/list/filter-map: (xs : list<$1409>, pred : ($1409) -> $1411 maybe<$1410>) -> $1411 list<$1410>(predpred: ($1409) -> $1411 maybe<$1410>) + Juststd/core/types/Just: forall<a> (value : a) -> maybe<a>(yy: $1410) -> Consstd/core/types/Cons: forall<a> (head : a, tail : list<a>) -> list<a>(yy: $1410,xxxx: list<$1409>.filter-mapstd/core/list/filter-map: (xs : list<$1409>, pred : ($1409) -> $1411 maybe<$1410>) -> $1411 list<$1410>(predpred: ($1409) -> $1411 maybe<$1410>)) // Find the first element satisfying some predicate -pub fun findstd/core/list/find: forall<a,e> (xs : list<a>, pred : (a) -> e bool) -> e maybe<a>( xsxs: list<$1562> : liststd/core/types/list: V -> V<aa: V>, predpred: ($1562) -> $1563 bool : aa: V -> ee: E boolstd/core/types/bool: V )result: -> 1611 maybe<1610> : ee: E maybestd/core/types/maybe: V -> V<aa: V> +pub fun findstd/core/list/find: forall<a,e> (xs : list<a>, pred : (a) -> e bool) -> e maybe<a>( xsxs: list<$1562> : liststd/core/types/list: V -> V<aa: V>, predpred: ($1562) -> $1563 bool : aa: V -> ee: E boolstd/core/types/bool: V )result: -> 1611 maybe<1610> : ee: E maybestd/core/types/maybe: V -> V<aa: V> xsxs: list<$1562>.foreach-whilestd/core/list/foreach-while: (xs : list<$1562>, action : ($1562) -> $1563 maybe<$1562>) -> $1563 maybe<$1562> fnfn: (x : $1562) -> $1563 maybe<$1562>(xx: $1562) - if predpred: ($1562) -> $1563 bool(xx: $1562) then Juststd/core/types/Just: forall<a> (value : a) -> maybe<a>(xx: $1562) else Nothingstd/core/types/Nothing: forall<a> maybe<a> + if predpred: ($1562) -> $1563 bool(xx: $1562) then Juststd/core/types/Just: forall<a> (value : a) -> maybe<a>(xx: $1562) else Nothingstd/core/types/Nothing: forall<a> maybe<a> // Find the first element satisfying some predicate and return it. -pub fun find-maybestd/core/list/find-maybe: forall<a,b,e> (xs : list<a>, pred : (a) -> e maybe<b>) -> e maybe<b>( xsxs: list<$1618> : liststd/core/types/list: V -> V<aa: V>, predpred: ($1618) -> $1620 maybe<$1619> : aa: V -> ee: E maybestd/core/types/maybe: V -> V<bb: V> )result: -> 1658 maybe<1657> : ee: E maybestd/core/types/maybe: V -> V<bb: V> +pub fun find-maybestd/core/list/find-maybe: forall<a,b,e> (xs : list<a>, pred : (a) -> e maybe<b>) -> e maybe<b>( xsxs: list<$1618> : liststd/core/types/list: V -> V<aa: V>, predpred: ($1618) -> $1620 maybe<$1619> : aa: V -> ee: E maybestd/core/types/maybe: V -> V<bb: V> )result: -> 1658 maybe<1657> : ee: E maybestd/core/types/maybe: V -> V<bb: V> xsxs: list<$1618>.foreach-whilestd/core/list/foreach-while: (xs : list<$1618>, action : ($1618) -> $1620 maybe<$1619>) -> $1620 maybe<$1619>(predpred: ($1618) -> $1620 maybe<$1619>) // Lookup the first element satisfying some predicate -pub fun lookupstd/core/list/lookup: forall<a,b,e> (xs : list<(a, b)>, pred : (a) -> e bool) -> e maybe<b>( xsxs: list<($2599, $2600)> : liststd/core/types/list: V -> V<(std/core/types/tuple2: (V, V) -> Vaa: V,bb: V)>, predpred: ($2599) -> $2601 bool : aa: V -> ee: E boolstd/core/types/bool: V )result: -> 2724 maybe<2723> : ee: E maybestd/core/types/maybe: V -> V<bb: V> +pub fun lookupstd/core/list/lookup: forall<a,b,e> (xs : list<(a, b)>, pred : (a) -> e bool) -> e maybe<b>( xsxs: list<($2599, $2600)> : liststd/core/types/list: V -> V<(std/core/types/tuple2: (V, V) -> Vaa: V,bb: V)>, predpred: ($2599) -> $2601 bool : aa: V -> ee: E boolstd/core/types/bool: V )result: -> 2724 maybe<2723> : ee: E maybestd/core/types/maybe: V -> V<bb: V> xsxs: list<($2599, $2600)>.foreach-whilestd/core/list/foreach-while: (xs : list<($2599, $2600)>, action : (($2599, $2600)) -> $2601 maybe<$2600>) -> $2601 maybe<$2600> fnfn: (kv : ($2599, $2600)) -> $2601 maybe<$2600>(kvkv: ($2599, $2600)) - if predpred: ($2599) -> $2601 bool(kvkv: ($2599, $2600).fststd/core/types/tuple2/fst: (tuple2 : ($2599, $2600)) -> $2601 $2599) then Juststd/core/types/Just: forall<a> (value : a) -> maybe<a>(kvkv: ($2599, $2600).sndstd/core/types/tuple2/snd: (tuple2 : ($2599, $2600)) -> $2601 $2600) else Nothingstd/core/types/Nothing: forall<a> maybe<a> + if predpred: ($2599) -> $2601 bool(kvkv: ($2599, $2600).fststd/core/types/tuple2/fst: (tuple2 : ($2599, $2600)) -> $2601 $2599) then Juststd/core/types/Just: forall<a> (value : a) -> maybe<a>(kvkv: ($2599, $2600).sndstd/core/types/tuple2/snd: (tuple2 : ($2599, $2600)) -> $2601 $2600) else Nothingstd/core/types/Nothing: forall<a> maybe<a> // Convert a `:maybe` type to a list type. -pub fun maybe/liststd/core/list/maybe/list: forall<a> (m : maybe<a>) -> list<a>( mm: maybe<$1668> : maybestd/core/types/maybe: V -> V<aa: V> )result: -> total list<1696> : liststd/core/types/list: V -> V<aa: V> +pub fun maybe/liststd/core/list/maybe/list: forall<a> (m : maybe<a>) -> list<a>( mm: maybe<$1668> : maybestd/core/types/maybe: V -> V<aa: V> )result: -> total list<1696> : liststd/core/types/list: V -> V<aa: V> match mm: maybe<$1668> - Nothingstd/core/types/Nothing: forall<a> maybe<a> -> Nilstd/core/types/Nil: forall<a> list<a> - Juststd/core/types/Just: forall<a> (value : a) -> maybe<a>(xx: $1668) -> Consstd/core/types/Cons: forall<a> (head : a, tail : list<a>) -> list<a>(xx: $1668,Nilstd/core/types/Nil: forall<a> list<a>) + Nothingstd/core/types/Nothing: forall<a> maybe<a> -> Nilstd/core/types/Nil: forall<a> list<a> + Juststd/core/types/Just: forall<a> (value : a) -> maybe<a>(xx: $1668) -> Consstd/core/types/Cons: forall<a> (head : a, tail : list<a>) -> list<a>(xx: $1668,Nilstd/core/types/Nil: forall<a> list<a>) -fun index-of-accstd/core/list/index-of-acc: forall<a,e> (xs : list<a>, pred : (a) -> e bool, idx : int) -> e int( xsxs: list<$2734> : liststd/core/types/list: V -> V<aa: V>, predpred: ($2734) -> $2735 bool : aa: V -> ee: E boolstd/core/types/bool: V, idxidx: int : intstd/core/types/int: V )result: -> 2775 int : ee: E intstd/core/types/int: V +fun index-of-accstd/core/list/index-of-acc: forall<a,e> (xs : list<a>, pred : (a) -> e bool, idx : int) -> e int( xsxs: list<$2734> : liststd/core/types/list: V -> V<aa: V>, predpred: ($2734) -> $2735 bool : aa: V -> ee: E boolstd/core/types/bool: V, idxidx: int : intstd/core/types/int: V )result: -> 2775 int : ee: E intstd/core/types/int: V match xsxs: list<$2734> - Consstd/core/types/Cons: forall<a> (head : a, tail : list<a>) -> list<a>(xx: $2734,xxxx: list<$2734>) -> if predpred: ($2734) -> $2735 bool(xx: $2734) then idxidx: int else index-of-accstd/core/list/index-of-acc: (xs : list<$2734>, pred : ($2734) -> $2735 bool, idx : int) -> $2735 int(xxxx: list<$2734>,predpred: ($2734) -> $2735 bool,idxidx: int+std/core/int/(+): (x : int, y : int) -> $2735 int1literal: int
dec = 1
hex8 = 0x01
bit8 = 0b00000001
) - Nilstd/core/types/Nil: forall<a> list<a> -> -1literal: int
dec = -1
hex8 = 0xFF
bit8 = 0b11111111
+ Consstd/core/types/Cons: forall<a> (head : a, tail : list<a>) -> list<a>(xx: $2734,xxxx: list<$2734>) -> if predpred: ($2734) -> $2735 bool(xx: $2734) then idxidx: int else index-of-accstd/core/list/index-of-acc: (xs : list<$2734>, pred : ($2734) -> $2735 bool, idx : int) -> $2735 int(xxxx: list<$2734>,predpred: ($2734) -> $2735 bool,idxidx: int+std/core/int/(+): (x : int, y : int) -> $2735 int1literal: int
dec = 1
hex8 = 0x01
bit8 = 0b00000001
) + Nilstd/core/types/Nil: forall<a> list<a> -> -1literal: int
dec = -1
hex8 = 0xFF
bit8 = 0b11111111
// Returns the index of the first element where `pred` holds, or `-1` if no such element exists. -pub fun index-ofstd/core/list/index-of: forall<a,e> (xs : list<a>, pred : (a) -> e bool) -> e int( xsxs: list<$2782> : liststd/core/types/list: V -> V<aa: V>, predpred: ($2782) -> $2783 bool : aa: V -> ee: E boolstd/core/types/bool: V )result: -> 2804 int : ee: E intstd/core/types/int: V +pub fun index-ofstd/core/list/index-of: forall<a,e> (xs : list<a>, pred : (a) -> e bool) -> e int( xsxs: list<$2782> : liststd/core/types/list: V -> V<aa: V>, predpred: ($2782) -> $2783 bool : aa: V -> ee: E boolstd/core/types/bool: V )result: -> 2804 int : ee: E intstd/core/types/int: V index-of-accstd/core/list/index-of-acc: (xs : list<$2782>, pred : ($2782) -> $2783 bool, idx : int) -> $2783 int( xsxs: list<$2782>, predpred: ($2782) -> $2783 bool, 0literal: int
dec = 0
hex8 = 0x00
bit8 = 0b00000000
) // Invoke `action` for each element of a list -pub fun foreachstd/core/list/foreach: forall<a,e> (xs : list<a>, action : (a) -> e ()) -> e ()( xsxs: list<$2811> : liststd/core/types/list: V -> V<aa: V>, actionaction: ($2811) -> $2812 () : (aa: V) -> ee: E (std/core/types/unit: V)std/core/types/unit: V )result: -> 2850 () : ee: E (std/core/types/unit: V)std/core/types/unit: V +pub fun foreachstd/core/list/foreach: forall<a,e> (xs : list<a>, action : (a) -> e ()) -> e ()( xsxs: list<$2811> : liststd/core/types/list: V -> V<aa: V>, actionaction: ($2811) -> $2812 () : (aa: V) -> ee: E (std/core/types/unit: V)std/core/types/unit: V )result: -> 2850 () : ee: E (std/core/types/unit: V)std/core/types/unit: V match xsxs: list<$2811> - Consstd/core/types/Cons: forall<a> (head : a, tail : list<a>) -> list<a>(xx: $2811,xxxx: list<$2811>) -> { actionaction: ($2811) -> $2812 ()(xx: $2811); xxxx: list<$2811>.foreachstd/core/list/foreach: (xs : list<$2811>, action : ($2811) -> $2812 ()) -> $2812 ()(actionaction: ($2811) -> $2812 ()) } - Nilstd/core/types/Nil: forall<a> list<a> -> (std/core/types/Unit: ())std/core/types/Unit: () + Consstd/core/types/Cons: forall<a> (head : a, tail : list<a>) -> list<a>(xx: $2811,xxxx: list<$2811>) -> { actionaction: ($2811) -> $2812 ()(xx: $2811); xxxx: list<$2811>.foreachstd/core/list/foreach: (xs : list<$2811>, action : ($2811) -> $2812 ()) -> $2812 ()(actionaction: ($2811) -> $2812 ()) } + Nilstd/core/types/Nil: forall<a> list<a> -> (std/core/types/Unit: ())std/core/types/Unit: () // Invoke `action` for each element of a list while `action` return `Nothing` -pub fun foreach-whilestd/core/list/foreach-while: forall<a,b,e> (xs : list<a>, action : (a) -> e maybe<b>) -> e maybe<b>( xsxs: list<$1488> : liststd/core/types/list: V -> V<aa: V>, actionaction: ($1488) -> $1490 maybe<$1489> : (aa: V) -> ee: E maybestd/core/types/maybe: V -> V<bb: V> )result: -> 1546 maybe<1545> : ee: E maybestd/core/types/maybe: V -> V<bb: V> +pub fun foreach-whilestd/core/list/foreach-while: forall<a,b,e> (xs : list<a>, action : (a) -> e maybe<b>) -> e maybe<b>( xsxs: list<$1488> : liststd/core/types/list: V -> V<aa: V>, actionaction: ($1488) -> $1490 maybe<$1489> : (aa: V) -> ee: E maybestd/core/types/maybe: V -> V<bb: V> )result: -> 1546 maybe<1545> : ee: E maybestd/core/types/maybe: V -> V<bb: V> match xsxs: list<$1488> - Nilstd/core/types/Nil: forall<a> list<a> -> Nothingstd/core/types/Nothing: forall<a> maybe<a> - Consstd/core/types/Cons: forall<a> (head : a, tail : list<a>) -> list<a>(xx: $1488,xxxx: list<$1488>) -> + Nilstd/core/types/Nil: forall<a> list<a> -> Nothingstd/core/types/Nothing: forall<a> maybe<a> + Consstd/core/types/Cons: forall<a> (head : a, tail : list<a>) -> list<a>(xx: $1488,xxxx: list<$1488>) -> match actionaction: ($1488) -> $1490 maybe<$1489>(xx: $1488) - Nothingstd/core/types/Nothing: forall<a> maybe<a> -> xxxx: list<$1488>.foreach-whilestd/core/list/foreach-while: (xs : list<$1488>, action : ($1488) -> $1490 maybe<$1489>) -> $1490 maybe<$1489>(actionaction: ($1488) -> $1490 maybe<$1489>) + Nothingstd/core/types/Nothing: forall<a> maybe<a> -> xxxx: list<$1488>.foreach-whilestd/core/list/foreach-while: (xs : list<$1488>, action : ($1488) -> $1490 maybe<$1489>) -> $1490 maybe<$1489>(actionaction: ($1488) -> $1490 maybe<$1489>) justjust: maybe<$1489> -> justjust: maybe<$1489> // Invoke `action` on each element of a list while `action` returns `Just` -pub fun map-whilestd/core/list/map-while: forall<a,b,e> (xs : list<a>, action : (a) -> e maybe<b>) -> e list<b>( xsxs: list<$2861> : liststd/core/types/list: V -> V<aa: V>, actionaction: ($2861) -> $2863 maybe<$2862> : (aa: V) -> ee: E maybestd/core/types/maybe: V -> V<bb: V> )result: -> 2921 list<2920> : ee: E liststd/core/types/list: V -> V<bb: V> +pub fun map-whilestd/core/list/map-while: forall<a,b,e> (xs : list<a>, action : (a) -> e maybe<b>) -> e list<b>( xsxs: list<$2861> : liststd/core/types/list: V -> V<aa: V>, actionaction: ($2861) -> $2863 maybe<$2862> : (aa: V) -> ee: E maybestd/core/types/maybe: V -> V<bb: V> )result: -> 2921 list<2920> : ee: E liststd/core/types/list: V -> V<bb: V> match xsxs: list<$2861> - Nilstd/core/types/Nil: forall<a> list<a> -> Nilstd/core/types/Nil: forall<a> list<a> - Consstd/core/types/Cons: forall<a> (head : a, tail : list<a>) -> list<a>(xx: $2861,xxxx: list<$2861>) -> + Nilstd/core/types/Nil: forall<a> list<a> -> Nilstd/core/types/Nil: forall<a> list<a> + Consstd/core/types/Cons: forall<a> (head : a, tail : list<a>) -> list<a>(xx: $2861,xxxx: list<$2861>) -> match actionaction: ($2861) -> $2863 maybe<$2862>(xx: $2861) - Juststd/core/types/Just: forall<a> (value : a) -> maybe<a>(yy: $2862) -> Consstd/core/types/Cons: forall<a> (head : a, tail : list<a>) -> list<a>(yy: $2862,xxxx: list<$2861>.map-whilestd/core/list/map-while: (xs : list<$2861>, action : ($2861) -> $2863 maybe<$2862>) -> $2863 list<$2862>(actionaction: ($2861) -> $2863 maybe<$2862>)) - Nothingstd/core/types/Nothing: forall<a> maybe<a> -> Nilstd/core/types/Nil: forall<a> list<a> + Juststd/core/types/Just: forall<a> (value : a) -> maybe<a>(yy: $2862) -> Consstd/core/types/Cons: forall<a> (head : a, tail : list<a>) -> list<a>(yy: $2862,xxxx: list<$2861>.map-whilestd/core/list/map-while: (xs : list<$2861>, action : ($2861) -> $2863 maybe<$2862>) -> $2863 list<$2862>(actionaction: ($2861) -> $2863 maybe<$2862>)) + Nothingstd/core/types/Nothing: forall<a> maybe<a> -> Nilstd/core/types/Nil: forall<a> list<a> // Invoke `action` for each element of a list, passing also the position of the element. -pub fun foreach-indexedstd/core/list/foreach-indexed: forall<a,e> (xs : list<a>, action : (int, a) -> e ()) -> e ()( xsxs: list<$2931> : liststd/core/types/list: V -> V<aa: V>, actionaction: (int, $2931) -> $2932 () : (intstd/core/types/int: V,aa: V) -> ee: E (std/core/types/unit: V)std/core/types/unit: V )result: -> 3043 () : ee: E (std/core/types/unit: V)std/core/types/unit: V +pub fun foreach-indexedstd/core/list/foreach-indexed: forall<a,e> (xs : list<a>, action : (int, a) -> e ()) -> e ()( xsxs: list<$2931> : liststd/core/types/list: V -> V<aa: V>, actionaction: (int, $2931) -> $2932 () : (intstd/core/types/int: V,aa: V) -> ee: E (std/core/types/unit: V)std/core/types/unit: V )result: -> 3043 () : ee: E (std/core/types/unit: V)std/core/types/unit: V var ii: local-var<$2941,int> := 0literal: int
dec = 0
hex8 = 0x00
bit8 = 0b00000000
xsxs: list<$2931>.foreachstd/core/list/foreach: (xs : list<$2931>, action : ($2931) -> <local<$2941>|$2932> ()) -> <local<$2941>|$2932> () fnfn: (x : $2931) -> <local<$2941>|$2932> ()(xx: $2931) val jj: int = ii: int // don't dereference `i` inside the inject mask<local_1: H>{ actionaction: (int, $2931) -> $2932 ()(jj: int,xx: $2931) } - ii: local-var<$2941,int> :=std/core/types/local-set: (v : local-var<$2941,int>, assigned : int) -> <local<$2941>|$2932> () ii: int+std/core/int/(+): (x : int, y : int) -> <local<$2941>|$2932> int
1literal: int
dec = 1
hex8 = 0x01
bit8 = 0b00000001
+ ii: local-var<$2941,int> :=std/core/types/local-set: (v : local-var<$2941,int>, assigned : int) -> <local<$2941>|$2932> () ii: int+std/core/int/(+): (x : int, y : int) -> <local<$2941>|$2932> int1literal: int
dec = 1
hex8 = 0x01
bit8 = 0b00000001
// Insert a separator `sep` between all elements of a list `xs` . -pub fun interspersestd/core/list/intersperse: forall<a> (xs : list<a>, sep : a) -> list<a>( xsxs: list<$3050> : liststd/core/types/list: V -> V<aa: V>, sepsep: $3050 : aa: V )result: -> total list<3113> : liststd/core/types/list: V -> V<aa: V> +pub fun interspersestd/core/list/intersperse: forall<a> (xs : list<a>, sep : a) -> list<a>( xsxs: list<$3050> : liststd/core/types/list: V -> V<aa: V>, sepsep: $3050 : aa: V )result: -> total list<3113> : liststd/core/types/list: V -> V<aa: V> fun beforebefore: (ys : list<$3050>) -> list<$3050>(ysys: list<$3050>)result: -> total list<$3050> match ysys: list<$3050> - Consstd/core/types/Cons: forall<a> (head : a, tail : list<a>) -> list<a>(yy: $3050,yyyy: list<$3050>) -> Consstd/core/types/Cons: forall<a> (head : a, tail : list<a>) -> list<a>(sepsep: $3050,Consstd/core/types/Cons: forall<a> (head : a, tail : list<a>) -> list<a>(yy: $3050,beforebefore: (ys : list<$3050>) -> list<$3050>(yyyy: list<$3050>))) - Nilstd/core/types/Nil: forall<a> list<a> -> Nilstd/core/types/Nil: forall<a> list<a> + Consstd/core/types/Cons: forall<a> (head : a, tail : list<a>) -> list<a>(yy: $3050,yyyy: list<$3050>) -> Consstd/core/types/Cons: forall<a> (head : a, tail : list<a>) -> list<a>(sepsep: $3050,Consstd/core/types/Cons: forall<a> (head : a, tail : list<a>) -> list<a>(yy: $3050,beforebefore: (ys : list<$3050>) -> list<$3050>(yyyy: list<$3050>))) + Nilstd/core/types/Nil: forall<a> list<a> -> Nilstd/core/types/Nil: forall<a> list<a> match xsxs: list<$3050> - Consstd/core/types/Cons: forall<a> (head : a, tail : list<a>) -> list<a>(xx: $3050,xxxx: list<$3050>) -> Consstd/core/types/Cons: forall<a> (head : a, tail : list<a>) -> list<a>(xx: $3050, xxxx: list<$3050>.beforebefore: (ys : list<$3050>) -> list<$3050>) - Nilstd/core/types/Nil: forall<a> list<a> -> Nilstd/core/types/Nil: forall<a> list<a> + Consstd/core/types/Cons: forall<a> (head : a, tail : list<a>) -> list<a>(xx: $3050,xxxx: list<$3050>) -> Consstd/core/types/Cons: forall<a> (head : a, tail : list<a>) -> list<a>(xx: $3050, xxxx: list<$3050>.beforebefore: (ys : list<$3050>) -> list<$3050>) + Nilstd/core/types/Nil: forall<a> list<a> -> Nilstd/core/types/Nil: forall<a> list<a> // Concatenate all strings in a list -fun joinsepstd/core/list/joinsep: (xs : list<string>, sep : string) -> string( xsxs: list<string> : liststd/core/types/list: V -> V<stringstd/core/types/string: V>, sepsep: string : stringstd/core/types/string: V )result: -> total string : stringstd/core/types/string: V +fun joinsepstd/core/list/joinsep: (xs : list<string>, sep : string) -> string( xsxs: list<string> : liststd/core/types/list: V -> V<stringstd/core/types/string: V>, sepsep: string : stringstd/core/types/string: V )result: -> total string : stringstd/core/types/string: V match xsxs: list<string> - Nilstd/core/types/Nil: forall<a> list<a> -> ""literal: string
count= 0
- Consstd/core/types/Cons: forall<a> (head : a, tail : list<a>) -> list<a>(xx: string,Nilstd/core/types/Nil: forall<a> list<a>) -> xx: string - Consstd/core/types/Cons: forall<a> (head : a, tail : list<a>) -> list<a>(xx: string,Consstd/core/types/Cons: forall<a> (head : a, tail : list<a>) -> list<a>(yy: string,Nilstd/core/types/Nil: forall<a> list<a>)) | sepsep: string.is-emptystd/core/string/is-empty: (s : string) -> bool -> xx: string ++std/core/types/(++): (x : string, y : string) -> string yy: string - _ -> xsxs: list<string>.vectorstd/core/vector/list/vector: (xs : list<string>) -> vector<string>.joinstd/core/string/vectorsep/join: (v : vector<string>, sep : string) -> string(sepsep: string
) + Nilstd/core/types/Nil: forall<a> list<a> -> ""literal: string
count= 0
+ Consstd/core/types/Cons: forall<a> (head : a, tail : list<a>) -> list<a>(xx: string,Nilstd/core/types/Nil: forall<a> list<a>) -> xx: string + Consstd/core/types/Cons: forall<a> (head : a, tail : list<a>) -> list<a>(xx: string,Consstd/core/types/Cons: forall<a> (head : a, tail : list<a>) -> list<a>(yy: string,Nilstd/core/types/Nil: forall<a> list<a>)) | sepsep: string.is-emptystd/core/string/is-empty: (s : string) -> bool -> xx: string ++std/core/types/(++): (x : string, y : string) -> string yy: string + _ -> xsxs: list<string>.vectorstd/core/vector/list/vector: (xs : list<string>) -> vector<string>.joinstd/core/string/vectorsep/join: (v : vector<string>, sep : string) -> string(sepsep: string) // Concatenate all strings in a list -pub fun joinstd/core/list/join: (xs : list<string>) -> string( xsxs: list<string> : liststd/core/types/list: V -> V<stringstd/core/types/string: V> )result: -> total string : stringstd/core/types/string: V +pub fun joinstd/core/list/join: (xs : list<string>) -> string( xsxs: list<string> : liststd/core/types/list: V -> V<stringstd/core/types/string: V> )result: -> total string : stringstd/core/types/string: V match xsxs: list<string> - Nilstd/core/types/Nil: forall<a> list<a> -> ""literal: string
count= 0
- Consstd/core/types/Cons: forall<a> (head : a, tail : list<a>) -> list<a>(xx: string,Nilstd/core/types/Nil: forall<a> list<a>) -> xx: string - Consstd/core/types/Cons: forall<a> (head : a, tail : list<a>) -> list<a>(xx: string,Consstd/core/types/Cons: forall<a> (head : a, tail : list<a>) -> list<a>(yy: string,Nilstd/core/types/Nil: forall<a> list<a>)) -> xx: string ++std/core/types/(++): (x : string, y : string) -> string yy: string - _ -> xsxs: list<string>.vectorstd/core/vector/list/vector: (xs : list<string>) -> vector<string>.joinstd/core/string/vector/join: (v : vector<string>) -> string(
) + Nilstd/core/types/Nil: forall<a> list<a> -> ""literal: string
count= 0
+ Consstd/core/types/Cons: forall<a> (head : a, tail : list<a>) -> list<a>(xx: string,Nilstd/core/types/Nil: forall<a> list<a>) -> xx: string + Consstd/core/types/Cons: forall<a> (head : a, tail : list<a>) -> list<a>(xx: string,Consstd/core/types/Cons: forall<a> (head : a, tail : list<a>) -> list<a>(yy: string,Nilstd/core/types/Nil: forall<a> list<a>)) -> xx: string ++std/core/types/(++): (x : string, y : string) -> string yy: string + _ -> xsxs: list<string>.vectorstd/core/vector/list/vector: (xs : list<string>) -> vector<string>.joinstd/core/string/vector/join: (v : vector<string>) -> string() // Concatenate all strings in a list using a specific separator -pub fun joinsep/joinstd/core/list/joinsep/join: (xs : list<string>, sep : string) -> string( xsxs: list<string> : liststd/core/types/list: V -> V<stringstd/core/types/string: V>, sepsep: string : stringstd/core/types/string: V )result: -> total string : stringstd/core/types/string: V +pub fun joinsep/joinstd/core/list/joinsep/join: (xs : list<string>, sep : string) -> string( xsxs: list<string> : liststd/core/types/list: V -> V<stringstd/core/types/string: V>, sepsep: string : stringstd/core/types/string: V )result: -> total string : stringstd/core/types/string: V xsxs: list<string>.joinsepstd/core/list/joinsep: (xs : list<string>, sep : string) -> string(sepsep: string) // Concatenate all strings in a list in reverse order -pub fun reverse-joinstd/core/list/reverse-join: (xs : list<string>) -> string( xsxs: list<string> : liststd/core/types/list: V -> V<stringstd/core/types/string: V> )result: -> total string : stringstd/core/types/string: V +pub fun reverse-joinstd/core/list/reverse-join: (xs : list<string>) -> string( xsxs: list<string> : liststd/core/types/list: V -> V<stringstd/core/types/string: V> )result: -> total string : stringstd/core/types/string: V xsxs: list<string>.reversestd/core/list/reverse: (xs : list<string>) -> list<string>.joinstd/core/list/join: (xs : list<string>) -> string // Append `end` to each string in the list `xs` and join them all together.\ // `join-end([],end) === ""`\ // `join-end(["a","b"],"/") === "a/b/"` -pub fun join-endstd/core/list/join-end: (xs : list<string>, end : string) -> string( xsxs: list<string> : liststd/core/types/list: V -> V<stringstd/core/types/string: V>, endend: string : stringstd/core/types/string: V)result: -> total string : stringstd/core/types/string: V +pub fun join-endstd/core/list/join-end: (xs : list<string>, end : string) -> string( xsxs: list<string> : liststd/core/types/list: V -> V<stringstd/core/types/string: V>, endend: string : stringstd/core/types/string: V)result: -> total string : stringstd/core/types/string: V match xsxs: list<string> - Nilstd/core/types/Nil: forall<a> list<a> -> ""literal: string
count= 0
- _ -> xsxs: list<string>.joinsepstd/core/list/joinsep: (xs : list<string>, sep : string) -> string(endend: string) ++std/core/types/(++): (x : string, y : string) -> string endend: string
+ Nilstd/core/types/Nil: forall<a> list<a> -> ""literal: string
count= 0
+ _ -> xsxs: list<string>.joinsepstd/core/list/joinsep: (xs : list<string>, sep : string) -> string(endend: string) ++std/core/types/(++): (x : string, y : string) -> string endend: string // Concatenate all lists in a list (e.g. flatten the list). (tail-recursive) -pub fun concatstd/core/list/concat: forall<a> (xss : list<list<a>>) -> list<a>( xssxss: list<list<$4634>> : liststd/core/types/list: V -> V<liststd/core/types/list: V -> V<aa: V>> )result: -> total list<4705> : liststd/core/types/list: V -> V<aa: V> - fun concat-preconcat-pre: forall<a> (ys : list<a>, zss : list<list<a>>) -> list<a>( ysys: list<$4635> : liststd/core/types/list: V -> V<aa: V>, zsszss: list<list<$4635>> : liststd/core/types/list: V -> V<liststd/core/types/list: V -> V<aa: V>> )result: -> total list<4684> : liststd/core/types/list: V -> V<aa: V> +pub fun concatstd/core/list/concat: forall<a> (xss : list<list<a>>) -> list<a>( xssxss: list<list<$4634>> : liststd/core/types/list: V -> V<liststd/core/types/list: V -> V<aa: V>> )result: -> total list<4705> : liststd/core/types/list: V -> V<aa: V> + fun concat-preconcat-pre: forall<a> (ys : list<a>, zss : list<list<a>>) -> list<a>( ysys: list<$4635> : liststd/core/types/list: V -> V<aa: V>, zsszss: list<list<$4635>> : liststd/core/types/list: V -> V<liststd/core/types/list: V -> V<aa: V>> )result: -> total list<4684> : liststd/core/types/list: V -> V<aa: V> match ysys: list<$4635> - Consstd/core/types/Cons: forall<a> (head : a, tail : list<a>) -> list<a>(yy: $4635,yyyy: list<$4635>) -> Consstd/core/types/Cons: forall<a> (head : a, tail : list<a>) -> list<a>(yy: $4635,concat-preconcat-pre: (ys : list<$4635>, zss : list<list<$4635>>) -> list<$4635>(yyyy: list<$4635>,zsszss: list<list<$4635>>)) - Nilstd/core/types/Nil: forall<a> list<a> -> match zsszss: list<list<$4635>> - Consstd/core/types/Cons: forall<a> (head : a, tail : list<a>) -> list<a>(zszs: list<$4635>,zzszzs: list<list<$4635>>) -> concat-preconcat-pre: (ys : list<$4635>, zss : list<list<$4635>>) -> list<$4635>(zszs: list<$4635>,zzszzs: list<list<$4635>>) - Nilstd/core/types/Nil: forall<a> list<a> -> Nilstd/core/types/Nil: forall<a> list<a> - concat-preconcat-pre: (ys : list<$4634>, zss : list<list<$4634>>) -> list<$4634>([std/core/types/Nil: forall<a> list<a>]std/core/types/Nil: forall<a> list<a>,xssxss: list<list<$4634>>) + Consstd/core/types/Cons: forall<a> (head : a, tail : list<a>) -> list<a>(yy: $4635,yyyy: list<$4635>) -> Consstd/core/types/Cons: forall<a> (head : a, tail : list<a>) -> list<a>(yy: $4635,concat-preconcat-pre: (ys : list<$4635>, zss : list<list<$4635>>) -> list<$4635>(yyyy: list<$4635>,zsszss: list<list<$4635>>)) + Nilstd/core/types/Nil: forall<a> list<a> -> match zsszss: list<list<$4635>> + Consstd/core/types/Cons: forall<a> (head : a, tail : list<a>) -> list<a>(zszs: list<$4635>,zzszzs: list<list<$4635>>) -> concat-preconcat-pre: (ys : list<$4635>, zss : list<list<$4635>>) -> list<$4635>(zszs: list<$4635>,zzszzs: list<list<$4635>>) + Nilstd/core/types/Nil: forall<a> list<a> -> Nilstd/core/types/Nil: forall<a> list<a> + concat-preconcat-pre: (ys : list<$4634>, zss : list<list<$4634>>) -> list<$4634>([std/core/types/Nil: forall<a> list<a>]std/core/types/Nil: forall<a> list<a>,xssxss: list<list<$4634>>) // Concatenate the result lists from applying a function to all elements. -pub fun flatmapstd/core/list/flatmap: forall<a,b,e> (xs : list<a>, f : (a) -> e list<b>) -> e list<b>( xsxs: list<$4710>: liststd/core/types/list: V -> V<aa: V>, ff: ($4710) -> $4712 list<$4711> : aa: V -> ee: E liststd/core/types/list: V -> V<bb: V> )result: -> 4775 list<4774> : ee: E liststd/core/types/list: V -> V<bb: V> +pub fun flatmapstd/core/list/flatmap: forall<a,b,e> (xs : list<a>, f : (a) -> e list<b>) -> e list<b>( xsxs: list<$4710>: liststd/core/types/list: V -> V<aa: V>, ff: ($4710) -> $4712 list<$4711> : aa: V -> ee: E liststd/core/types/list: V -> V<bb: V> )result: -> 4775 list<4774> : ee: E liststd/core/types/list: V -> V<bb: V> fun flatmap-preflatmap-pre: (ys : list<$4711>, zs : list<$4710>) -> $4712 list<$4711>( ysys: list<$4711>, zszs: list<$4710> )result: -> $4712 list<$4711> match ysys: list<$4711> - Consstd/core/types/Cons: forall<a> (head : a, tail : list<a>) -> list<a>(yy: $4711,yyyy: list<$4711>) -> Consstd/core/types/Cons: forall<a> (head : a, tail : list<a>) -> list<a>(yy: $4711,flatmap-preflatmap-pre: (ys : list<$4711>, zs : list<$4710>) -> $4712 list<$4711>(yyyy: list<$4711>,zszs: list<$4710>)) - Nilstd/core/types/Nil: forall<a> list<a> -> match zszs: list<$4710> - Consstd/core/types/Cons: forall<a> (head : a, tail : list<a>) -> list<a>(zz: $4710,zzzz: list<$4710>) -> flatmap-preflatmap-pre: (ys : list<$4711>, zs : list<$4710>) -> $4712 list<$4711>(ff: ($4710) -> $4712 list<$4711>(zz: $4710),zzzz: list<$4710>) - Nilstd/core/types/Nil: forall<a> list<a> -> Nilstd/core/types/Nil: forall<a> list<a> - flatmap-preflatmap-pre: (ys : list<$4711>, zs : list<$4710>) -> $4712 list<$4711>([std/core/types/Nil: forall<a> list<a>]std/core/types/Nil: forall<a> list<a>,xsxs: list<$4710>) + Consstd/core/types/Cons: forall<a> (head : a, tail : list<a>) -> list<a>(yy: $4711,yyyy: list<$4711>) -> Consstd/core/types/Cons: forall<a> (head : a, tail : list<a>) -> list<a>(yy: $4711,flatmap-preflatmap-pre: (ys : list<$4711>, zs : list<$4710>) -> $4712 list<$4711>(yyyy: list<$4711>,zszs: list<$4710>)) + Nilstd/core/types/Nil: forall<a> list<a> -> match zszs: list<$4710> + Consstd/core/types/Cons: forall<a> (head : a, tail : list<a>) -> list<a>(zz: $4710,zzzz: list<$4710>) -> flatmap-preflatmap-pre: (ys : list<$4711>, zs : list<$4710>) -> $4712 list<$4711>(ff: ($4710) -> $4712 list<$4711>(zz: $4710),zzzz: list<$4710>) + Nilstd/core/types/Nil: forall<a> list<a> -> Nilstd/core/types/Nil: forall<a> list<a> + flatmap-preflatmap-pre: (ys : list<$4711>, zs : list<$4710>) -> $4712 list<$4711>([std/core/types/Nil: forall<a> list<a>]std/core/types/Nil: forall<a> list<a>,xsxs: list<$4710>) // Concatenate the `Just` result elements from applying a function to all elements. -pub fun flatmap-maybestd/core/list/flatmap-maybe: forall<a,b,e> (xs : list<a>, f : (a) -> e maybe<b>) -> e list<b>( xsxs: list<$4785> : liststd/core/types/list: V -> V<aa: V>, ff: ($4785) -> $4787 maybe<$4786> : aa: V -> ee: E maybestd/core/types/maybe: V -> V<bb: V> )result: -> 4854 list<4853> : ee: E liststd/core/types/list: V -> V<bb: V> +pub fun flatmap-maybestd/core/list/flatmap-maybe: forall<a,b,e> (xs : list<a>, f : (a) -> e maybe<b>) -> e list<b>( xsxs: list<$4785> : liststd/core/types/list: V -> V<aa: V>, ff: ($4785) -> $4787 maybe<$4786> : aa: V -> ee: E maybestd/core/types/maybe: V -> V<bb: V> )result: -> 4854 list<4853> : ee: E liststd/core/types/list: V -> V<bb: V> match xsxs: list<$4785> - Consstd/core/types/Cons: forall<a> (head : a, tail : list<a>) -> list<a>(xx: $4785,xxxx: list<$4785>) -> match ff: ($4785) -> $4787 maybe<$4786>(xx: $4785) - Juststd/core/types/Just: forall<a> (value : a) -> maybe<a>(yy: $4786) -> Consstd/core/types/Cons: forall<a> (head : a, tail : list<a>) -> list<a>(yy: $4786, xxxx: list<$4785>.flatmap-maybestd/core/list/flatmap-maybe: (xs : list<$4785>, f : ($4785) -> $4787 maybe<$4786>) -> $4787 list<$4786>(ff: ($4785) -> $4787 maybe<$4786>)) - Nothingstd/core/types/Nothing: forall<a> maybe<a> -> xxxx: list<$4785>.flatmap-maybestd/core/list/flatmap-maybe: (xs : list<$4785>, f : ($4785) -> $4787 maybe<$4786>) -> $4787 list<$4786>(ff: ($4785) -> $4787 maybe<$4786>) - Nilstd/core/types/Nil: forall<a> list<a> -> Nilstd/core/types/Nil: forall<a> list<a> + Consstd/core/types/Cons: forall<a> (head : a, tail : list<a>) -> list<a>(xx: $4785,xxxx: list<$4785>) -> match ff: ($4785) -> $4787 maybe<$4786>(xx: $4785) + Juststd/core/types/Just: forall<a> (value : a) -> maybe<a>(yy: $4786) -> Consstd/core/types/Cons: forall<a> (head : a, tail : list<a>) -> list<a>(yy: $4786, xxxx: list<$4785>.flatmap-maybestd/core/list/flatmap-maybe: (xs : list<$4785>, f : ($4785) -> $4787 maybe<$4786>) -> $4787 list<$4786>(ff: ($4785) -> $4787 maybe<$4786>)) + Nothingstd/core/types/Nothing: forall<a> maybe<a> -> xxxx: list<$4785>.flatmap-maybestd/core/list/flatmap-maybe: (xs : list<$4785>, f : ($4785) -> $4787 maybe<$4786>) -> $4787 list<$4786>(ff: ($4785) -> $4787 maybe<$4786>) + Nilstd/core/types/Nil: forall<a> list<a> -> Nilstd/core/types/Nil: forall<a> list<a> // Concatenate a list of `:maybe` values -pub fun concat-maybestd/core/list/concat-maybe: forall<a> (xs : list<maybe<a>>) -> list<a>( xsxs: list<maybe<$4864>> : liststd/core/types/list: V -> V<maybestd/core/types/maybe: V -> V<aa: V>> )result: -> total list<4911> : liststd/core/types/list: V -> V<aa: V> +pub fun concat-maybestd/core/list/concat-maybe: forall<a> (xs : list<maybe<a>>) -> list<a>( xsxs: list<maybe<$4864>> : liststd/core/types/list: V -> V<maybestd/core/types/maybe: V -> V<aa: V>> )result: -> total list<4911> : liststd/core/types/list: V -> V<aa: V> match xsxs: list<maybe<$4864>> - Consstd/core/types/Cons: forall<a> (head : a, tail : list<a>) -> list<a>(xx: maybe<$4864>,xxxx: list<maybe<$4864>>) -> match xx: maybe<$4864> - Juststd/core/types/Just: forall<a> (value : a) -> maybe<a>(yy: $4864) -> Consstd/core/types/Cons: forall<a> (head : a, tail : list<a>) -> list<a>(yy: $4864, xxxx: list<maybe<$4864>>.concat-maybestd/core/list/concat-maybe: (xs : list<maybe<$4864>>) -> list<$4864>) - Nothingstd/core/types/Nothing: forall<a> maybe<a> -> xxxx: list<maybe<$4864>>.concat-maybestd/core/list/concat-maybe: (xs : list<maybe<$4864>>) -> list<$4864> - Nilstd/core/types/Nil: forall<a> list<a> -> Nilstd/core/types/Nil: forall<a> list<a> + Consstd/core/types/Cons: forall<a> (head : a, tail : list<a>) -> list<a>(xx: maybe<$4864>,xxxx: list<maybe<$4864>>) -> match xx: maybe<$4864> + Juststd/core/types/Just: forall<a> (value : a) -> maybe<a>(yy: $4864) -> Consstd/core/types/Cons: forall<a> (head : a, tail : list<a>) -> list<a>(yy: $4864, xxxx: list<maybe<$4864>>.concat-maybestd/core/list/concat-maybe: (xs : list<maybe<$4864>>) -> list<$4864>) + Nothingstd/core/types/Nothing: forall<a> maybe<a> -> xxxx: list<maybe<$4864>>.concat-maybestd/core/list/concat-maybe: (xs : list<maybe<$4864>>) -> list<$4864> + Nilstd/core/types/Nil: forall<a> list<a> -> Nilstd/core/types/Nil: forall<a> list<a> // Return the last element of a list (or `Nothing` for the empty list) -pub fun laststd/core/list/last: forall<a> (xs : list<a>) -> maybe<a>( xsxs: list<$4916> : liststd/core/types/list: V -> V<aa: V> )result: -> total maybe<4953> : maybestd/core/types/maybe: V -> V<aa: V> +pub fun laststd/core/list/last: forall<a> (xs : list<a>) -> maybe<a>( xsxs: list<$4916> : liststd/core/types/list: V -> V<aa: V> )result: -> total maybe<4953> : maybestd/core/types/maybe: V -> V<aa: V> match xsxs: list<$4916> - Consstd/core/types/Cons: forall<a> (head : a, tail : list<a>) -> list<a>(xx: $4916,Nilstd/core/types/Nil: forall<a> list<a>) -> Juststd/core/types/Just: forall<a> (value : a) -> maybe<a>(xx: $4916) - Consstd/core/types/Cons: forall<a> (head : a, tail : list<a>) -> list<a>(_,xxxx: list<$4916>) -> laststd/core/list/last: (xs : list<$4916>) -> maybe<$4916>(xxxx: list<$4916>) - Nilstd/core/types/Nil: forall<a> list<a> -> Nothingstd/core/types/Nothing: forall<a> maybe<a> + Consstd/core/types/Cons: forall<a> (head : a, tail : list<a>) -> list<a>(xx: $4916,Nilstd/core/types/Nil: forall<a> list<a>) -> Juststd/core/types/Just: forall<a> (value : a) -> maybe<a>(xx: $4916) + Consstd/core/types/Cons: forall<a> (head : a, tail : list<a>) -> list<a>(_,xxxx: list<$4916>) -> laststd/core/list/last: (xs : list<$4916>) -> maybe<$4916>(xxxx: list<$4916>) + Nilstd/core/types/Nil: forall<a> list<a> -> Nothingstd/core/types/Nothing: forall<a> maybe<a> // Return the list without its last element. // Return an empty list for an empty list. -pub fun initstd/core/list/init: forall<a> (xs : list<a>) -> list<a>( xsxs: list<$4958> : liststd/core/types/list: V -> V<aa: V> )result: -> total list<4991> : liststd/core/types/list: V -> V<aa: V> +pub fun initstd/core/list/init: forall<a> (xs : list<a>) -> list<a>( xsxs: list<$4958> : liststd/core/types/list: V -> V<aa: V> )result: -> total list<4991> : liststd/core/types/list: V -> V<aa: V> match xsxs: list<$4958> - Consstd/core/types/Cons: forall<a> (head : a, tail : list<a>) -> list<a>(xx: $4958, xxxx: list<$4958> as Consstd/core/types/Cons: forall<a> (head : a, tail : list<a>) -> list<a>) -> Consstd/core/types/Cons: forall<a> (head : a, tail : list<a>) -> list<a>(xx: $4958,initstd/core/list/init: (xs : list<$4958>) -> list<$4958>(xxxx: list<$4958>)) - _ -> Nilstd/core/types/Nil: forall<a> list<a> + Consstd/core/types/Cons: forall<a> (head : a, tail : list<a>) -> list<a>(xx: $4958, xxxx: list<$4958> as Consstd/core/types/Cons: forall<a> (head : a, tail : list<a>) -> list<a>) -> Consstd/core/types/Cons: forall<a> (head : a, tail : list<a>) -> list<a>(xx: $4958,initstd/core/list/init: (xs : list<$4958>) -> list<$4958>(xxxx: list<$4958>)) + _ -> Nilstd/core/types/Nil: forall<a> list<a> // Get (zero-based) element `n` of a list. Return a `:maybe` type. -pub fun @index( xsxs: list<$4996> : liststd/core/types/list: V -> V<aa: V>, nn: int : intstd/core/types/int: V )result: -> total maybe<5068> : maybestd/core/types/maybe: V -> V<aa: V> +pub fun @index( xsxs: list<$4996> : liststd/core/types/list: V -> V<aa: V>, nn: int : intstd/core/types/int: V )result: -> total maybe<5068> : maybestd/core/types/maybe: V -> V<aa: V> match xsxs: list<$4996> - Consstd/core/types/Cons: forall<a> (head : a, tail : list<a>) -> list<a>(xx: $4996,xxxx: list<$4996>) -> if nn: int>std/core/int/(>): (x : int, y : int) -> bool0literal: int
dec = 0
hex8 = 0x00
bit8 = 0b00000000
then xxxx: list<$4996>[nn: int -std/core/int/(-): (x : int, y : int) -> int 1literal: int
dec = 1
hex8 = 0x01
bit8 = 0b00000001
] // == @index(xx,n-1) - elif nn: int==std/core/int/(==): (x : int, y : int) -> bool0literal: int
dec = 0
hex8 = 0x00
bit8 = 0b00000000
then Juststd/core/types/Just: forall<a> (value : a) -> maybe<a>(xx: $4996) - else Nothingstd/core/types/Nothing: forall<a> maybe<a> - Nilstd/core/types/Nil: forall<a> list<a> -> Nothingstd/core/types/Nothing: forall<a> maybe<a> + Consstd/core/types/Cons: forall<a> (head : a, tail : list<a>) -> list<a>(xx: $4996,xxxx: list<$4996>) -> if nn: int>std/core/int/(>): (x : int, y : int) -> bool0literal: int
dec = 0
hex8 = 0x00
bit8 = 0b00000000
then xxxx: list<$4996>[nn: int -std/core/int/(-): (x : int, y : int) -> int 1literal: int
dec = 1
hex8 = 0x01
bit8 = 0b00000001
] // == @index(xx,n-1) + elif nn: int==std/core/int/(==): (x : int, y : int) -> bool0literal: int
dec = 0
hex8 = 0x00
bit8 = 0b00000000
then Juststd/core/types/Just: forall<a> (value : a) -> maybe<a>(xx: $4996) + else Nothingstd/core/types/Nothing: forall<a> maybe<a> + Nilstd/core/types/Nil: forall<a> list<a> -> Nothingstd/core/types/Nothing: forall<a> maybe<a> // Do all elements satisfy a predicate ? -pub fun allstd/core/list/all: forall<a,e> (xs : list<a>, predicate : (a) -> e bool) -> e bool( xsxs: list<$5080> : liststd/core/types/list: V -> V<aa: V>, predicatepredicate: ($5080) -> $5081 bool : aa: V -> ee: E boolstd/core/types/bool: V )result: -> 5116 bool : ee: E boolstd/core/types/bool: V +pub fun allstd/core/list/all: forall<a,e> (xs : list<a>, predicate : (a) -> e bool) -> e bool( xsxs: list<$5080> : liststd/core/types/list: V -> V<aa: V>, predicatepredicate: ($5080) -> $5081 bool : aa: V -> ee: E boolstd/core/types/bool: V )result: -> 5116 bool : ee: E boolstd/core/types/bool: V match xsxs: list<$5080> - Consstd/core/types/Cons: forall<a> (head : a, tail : list<a>) -> list<a>(xx: $5080,xxxx: list<$5080>) -> if predicatepredicate: ($5080) -> $5081 bool(xx: $5080) then xxxx: list<$5080>.allstd/core/list/all: (xs : list<$5080>, predicate : ($5080) -> $5081 bool) -> $5081 bool(predicatepredicate: ($5080) -> $5081 bool) else Falsestd/core/types/False: bool - Nilstd/core/types/Nil: forall<a> list<a> -> Truestd/core/types/True: bool + Consstd/core/types/Cons: forall<a> (head : a, tail : list<a>) -> list<a>(xx: $5080,xxxx: list<$5080>) -> if predicatepredicate: ($5080) -> $5081 bool(xx: $5080) then xxxx: list<$5080>.allstd/core/list/all: (xs : list<$5080>, predicate : ($5080) -> $5081 bool) -> $5081 bool(predicatepredicate: ($5080) -> $5081 bool) else Falsestd/core/types/False: bool + Nilstd/core/types/Nil: forall<a> list<a> -> Truestd/core/types/True: bool // Are there any elements in a list that satisfy a predicate ? -pub fun anystd/core/list/any: forall<a,e> (xs : list<a>, predicate : (a) -> e bool) -> e bool( xsxs: list<$5123> : liststd/core/types/list: V -> V<aa: V>, predicatepredicate: ($5123) -> $5124 bool : aa: V -> ee: E boolstd/core/types/bool: V )result: -> 5159 bool : ee: E boolstd/core/types/bool: V +pub fun anystd/core/list/any: forall<a,e> (xs : list<a>, predicate : (a) -> e bool) -> e bool( xsxs: list<$5123> : liststd/core/types/list: V -> V<aa: V>, predicatepredicate: ($5123) -> $5124 bool : aa: V -> ee: E boolstd/core/types/bool: V )result: -> 5159 bool : ee: E boolstd/core/types/bool: V match xsxs: list<$5123> - Consstd/core/types/Cons: forall<a> (head : a, tail : list<a>) -> list<a>(xx: $5123,xxxx: list<$5123>) -> if predicatepredicate: ($5123) -> $5124 bool(xx: $5123) then Truestd/core/types/True: bool else xxxx: list<$5123>.anystd/core/list/any: (xs : list<$5123>, predicate : ($5123) -> $5124 bool) -> $5124 bool(predicatepredicate: ($5123) -> $5124 bool) - Nilstd/core/types/Nil: forall<a> list<a> -> Falsestd/core/types/False: bool + Consstd/core/types/Cons: forall<a> (head : a, tail : list<a>) -> list<a>(xx: $5123,xxxx: list<$5123>) -> if predicatepredicate: ($5123) -> $5124 bool(xx: $5123) then Truestd/core/types/True: bool else xxxx: list<$5123>.anystd/core/list/any: (xs : list<$5123>, predicate : ($5123) -> $5124 bool) -> $5124 bool(predicatepredicate: ($5123) -> $5124 bool) + Nilstd/core/types/Nil: forall<a> list<a> -> Falsestd/core/types/False: bool // Return the sum of a list of integers -pub fun sumstd/core/list/sum: (xs : list<int>) -> int( xsxs: list<int> : liststd/core/types/list: V -> V<intstd/core/types/int: V> )result: -> total int : intstd/core/types/int: V - xsxs: list<int>.foldlstd/core/list/foldl: (xs : list<int>, z : int, f : (int, int) -> int) -> int( 0literal: int
dec = 0
hex8 = 0x00
bit8 = 0b00000000
, fnfn: (x : int, y : int) -> int(xx: int,yy: int) { xx: int +std/core/int/(+): (x : int, y : int) -> int yy: int }
) +pub fun sumstd/core/list/sum: (xs : list<int>) -> int( xsxs: list<int> : liststd/core/types/list: V -> V<intstd/core/types/int: V> )result: -> total int : intstd/core/types/int: V + xsxs: list<int>.foldlstd/core/list/foldl: (xs : list<int>, z : int, f : (int, int) -> int) -> int( 0literal: int
dec = 0
hex8 = 0x00
bit8 = 0b00000000
, fnfn: (x : int, y : int) -> int(xx: int,yy: int) { xx: int +std/core/int/(+): (x : int, y : int) -> int yy: int }
) // Returns the smallest element of a list of integers (or `default` (=`0`) for the empty list) -pub fun minimumstd/core/list/minimum: (xs : list<int>, default : ? int) -> int( xsxs: list<int> : liststd/core/types/list: V -> V<intstd/core/types/int: V>, defaultdefault: ? int : intstd/core/types/int: V = 0literal: int
dec = 0
hex8 = 0x00
bit8 = 0b00000000
)result: -> total int : intstd/core/types/int: V +
pub fun minimumstd/core/list/minimum: (xs : list<int>, default : ? int) -> int( xsxs: list<int> : liststd/core/types/list: V -> V<intstd/core/types/int: V>, defaultdefault: ? int : intstd/core/types/int: V = 0literal: int
dec = 0
hex8 = 0x00
bit8 = 0b00000000
)result: -> total int : intstd/core/types/int: V match xsxs: list<int> - Nilstd/core/types/Nil: forall<a> list<a> -> defaultdefault: int - Consstd/core/types/Cons: forall<a> (head : a, tail : list<a>) -> list<a>(xx: int,xxxx: list<int>) -> xxxx: list<int>.foldlstd/core/list/foldl: (xs : list<int>, z : int, f : (int, int) -> int) -> int( xx: int, minstd/core/int/min: (i : int, j : int) -> int
) + Nilstd/core/types/Nil: forall<a> list<a> -> defaultdefault: int + Consstd/core/types/Cons: forall<a> (head : a, tail : list<a>) -> list<a>(xx: int,xxxx: list<int>) -> xxxx: list<int>.foldlstd/core/list/foldl: (xs : list<int>, z : int, f : (int, int) -> int) -> int( xx: int, minstd/core/int/min: (i : int, j : int) -> int ) // Returns the largest element of a list of integers (or `default` (=`0`) for the empty list) -pub fun maximumstd/core/list/maximum: (xs : list<int>, default : ? int) -> int( xsxs: list<int> : liststd/core/types/list: V -> V<intstd/core/types/int: V>, defaultdefault: ? int : intstd/core/types/int: V = 0literal: int
dec = 0
hex8 = 0x00
bit8 = 0b00000000
)result: -> total int : intstd/core/types/int: V +
pub fun maximumstd/core/list/maximum: (xs : list<int>, default : ? int) -> int( xsxs: list<int> : liststd/core/types/list: V -> V<intstd/core/types/int: V>, defaultdefault: ? int : intstd/core/types/int: V = 0literal: int
dec = 0
hex8 = 0x00
bit8 = 0b00000000
)result: -> total int : intstd/core/types/int: V match xsxs: list<int> - Nilstd/core/types/Nil: forall<a> list<a> -> defaultdefault: int - Consstd/core/types/Cons: forall<a> (head : a, tail : list<a>) -> list<a>(xx: int,xxxx: list<int>) -> xxxx: list<int>.foldlstd/core/list/foldl: (xs : list<int>, z : int, f : (int, int) -> int) -> int( xx: int, maxstd/core/int/max: (i : int, j : int) -> int
) + Nilstd/core/types/Nil: forall<a> list<a> -> defaultdefault: int + Consstd/core/types/Cons: forall<a> (head : a, tail : list<a>) -> list<a>(xx: int,xxxx: list<int>) -> xxxx: list<int>.foldlstd/core/list/foldl: (xs : list<int>, z : int, f : (int, int) -> int) -> int( xx: int, maxstd/core/int/max: (i : int, j : int) -> int ) // Split a string into a list of lines -pub fun linesstd/core/list/lines: (s : string) -> list<string>( ss: string : stringstd/core/types/string: V )result: -> total list<string> : liststd/core/types/list: V -> V<stringstd/core/types/string: V> - ss: string.splitstd/core/string/split: (s : string, sep : string) -> list<string>("\n"literal: string
count= 1
) +pub fun linesstd/core/list/lines: (s : string) -> list<string>( ss: string : stringstd/core/types/string: V )result: -> total list<string> : liststd/core/types/list: V -> V<stringstd/core/types/string: V> + ss: string.splitstd/core/string/split: (s : string, sep : string) -> list<string>("\n"literal: string
count= 1
) // Join a list of strings with newlines -pub fun unlinesstd/core/list/unlines: (xs : list<string>) -> string( xsxs: list<string> : liststd/core/types/list: V -> V<stringstd/core/types/string: V> )result: -> total string : stringstd/core/types/string: V +pub fun unlinesstd/core/list/unlines: (xs : list<string>) -> string( xsxs: list<string> : liststd/core/types/list: V -> V<stringstd/core/types/string: V> )result: -> total string : stringstd/core/types/string: V xsxs: list<string>.joinstd/core/list/joinsep/join: (xs : list<string>, sep : string) -> string("\n"literal: string
count= 1
) // Apply a function `f` to each character in a string -pub fun string/mapstd/core/list/string/map: forall<e> (s : string, f : (char) -> e char) -> e string( ss: string : stringstd/core/types/string: V, ff: (char) -> $1970 char : charstd/core/types/char: V -> ee: E charstd/core/types/char: V )result: -> 2018 string : ee: E stringstd/core/types/string: V - ss: string.liststd/core/string/list: (s : string) -> $1970 list<char>.mapstd/core/list/map: (xs : list<char>, f : (char) -> $1970 char) -> $1970 list<char>(ff: (char) -> $1970 char).stringstd/core/string/listchar/string: (cs : list<char>) -> $1970 string // todo: optimize +pub fun string/mapstd/core/list/string/map: forall<e> (s : string, f : (char) -> e char) -> e string( ss: string : stringstd/core/types/string: V, ff: (char) -> $1970 char : charstd/core/types/char: V -> ee: E charstd/core/types/char: V )result: -> 2018 string : ee: E stringstd/core/types/string: V + ss: string.liststd/core/string/list: (s : string) -> $1970 list<char>.mapstd/core/list/map: (xs : list<char>, f : (char) -> $1970 char) -> $1970 list<char>(ff: (char) -> $1970 char).stringstd/core/string/listchar/string: (cs : list<char>) -> $1970 string // todo: optimize diff --git a/doc/std_core_list.html b/doc/std_core_list.html index cdbfe1e85..2cca811e4 100644 --- a/doc/std_core_list.html +++ b/doc/std_core_list.html @@ -15,320 +15,320 @@ -

std/core/list▲toc

+

std/core/list▲toc

-

Standard liststd/core/types/list: V -> V functions. +

Standard liststd/core/types/list: V -> V functions.

.

-
+

Create a list of characters from lo to hi (including hi).

-
fun default/head( xs : liststd/core/types/list: V -> V<a>, default : a ) : a
+
fun default/head( xs : liststd/core/types/list: V -> V<a>, default : a ) : a

Return the head of list with a default value in case the list is empty.

-
+

Applies a function f to list of increasing elements from lo to hi (including both lo and hi ). If lo > hi the function returns the empty list.

-
+

Concatenate all strings in a list using a specific separator.

-
+ -
+

Returns an integer list of increasing elements from lo to hi with stride stride. If lo > hi the function returns the empty list.

-
+

Returns an integer list of increasing elements from lo to hi with stride stride. If lo > hi the function returns the empty list.

-
+

Apply a function f to each character in a string.

-
+ -
+

Element-wise list equality.

-
+

Do all elements satisfy a predicate ?

-
+

Are there any elements in a list that satisfy a predicate ?

-
+ -
+ -
+

Concatenate all lists in a list (e.g. flatten the list). (tail-recursive).

-
+ -
+

Drop the first n elements of a list (or fewer if the list is shorter than n).

-
+

Drop all initial elements that satisfy predicate.

-
+

Retain only those elements of a list that satisfy the given predicate pred. For example: filterstd/core/list/filter: forall<a,e> (xs : list<a>, pred : (a) -> e bool) -> e list<a>([1,2,3],odd?) == [1,3].

-
+

Retain only those elements of a list that satisfy the given predicate pred. -For example: filterMap([1,2,3],fn(i) { if i.odd? then Nothingstd/core/types/Nothing: forall<a> maybe<a> else Juststd/core/types/Just: forall<a> (value : a) -> maybe<a>(i(*)std/core/int/(*): (int, int) -> inti) }) == [4]. +For example: filterMap([1,2,3],fn(i) { if i.odd? then Nothingstd/core/types/Nothing: forall<a> maybe<a> else Juststd/core/types/Just: forall<a> (value : a) -> maybe<a>(i(*)std/core/int/(*): (int, int) -> inti) }) == [4].

-
+

Find the first element satisfying some predicate.

-
+

Find the first element satisfying some predicate and return it.

-
+

Concatenate the result lists from applying a function to all elements.

-
+
-

Concatenate the Juststd/core/types/Just: forall<a> (value : a) -> maybe<a> result elements from applying a function to all elements. +

Concatenate the Juststd/core/types/Just: forall<a> (value : a) -> maybe<a> result elements from applying a function to all elements.

-
fun foldl( xs : liststd/core/types/list: V -> V<a>, z : b, f : (b, a) -> e b ) : e b
+ - -
fun foldr( xs : liststd/core/types/list: V -> V<a>, z : b, f : (a, b) -> e b ) : e b
+ + - -
fun foreach( xs : liststd/core/types/list: V -> V<a>, action : (a) -> e () ) : e ()
+ +
fun foreach( xs : liststd/core/types/list: V -> V<a>, action : (a) -> e () ) : e ()

Invoke action for each element of a list.

-
fun foreach-indexed( xs : liststd/core/types/list: V -> V<a>, action : (intstd/core/types/int: V, a) -> e () ) : e ()
+
fun foreach-indexed( xs : liststd/core/types/list: V -> V<a>, action : (intstd/core/types/int: V, a) -> e () ) : e ()

Invoke action for each element of a list, passing also the position of the element.

-
+
-

Invoke action for each element of a list while action return Nothingstd/core/types/Nothing: forall<a> maybe<a>. +

Invoke action for each element of a list while action return Nothingstd/core/types/Nothing: forall<a> maybe<a>.

-
std
core
bool
+
bool
-

Standard boolstd/core/types/bool: V functions. +

Standard boolstd/core/types/bool: V functions.

char
+
char
-

Standard charstd/core/types/char: V functions. +

Standard charstd/core/types/char: V functions.

console
+
console

Standard output to the console.

debug
+
debug

Core debugging functions.

delayed
+
delayed

Delayed computations.

either
+
either
exn
+
exn
-

Standard exception (exnstd/core/exn/exn: (E, V) -> V) effect. +

Standard exception (exnstd/core/exn/exn: (E, V) -> V) effect.

hnd
+
hnd

Internal effect handler primitives.

int
+
int
-

Standard integer intstd/core/types/int: V functions. +

Standard integer intstd/core/types/int: V functions.

list
+
list
-

Standard liststd/core/types/list: V -> V functions. +

Standard liststd/core/types/list: V -> V functions.

maybe
+
maybe
-

Standard maybestd/core/types/maybe: V -> V functions. +

Standard maybestd/core/types/maybe: V -> V functions.

order
+
order
-

Standard orderstd/core/types/order: V functions. +

Standard orderstd/core/types/order: V functions.

show
+
show

Standard show functions.

sslice
+
sslice

Efficient views on strings.

string
+
string
-

Standard stringstd/core/types/string: V functions. +

Standard stringstd/core/types/string: V functions.

tuple
+
tuple

Standard tuple functions.

types
+
types

Primitive types and functions.

vector
+
vector

Standard vector functions.