module std/core/maybe2std/core/maybe2
import std/core/typesstd/core/types
import std/core/hndstd/core/hnd
import std/core/exnstd/core/exn
pub fun maybe2std/core/maybe2/maybe2: forall<a,b,c,e> (m : maybe2<a,b>, onNothing : c, onJust : (a, b) -> e c) -> e c( mm: maybe2<$134,$135> : maybe2std/core/types/maybe2: (V, V) -> V<aa: V,bb: V>, onNothingonNothing: $136: cc: V, onJustonJust: ($134, $135) -> $137 $136: (aa: V,bb: V) -> ee: E cc: V )result: -> 178 177 : ee: E cc: V
match mm: maybe2<$134,$135>
Nothing2std/core/types/Nothing2: forall<a,b> maybe2<a,b> -> onNothingonNothing: $136
Just2std/core/types/Just2: forall<a,b> (fst : a, snd : b) -> maybe2<a,b>(xx: $134,yy: $135) -> onJustonJust: ($134, $135) -> $137 $136(xx: $134,yy: $135)
pub fun defaultstd/core/maybe2/default: forall<a,b> (m : maybe2<a,b>, nothing : (a, b)) -> (a, b)( mm: maybe2<$191,$192> : maybe2std/core/types/maybe2: (V, V) -> V<aa: V,bb: V>, nothingnothing: ($191, $192) : (std/core/types/tuple2: (V, V) -> Vaa: V,bb: V) )result: -> total (231, 232) : (std/core/types/tuple2: (V, V) -> Vaa: V,bb: V)
match mm: maybe2<$191,$192>
Nothing2std/core/types/Nothing2: forall<a,b> maybe2<a,b> -> nothingnothing: ($191, $192)
Just2std/core/types/Just2: forall<a,b> (fst : a, snd : b) -> maybe2<a,b>(xx: $191,yy: $192) -> (std/core/types/Tuple2: forall<a,b> (fst : a, snd : b) -> (a, b)xx: $191,yy: $192)std/core/types/Tuple2: forall<a,b> (fst : a, snd : b) -> (a, b)
pub fun unjuststd/core/maybe2/unjust: forall<a,b> (m : maybe2<a,b>, @implicit/kk-file-line : string) -> exn (a, b)( mm: maybe2<$240,$241> : maybe2std/core/types/maybe2: (V, V) -> V<aa: V,bb: V>, @implicit/kk-file-line?kk-file-line: string: stringstd/core/types/string: V)result: -> exn (298, 299) : exnstd/core/exn/exn: (E, V) -> V (std/core/types/tuple2: (V, V) -> Vaa: V,bb: V)
match mm: maybe2<$240,$241>
Just2std/core/types/Just2: forall<a,b> (fst : a, snd : b) -> maybe2<a,b>(xx: $240,yy: $241) -> (std/core/types/Tuple2: forall<a,b> (fst : a, snd : b) -> (a, b)xx: $240,yy: $241)std/core/types/Tuple2: forall<a,b> (fst : a, snd : b) -> (a, b)
Nothing2std/core/types/Nothing2: forall<a,b> maybe2<a,b> -> throwstd/core/exn/throw: (message : string, info : ? exception-info) -> exn ($240, $241)("unexpected Nothing2 in "literal: string
count= 23 ++std/core/types/(++): (x : string, y : string) -> exn string @implicit/kk-file-line?kk-file-line: string)
pub fun expectstd/core/maybe2/expect: forall<a,b> (m : maybe2<a,b>, error-msg : string) -> exn (a, b)( mm: maybe2<$307,$308> : maybe2std/core/types/maybe2: (V, V) -> V<aa: V,bb: V>, error-msgerror-msg: string: stringstd/core/types/string: V)result: -> exn (357, 358) : exnstd/core/exn/exn: (E, V) -> V (std/core/types/tuple2: (V, V) -> Vaa: V,bb: V)
match mm: maybe2<$307,$308>
Just2std/core/types/Just2: forall<a,b> (fst : a, snd : b) -> maybe2<a,b>(xx: $307,yy: $308) -> (std/core/types/Tuple2: forall<a,b> (fst : a, snd : b) -> (a, b)xx: $307,yy: $308)std/core/types/Tuple2: forall<a,b> (fst : a, snd : b) -> (a, b)
Nothing2std/core/types/Nothing2: forall<a,b> maybe2<a,b> -> throwstd/core/exn/throw: (message : string, info : ? exception-info) -> exn ($307, $308)(error-msgerror-msg: string)
pub fun mapstd/core/maybe2/map: forall<a,b,c,d,e> (m : maybe2<a,b>, f : (a, b) -> e (c, d)) -> e maybe2<c,d>( mm: maybe2<$366,$367> : maybe2std/core/types/maybe2: (V, V) -> V<aa: V,bb: V>, ff: ($366, $367) -> $370 ($368, $369) : (aa: V,bb: V) -> ee: E (std/core/types/tuple2: (V, V) -> Vcc: V,dd: V) )result: -> 439 maybe2<437,438> : ee: E maybe2std/core/types/maybe2: (V, V) -> V<cc: V,dd: V>
match mm: maybe2<$366,$367>
Nothing2std/core/types/Nothing2: forall<a,b> maybe2<a,b> -> Nothing2std/core/types/Nothing2: forall<a,b> maybe2<a,b>
Just2std/core/types/Just2: forall<a,b> (fst : a, snd : b) -> maybe2<a,b>(xx: $366,yy: $367) -> match ff: ($366, $367) -> $370 ($368, $369)(xx: $366,yy: $367)
(std/core/types/Tuple2: forall<a,b> (fst : a, snd : b) -> (a, b)fxfx: $368,fyfy: $369)std/core/types/Tuple2: forall<a,b> (fst : a, snd : b) -> (a, b) -> Just2std/core/types/Just2: forall<a,b> (fst : a, snd : b) -> maybe2<a,b>(fxfx: $368,fyfy: $369)
pub fun foreachstd/core/maybe2/foreach: forall<a,b,e> (m : maybe2<a,b>, f : (a, b) -> e ()) -> e ()( mm: maybe2<$455,$456> : maybe2std/core/types/maybe2: (V, V) -> V<aa: V,bb: V>, ff: ($455, $456) -> $457 () : (aa: V,bb: V) -> ee: E (std/core/types/unit: V)std/core/types/unit: V )result: -> 493 () : ee: E (std/core/types/unit: V)std/core/types/unit: V
match mm: maybe2<$455,$456>
Nothing2std/core/types/Nothing2: forall<a,b> maybe2<a,b> -> (std/core/types/Unit: ())std/core/types/Unit: ()
Just2std/core/types/Just2: forall<a,b> (fst : a, snd : b) -> maybe2<a,b>(xx: $455,yy: $456) -> ff: ($455, $456) -> $457 ()(xx: $455,yy: $456)
pub fun (||)std/core/maybe2/(||): forall<a,b> (m1 : maybe2<a,b>, m2 : maybe2<a,b>) -> maybe2<a,b>( m1m1: maybe2<$503,$504> : maybe2std/core/types/maybe2: (V, V) -> V<aa: V,bb: V>, m2m2: maybe2<$503,$504>: maybe2std/core/types/maybe2: (V, V) -> V<aa: V,bb: V> )result: -> total maybe2<527,528> : maybe2std/core/types/maybe2: (V, V) -> V<aa: V,bb: V>
match m1m1: maybe2<$503,$504>
Nothing2std/core/types/Nothing2: forall<a,b> maybe2<a,b> -> m2m2: maybe2<$503,$504>
_ -> m1m1: maybe2<$503,$504>
pub fun (==)std/core/maybe2/(==): forall<a,b,e> (mb1 : maybe2<a,b>, mb2 : maybe2<a,b>, @implicit/fst/(==) : (a, a) -> e bool, @implicit/snd/(==) : (b, b) -> e bool) -> e bool( mb1mb1: maybe2<$536,$537> : maybe2std/core/types/maybe2: (V, V) -> V<aa: V,bb: V>, mb2mb2: maybe2<$536,$537> : maybe2std/core/types/maybe2: (V, V) -> V<aa: V,bb: V>, (@implicit/fst/==)?fst/(==): ($536, $536) -> $538 bool : (aa: V,aa: V) -> ee: E boolstd/core/types/bool: V, (@implicit/snd/==)?snd/(==): ($537, $537) -> $538 bool : (bb: V,bb: V) -> ee: E boolstd/core/types/bool: V )result: -> 627 bool : ee: E boolstd/core/types/bool: V
match mb1mb1: maybe2<$536,$537>
Just2std/core/types/Just2: forall<a,b> (fst : a, snd : b) -> maybe2<a,b>(xx: $536,yy: $537) -> match mb2mb2: maybe2<$536,$537>
Just2std/core/types/Just2: forall<a,b> (fst : a, snd : b) -> maybe2<a,b>(aa: $536,bb: $537) -> (xx: $536==?fst/(==): ($536, $536) -> $538 boolaa: $536) &&std/core/types/(&&): (x : bool, y : bool) -> $538 bool (yy: $537==?snd/(==): ($537, $537) -> $538 boolbb: $537)
Nothing2std/core/types/Nothing2: forall<a,b> maybe2<a,b> -> Falsestd/core/types/False: bool
Nothing2std/core/types/Nothing2: forall<a,b> maybe2<a,b> -> match mb2mb2: maybe2<$536,$537>
Nothing2std/core/types/Nothing2: forall<a,b> maybe2<a,b> -> Truestd/core/types/True: bool
_ -> Falsestd/core/types/False: bool
pub fun cmpstd/core/maybe2/cmp: forall<a,b,e> (mb1 : maybe2<a,b>, mb2 : maybe2<a,b>, @implicit/fst/cmp : (a, a) -> e order, @implicit/snd/cmp : (b, b) -> e order) -> e order( mb1mb1: maybe2<$642,$643> : maybe2std/core/types/maybe2: (V, V) -> V<aa: V,bb: V>, mb2mb2: maybe2<$642,$643> : maybe2std/core/types/maybe2: (V, V) -> V<aa: V,bb: V>, @implicit/fst/cmp?fst/cmp: ($642, $642) -> $644 order : (aa: V,aa: V) -> ee: E orderstd/core/types/order: V, @implicit/snd/cmp?snd/cmp: ($643, $643) -> $644 order : (bb: V,bb: V) -> ee: E orderstd/core/types/order: V)result: -> 715 order : ee: E orderstd/core/types/order: V
match mb1mb1: maybe2<$642,$643>
Just2std/core/types/Just2: forall<a,b> (fst : a, snd : b) -> maybe2<a,b>(xx: $642,yy: $643) -> match mb2mb2: maybe2<$642,$643>
Just2std/core/types/Just2: forall<a,b> (fst : a, snd : b) -> maybe2<a,b>(aa: $642,bb: $643) -> match @implicit/fst/cmp?fst/cmp: ($642, $642) -> $644 order(xx: $642,aa: $642)
Eqstd/core/types/Eq: order -> @implicit/snd/cmp?snd/cmp: ($643, $643) -> $644 order(yy: $643,bb: $643)
lglg: order -> lglg: order
Nothing2std/core/types/Nothing2: forall<a,b> maybe2<a,b> -> Gtstd/core/types/Gt: order
Nothing2std/core/types/Nothing2: forall<a,b> maybe2<a,b> -> match mb2mb2: maybe2<$642,$643>
Nothing2std/core/types/Nothing2: forall<a,b> maybe2<a,b> -> Eqstd/core/types/Eq: order
_ -> Ltstd/core/types/Lt: order
pub fun showstd/core/maybe2/show: forall<a,b,e> (mb : maybe2<a,b>, @implicit/fst/show : (a) -> e string, @implicit/snd/show : (b) -> e string) -> e string( mbmb: maybe2<$725,$726> : maybe2std/core/types/maybe2: (V, V) -> V<aa: V,bb: V>, @implicit/fst/show?fst/show: ($725) -> $727 string : aa: V -> ee: E stringstd/core/types/string: V, @implicit/snd/show?snd/show: ($726) -> $727 string : bb: V -> ee: E stringstd/core/types/string: V )result: -> 812 string : ee: E stringstd/core/types/string: V
match mbmb: maybe2<$725,$726>
Just2std/core/types/Just2: forall<a,b> (fst : a, snd : b) -> maybe2<a,b>(xx: $725,yy: $726) -> "Just2("literal: string
count= 6 ++std/core/types/(++): (x : string, y : string) -> $727 string xx: $725.show?fst/show: ($725) -> $727 string ++std/core/types/(++): (x : string, y : string) -> $727 string ","literal: string
count= 1 ++std/core/types/(++): (x : string, y : string) -> $727 string yy: $726.show?snd/show: ($726) -> $727 string ++std/core/types/(++): (x : string, y : string) -> $727 string ")"literal: string
count= 1
Nothing2std/core/types/Nothing2: forall<a,b> maybe2<a,b> -> "Nothing2"literal: string
count= 8
pub fun boolstd/core/maybe2/bool: forall<a,b> (mb : maybe2<a,b>) -> bool( mbmb: maybe2<$831,$832> : maybe2std/core/types/maybe2: (V, V) -> V<aa: V,bb: V> )result: -> total bool : boolstd/core/types/bool: V
match mbmb: maybe2<$831,$832>
Just2std/core/types/Just2: forall<a,b> (fst : a, snd : b) -> maybe2<a,b> -> Truestd/core/types/True: bool
Nothing2std/core/types/Nothing2: forall<a,b> maybe2<a,b> -> Falsestd/core/types/False: bool