package Ġcom . xr pn . immutable . f list test Ċ Ċ import Ġcom . xr pn . im api . IM List Ċ import Ġcom . xr pn . im api . IM List Grouping Ċ import Ġcom . xr pn . immutable .* Ċ import Ġcom . xr pn . immutable . empty ArrayOf Int Ċ import Ġcom . xr pn . immutable . empty ArrayOf Str Ċ import Ġio . kot est . assertions . fail Ċ import Ġio . kot est . core . spec . style . Fun Spec Ċ import Ġio . kot est . matchers . shouldBe Ċ Ċ private Ġval Ġint ListOf None : ĠIM List Grouping < Int > Ġ= ĠF List . of (* empty ArrayOf Int ) Ċ private Ġval Ġint ListOf One : ĠIM List Grouping < Int > Ġ= ĠF List . of (* array Of < Int >( 1 )) Ċ private Ġval Ġint ListOf Two : ĠIM List Grouping < Int > Ġ= ĠF List . of (* array Of < Int >( 1 , 2 )) Ċ private Ġval Ġint ListOf Three : ĠIM List Grouping < Int > Ġ= ĠF List . of (* array Of < Int >( 1 , 2 , 3 )) Ċ private Ġval Ġstr ListOf None : ĠIM List Grouping < String > Ġ= ĠF List . of (* empty ArrayOf Str ) Ċ private Ġval Ġstr ListOf One : ĠIM List Grouping < String > Ġ= ĠF List . of (* array Of < String >(" a ")) Ċ private Ġval Ġstr ListOf Two : ĠIM List Grouping < String > Ġ= ĠF List . of (* array Of < String >(" a "," b ")) Ċ private Ġval Ġstr ListOf Three : ĠIM List Grouping < String > Ġ= ĠF List . of (* array Of < String >(" a "," b "," c ")) Ċ Ċ class ĠF List Grouping Test Ġ: ĠFun Spec ({ ĊĊĠ Ġbefore Test Ġ{} ĊĊĠ Ġtest (" ff ind First ") Ġ{ ĊĠĠĠ Ġint ListOf None . ff ind First Ġ{ Ġit Ġ> Ġ 1 Ġ} ĠshouldBe ĠTrip le ( FL Nil , Ġnull , ĠFL Nil ) ĊĠĠĠ Ġint ListOf One . ff ind First Ġ{ Ġit Ġ> Ġ 1 Ġ} Ġ ĠshouldBe ĠTrip le ( FL Cons ( 1 , FL Nil ), Ġnull , ĠFL Nil ) ĊĠĠĠ ĠF List . of (* array Of < Int >( 2 , 1 )). ff ind First Ġ{ Ġit Ġ> Ġ 1 Ġ} Ġ ĠshouldBe ĠTrip le ( FL Nil , Ġ 2 , ĠFL Cons ( 1 , FL Nil )) ĊĠĠĠ ĠF List . of (* array Of < Int >( 3 , 2 , 1 )). ff ind First Ġ{ Ġit Ġ> Ġ 1 Ġ} Ġ ĠshouldBe ĠTrip le ( FL Nil , Ġ 3 , ĠFL Cons ( 2 , ĠFL Cons ( 1 , FL Nil ))) ĊĠĠĠ ĠF List . of (* array Of < Int >( 3 , 2 , 1 , 0 )). ff ind First Ġ{ Ġit Ġ== Ġ 2 Ġ} ĠshouldBe ĠTrip le ( FL Cons ( 3 , ĠFL Nil ), Ġ 2 , ĠFL Cons ( 1 , FL Cons ( 0 , FL Nil ))) ĊĠĠĠ ĠF List . of (* array Of < Int >( 3 , 2 , 1 , 0 )). ff ind First Ġ{ Ġit Ġ< Ġ 3 Ġ} ĠshouldBe ĠTrip le ( FL Cons ( 3 , ĠFL Nil ), Ġ 2 , ĠFL Cons ( 1 , FL Cons ( 0 , FL Nil ))) ĊĠ Ġ} ĊĊĠ Ġtest (" f groupBy "). config ( enabled Ġ= Ġfalse ) Ġ{ ĊĠĠĠ Ġfail (" need ĠF Map Ġdone Ġto Ġmake Ġthis Ġhappen ") ĊĠĠĠ Ġ// Ġint ListOf None . f groupBy Ġ{ Ġa Ġ-> Ġa . toString () Ġ} ĠshouldBe Ġempty Map () ĊĠ Ġ} ĊĊĠ Ġtest (" f indexed ") Ġ{ ĊĠĠĠ ĠF List . of (* empty ArrayOf Str ). f indexed () ĠshouldBe ĠFL Nil ĊĠĠĠ Ġstr ListOf One . f indexed () ĠshouldBe ĠFL Cons ( Pair (" a ", 0 ), FL Nil ) ĊĠĠĠ Ġstr ListOf Two . f indexed () ĠshouldBe ĠFL Cons ( Pair (" a ", 0 ), FL Cons ( Pair (" b ", 1 ), FL Nil )) ĊĠĠĠ Ġstr ListOf Three . f indexed () ĠshouldBe ĠFL Cons ( Pair (" a ", 0 ), FL Cons ( Pair (" b ", 1 ), FL Cons ( Pair (" c ", 2 ), FL Nil ))) ĊĠ Ġ} ĊĊĠ Ġtest (" f indexed Ġoffset ") Ġ{ ĊĠĠĠ ĠF List . of (* empty ArrayOf Str ). f indexed ( 1 0 ) ĠshouldBe ĠFL Nil ĊĠĠĠ Ġstr ListOf One . f indexed ( 1 0 ) ĠshouldBe ĠFL Cons ( Pair (" a ", 1 0 ), FL Nil ) ĊĠĠĠ Ġstr ListOf Two . f indexed ( 1 0 ) ĠshouldBe ĠFL Cons ( Pair (" a ", 1 0 ), FL Cons ( Pair (" b ", 1 1 ), FL Nil )) ĊĠĠĠ Ġstr ListOf Three . f indexed ( 1 0 ) ĠshouldBe ĠFL Cons ( Pair (" a ", 1 0 ), FL Cons ( Pair (" b ", 1 1 ), FL Cons ( Pair (" c ", 1 2 ), FL Nil ))) ĊĠ Ġ} ĊĊĠ Ġtest (" f partition ") Ġ{ ĊĠĠĠ Ġint ListOf None . f partition Ġ{ Ġ_ Ġ-> Ġtrue Ġ} ĠshouldBe ĠPair ( FL Nil , ĠFL Nil ) ĊĠĠĠ Ġint ListOf None . f partition Ġ{ Ġ_ Ġ-> Ġfalse Ġ} ĠshouldBe ĠPair ( FL Nil , ĠFL Nil ) ĊĠĠĠ Ġint ListOf One . f partition Ġ{ Ġ_ Ġ-> Ġtrue Ġ} ĠshouldBe ĠPair ( int ListOf One , ĠFL Nil ) ĊĠĠĠ Ġint ListOf One . f partition Ġ{ Ġ_ Ġ-> Ġfalse Ġ} ĠshouldBe ĠPair ( FL Nil , Ġint ListOf One ) ĊĊĠĠĠ Ġint ListOf Three . f partition Ġ{ Ġ_ Ġ-> Ġtrue Ġ} ĠshouldBe ĠPair ( int ListOf Three , ĠFL Nil ) ĊĠĠĠ Ġint ListOf Three . f partition Ġ{ Ġ 1 Ġ< Ġit Ġ} ĠshouldBe ĠPair ( FL Cons ( 2 , ĠFL Cons ( 3 , ĠFL Nil )), Ġint ListOf One ) ĊĠĠĠ Ġint ListOf Three . f partition Ġ{ Ġ 2 Ġ< Ġit Ġ} ĠshouldBe ĠPair ( FL Cons ( 3 , ĠFL Nil ), Ġint ListOf Two ) ĊĠĠĠ Ġint ListOf Three . f partition Ġ{ Ġ_ Ġ-> Ġfalse Ġ} ĠshouldBe ĠPair ( FL Nil , Ġint ListOf Three ) ĊĠĠĠ Ġint ListOf Three . f partition Ġ{ Ġit Ġ< Ġ 2 Ġ} ĠshouldBe ĠPair ( int ListOf One , ĠFL Cons ( 2 , ĠFL Cons ( 3 , ĠFL Nil ))) ĊĠĠĠ Ġint ListOf Three . f partition Ġ{ Ġit Ġ< Ġ 3 Ġ} ĠshouldBe ĠPair ( int ListOf Two , ĠFL Cons ( 3 , ĠFL Nil )) ĊĠ Ġ} ĊĊĠ Ġtest (" f sl iding Window ") Ġ{ ĊĠĠĠ Ġint ListOf None . f sl iding Window ( 0 , Ġ 1 ) ĠshouldBe ĠFL Nil ĊĠĠĠ Ġint ListOf None . f sl iding Window ( 1 , Ġ 0 ) ĠshouldBe ĠFL Nil ĊĠĠĠ Ġint ListOf None . f sl iding Window ( 1 , Ġ 1 ) ĠshouldBe ĠFL Nil ĊĠĠĠ Ġint ListOf One . f sl iding Window ( 0 , Ġ 1 ) ĠshouldBe ĠFL Nil ĊĠĠĠ Ġint ListOf One . f sl iding Window ( 1 , Ġ 0 ) ĠshouldBe ĠFL Nil ĊĠĠĠ Ġint ListOf One . f sl iding Window ( 1 , Ġ 1 ) ĠshouldBe ĠFL Cons ( int ListOf One , ĠFL Nil ) ĊĊĠĠĠ Ġint ListOf Two . f sl iding Window ( 0 , Ġ 1 ) ĠshouldBe ĠFL Nil ĊĠĠĠ Ġint ListOf Two . f sl iding Window ( 1 , Ġ 0 ) ĠshouldBe ĠFL Nil ĊĠĠĠ Ġint ListOf Two . f sl iding Window ( 1 , Ġ 1 ) ĠshouldBe ĠFL Cons ( int ListOf One , ĠFL Cons ( ĠFL Cons ( 2 , ĠFL Nil ), ĠFL Nil )) ĊĠĠĠ Ġint ListOf Two . f sl iding Window ( 2 , Ġ 1 ) ĠshouldBe ĠFL Cons ( int ListOf Two , ĠFL Cons ( ĠFL Cons ( 2 , ĠFL Nil ), ĠFL Nil )) ĊĠĠĠ Ġint ListOf Two . f sl iding Window ( 2 , Ġ 2 ) ĠshouldBe ĠFL Cons ( int ListOf Two , ĠFL Nil ) ĊĠĠĠ Ġint ListOf Two . f sl iding Window ( 2 , Ġ 3 ) ĠshouldBe ĠFL Cons ( int ListOf Two , ĠFL Nil ) ĊĠĠĠ Ġint ListOf Two . f sl iding Window ( 3 , Ġ 4 ) ĠshouldBe ĠFL Cons ( int ListOf Two , ĠFL Nil ) ĊĊĠĠĠ Ġint ListOf Three . f sl iding Window ( 1 , Ġ 1 ) ĠshouldBe ĊĠĠĠĠĠĠĠĠĠĠĠ ĠFL Cons ( int ListOf One , ĠFL Cons ( FL Cons ( 2 , ĠFL Nil ), ĠFL Cons ( ĠFL Cons ( 3 , ĠFL Nil ), ĠFL Nil ))) ĊĠĠĠ Ġint ListOf Three . f sl iding Window ( 2 , Ġ 1 ) ĠshouldBe ĊĠĠĠĠĠĠĠĠĠĠĠ ĠFL Cons ( int ListOf Two , ĠFL Cons ( ĠFL Cons ( 2 , ĠFL Cons ( 3 , ĠFL Nil )), ĠFL Cons ( ĠFL Cons ( 3 , ĠFL Nil ), ĠFL Nil ))) ĊĠĠĠ Ġint ListOf Three . f sl iding Window ( 2 , Ġ 2 ) ĠshouldBe ĊĠĠĠĠĠĠĠĠĠĠĠ ĠFL Cons ( int ListOf Two , ĠFL Cons ( ĠFL Cons ( 3 , ĠFL Nil ), ĠFL Nil )) ĊĠĠĠ Ġint ListOf Three . f sl iding Window ( 2 , Ġ 3 ) ĠshouldBe ĠFL Cons ( int ListOf Two , ĠFL Nil ) ĊĠĠĠ Ġint ListOf Three . f sl iding Window ( 3 , Ġ 3 ) ĠshouldBe ĠFL Cons ( int ListOf Three , ĠFL Nil ) ĊĠ Ġ} ĊĊĠ Ġtest (" f sl iding Full Window ") Ġ{ ĊĠĠĠ Ġint ListOf None . f sl iding Full Window ( 0 , Ġ 1 ) ĠshouldBe ĠFL Nil ĊĠĠĠ Ġint ListOf None . f sl iding Full Window ( 1 , Ġ 0 ) ĠshouldBe ĠFL Nil ĊĠĠĠ Ġint ListOf None . f sl iding Full Window ( 1 , Ġ 1 ) ĠshouldBe ĠFL Nil ĊĠĠĠ Ġint ListOf One . f sl iding Full Window ( 0 , Ġ 1 ) ĠshouldBe ĠFL Nil ĊĠĠĠ Ġint ListOf One . f sl iding Full Window ( 1 , Ġ 0 ) ĠshouldBe ĠFL Nil ĊĠĠĠ Ġint ListOf One . f sl iding Full Window ( 1 , Ġ 1 ) ĠshouldBe ĠFL Cons ( int ListOf One , ĠFL Nil ) ĊĊĠĠĠ Ġint ListOf Two . f sl iding Full Window ( 0 , Ġ 1 ) ĠshouldBe ĠFL Nil ĊĠĠĠ Ġint ListOf Two . f sl iding Full Window ( 1 , Ġ 0 ) ĠshouldBe ĠFL Nil ĊĠĠĠ Ġint ListOf Two . f sl iding Full Window ( 1 , Ġ 1 ) ĠshouldBe ĠFL Cons ( int ListOf One , ĠFL Cons ( ĠFL Cons ( 2 , ĠFL Nil ), ĠFL Nil )) ĊĠĠĠ Ġint ListOf Two . f sl iding Full Window ( 2 , Ġ 1 ) ĠshouldBe ĠFL Cons ( int ListOf Two , ĠFL Nil ) ĊĠĠĠ Ġint ListOf Two . f sl iding Full Window ( 2 , Ġ 2 ) ĠshouldBe ĠFL Cons ( int ListOf Two , ĠFL Nil ) ĊĠĠĠ Ġint ListOf Two . f sl iding Full Window ( 2 , Ġ 3 ) ĠshouldBe ĠFL Cons ( int ListOf Two , ĠFL Nil ) ĊĠĠĠ Ġint ListOf Two . f sl iding Full Window ( 3 , Ġ 4 ) ĠshouldBe ĠFL Nil ĊĊĠĠĠ Ġint ListOf Three . f sl iding Full Window ( 1 , Ġ 1 ) ĠshouldBe ĊĠĠĠĠĠĠĠĠĠĠĠ ĠFL Cons ( int ListOf One , ĠFL Cons ( FL Cons ( 2 , ĠFL Nil ), ĠFL Cons ( ĠFL Cons ( 3 , ĠFL Nil ), ĠFL Nil ))) ĊĠĠĠ Ġint ListOf Three . f sl iding Full Window ( 2 , Ġ 1 ) ĠshouldBe ĊĠĠĠĠĠĠĠĠĠĠĠ ĠFL Cons ( int ListOf Two , ĠFL Cons ( ĠFL Cons ( 2 , ĠFL Cons ( 3 , ĠFL Nil )), ĠFL Nil )) ĊĠĠĠ Ġint ListOf Three . f sl iding Full Window ( 2 , Ġ 2 ) ĠshouldBe ĠFL Cons ( int ListOf Two , ĠFL Nil ) ĊĠĠĠ Ġint ListOf Three . f sl iding Full Window ( 2 , Ġ 3 ) ĠshouldBe ĠFL Cons ( int ListOf Two , ĠFL Nil ) ĊĠĠĠ Ġint ListOf Three . f sl iding Full Window ( 3 , Ġ 3 ) ĠshouldBe ĠFL Cons ( int ListOf Three , ĠFL Nil ) ĊĠ Ġ} ĊĊĠ Ġtest (" f split At ") Ġ{ ĊĠĠĠ Ġint ListOf None . f split At (( int ListOf None Ġas ĠF List < Int >). indexOf First Ġ{ Ġit Ġ> Ġ 1 Ġ}) ĠshouldBe ĠTrip le ( FL Nil , Ġnull , ĠFL Nil ) ĊĠĠĠ Ġint ListOf One . f split At (( int ListOf One Ġas ĠF List < Int >). indexOf First Ġ{ Ġit Ġ> Ġ 1 Ġ}) Ġ ĠshouldBe ĠTrip le ( FL Cons ( 1 , FL Nil ), Ġnull , ĠFL Nil ) ĊĠĠĠ ĠF List . of (* array Of < Int >( 2 , 1 )). f split At ( 0 ) Ġ ĠshouldBe ĠTrip le ( FL Nil , Ġ 2 , ĠFL Cons ( 1 , FL Nil )) ĊĠĠĠ ĠF List . of (* array Of < Int >( 3 , 2 , 1 )). f split At ( 0 ) Ġ ĠshouldBe ĠTrip le ( FL Nil , Ġ 3 , ĠFL Cons ( 2 , ĠFL Cons ( 1 , FL Nil ))) ĊĠĠĠ ĠF List . of (* array Of < Int >( 3 , 2 , 1 , 0 )). f split At ( 1 ) ĠshouldBe ĠTrip le ( FL Cons ( 3 , ĠFL Nil ), Ġ 2 , ĠFL Cons ( 1 , FL Cons ( 0 , FL Nil ))) ĊĠĠĠ ĠF List . of (* array Of < Int >( 3 , 2 , 1 , 0 )). f split At ( 1 ) ĠshouldBe ĠTrip le ( FL Cons ( 3 , ĠFL Nil ), Ġ 2 , ĠFL Cons ( 1 , FL Cons ( 0 , FL Nil ))) ĊĠ Ġ} ĊĊĠ Ġtest (" fun zip ") Ġ{ ĊĠĠĠ Ġint ListOf None . fun zip Ġ{ Ġa Ġ-> ĠPair ( a , Ġa ) Ġ} ĠshouldBe ĠPair ( FL Nil , ĠFL Nil ) ĊĠĠĠ Ġint ListOf Three . f zip With ( str ListOf Three Ġas ĠIM List < String > ){ Ġa , Ġb Ġ-> ĠPair ( a , b )}. fun zip Ġ{ Ġpair Ġ-> Ġpair Ġ} ĠshouldBe ĊĠĠĠĠĠĠĠĠĠĠĠ ĠPair ( FL Cons ( 1 , FL Cons ( 2 Ġ, FL Cons ( 3 , ĠFL Nil ))), ĠFL Cons (" a ", ĠFL Cons (" b ", ĠFL Cons (" c ", FL Nil )))) ĊĠĠĠ Ġint ListOf Three . f zip With ( str ListOf Two Ġas ĠIM List < String > ){ a , Ġb Ġ-> ĠPair ( a , b )}. fun zip Ġ{ Ġpair Ġ-> Ġpair Ġ} ĠshouldBe ĊĠĠĠĠĠĠĠĠĠĠĠ ĠPair ( FL Cons ( 1 , FL Cons ( 2 Ġ, FL Nil )), ĠFL Cons (" a ", FL Cons (" b ", FL Nil ))) ĊĠĠĠ Ġint ListOf Three . f zip With ( str ListOf One Ġas ĠIM List < String > ){ a , Ġb Ġ-> ĠPair ( a , b )}. fun zip Ġ{ Ġpair Ġ-> Ġpair Ġ} ĠshouldBe ĊĠĠĠĠĠĠĠĠĠĠĠ ĠPair ( FL Cons ( 1 , ĠFL Nil ), ĠFL Cons (" a ", ĠFL Nil )) ĊĠĠĠ Ġint ListOf Three . f zip With ( str ListOf None Ġas ĠIM List < String > ){ a , Ġb Ġ-> ĠPair ( a , b )}. fun zip Ġ{ Ġpair Ġ-> Ġpair Ġ} ĠshouldBe ĠPair ( FL Nil , ĠFL Nil ) ĊĠ Ġ} ĊĊĠ Ġtest (" zip With ") Ġ{ ĊĠĠĠ Ġint ListOf None . f zip With ( F List . of (* empty ArrayOf Str )){ a , Ġb Ġ-> ĠPair ( a , b )} ĠshouldBe ĠFL Nil ĊĠĠĠ Ġint ListOf One . f zip With ( F List . of (* empty ArrayOf Str )){ a , Ġb Ġ-> ĠPair ( a , b )} ĠshouldBe ĠFL Nil ĊĠĠĠ Ġint ListOf None . f zip With ( F List . of (* array Of < String >(" a ")) ){ a , Ġb Ġ-> ĠPair ( a , b )} ĠshouldBe ĠFL Nil ĊĠĠĠ Ġint ListOf One . f zip With ( F List . of (* array Of < String >(" a ")) ){ a , Ġb Ġ-> ĠPair ( a , b )} ĠshouldBe ĠFL Cons ( Pair ( 1 ," a "), FL Nil ) ĊĠĠĠ Ġint ListOf Two . f zip With ( F List . of (* array Of < String >(" a ")) ){ a , Ġb Ġ-> ĠPair ( a , b )} ĠshouldBe ĠFL Cons ( Pair ( 1 ," a "), FL Nil ) ĊĠĠĠ Ġint ListOf One . f zip With ( F List . of (* array Of < String >(" a "," b ")) ){ a , Ġb Ġ-> ĠPair ( a , b )} ĠshouldBe ĠFL Cons ( Pair ( 1 ," a "), FL Nil ) ĊĠĠĠ Ġint ListOf Two . f zip With ( F List . of (* array Of < String >(" a ", Ġ" b ")) ){ a , Ġb Ġ-> ĠPair ( a , b )} ĠshouldBe ĠFL Cons ( Pair ( 1 ," a "), FL Cons ( Pair ( 2 ," b "), FL Nil )) ĊĠĠĠ Ġint ListOf Three . f zip With ( F List . of (* empty ArrayOf Str )){ a , Ġb Ġ-> ĠPair ( a , b )} ĠshouldBe ĠFL Nil ĊĠĠĠ Ġint ListOf Three . f zip With ( F List . of (* array Of < String >(" a ", Ġ" b ")) ){ a , Ġb Ġ-> ĠPair ( a , b )} ĠshouldBe ĠFL Cons ( Pair ( 1 ," a "), FL Cons ( Pair ( 2 ," b "), FL Nil )) ĊĠĠĠ Ġint ListOf Two . f zip With ( F List . of (* array Of < String >(" a ", Ġ" b ", Ġ" c ")) ){ a , Ġb Ġ-> ĠPair ( a , b )} ĠshouldBe ĠFL Cons ( Pair ( 1 ," a "), FL Cons ( Pair ( 2 ," b "), FL Nil )) ĊĠ Ġ} ĊĊĠ Ġtest (" zip With Ġiterable ") Ġ{ ĊĠĠĠ Ġint ListOf None . f zip With ( empty ArrayOf Str . iterator ()) ĠshouldBe ĠFL Nil ĊĠĠĠ Ġint ListOf One . f zip With ( empty ArrayOf Str . iterator ()) ĠshouldBe ĠFL Nil ĊĠĠĠ Ġint ListOf None . f zip With ( array Of (" a "). iterator ()) ĠshouldBe ĠFL Nil ĊĠĠĠ Ġint ListOf One . f zip With ( array Of (" a "). iterator ()) ĠshouldBe ĠFL Cons ( Pair ( 1 ," a "), FL Nil ) ĊĠĠĠ Ġint ListOf Two . f zip With ( array Of (" a "). iterator ()) ĠshouldBe ĠFL Cons ( Pair ( 1 ," a "), FL Nil ) ĊĠĠĠ Ġint ListOf One . f zip With ( array Of (" a "," b "). iterator ()) ĠshouldBe ĠFL Cons ( Pair ( 1 ," a "), FL Nil ) ĊĠĠĠ Ġint ListOf Two . f zip With ( array Of (" a "," b "). iterator ()) ĠshouldBe ĠFL Cons ( Pair ( 1 ," a "), FL Cons ( Pair ( 2 ," b "), FL Nil )) ĊĠĠĠ Ġint ListOf Three . f zip With ( emptyList < String >(). iterator ()) ĠshouldBe ĠFL Nil ĊĠĠĠ Ġint ListOf Three . f zip With ( array Of (" a "," b "). iterator ()) ĠshouldBe ĠFL Cons ( Pair ( 1 ," a "), FL Cons ( Pair ( 2 ," b "), FL Nil )) ĊĠĠĠ Ġint ListOf Two . f zip With ( array Of (" a "," b "," c "). iterator ()) ĠshouldBe ĠFL Cons ( Pair ( 1 ," a "), FL Cons ( Pair ( 2 ," b "), FL Nil )) ĊĠ Ġ} ĊĊĠ Ġtest (" zip When ") Ġ{ ĊĠĠĠ Ġint ListOf None . f zip When ( F List . of (* empty ArrayOf Int )){ a , Ġb Ġ-> Ġa Ġ== Ġb } ĠshouldBe ĠFL Nil ĊĠĠĠ Ġint ListOf None . f zip When ( F List . of (* array Of < Int >( 1 )) ){ a , Ġb Ġ-> Ġa Ġ== Ġb } ĠshouldBe ĠFL Nil ĊĊĠĠĠ Ġint ListOf One . f zip When ( F List . of (* empty ArrayOf Int )){ a , Ġb Ġ-> Ġa Ġ== Ġb } ĠshouldBe ĠFL Nil ĊĠĠĠ Ġint ListOf One . f zip When ( F List . of (* array Of < Int >( 1 )) ){ a , Ġb Ġ-> Ġa Ġ== Ġb } ĠshouldBe ĠFL Cons ( Pair ( 1 , 1 ), FL Nil ) ĊĠĠĠ Ġint ListOf One . f zip When ( F List . of (* array Of < Int >( 2 )) ){ a , Ġb Ġ-> Ġa Ġ== Ġb } ĠshouldBe ĠFL Nil ĊĠĠĠ Ġint ListOf One . f zip When ( F List . of (* array Of < Int >( 1 , Ġ 3 )) ){ a , Ġb Ġ-> Ġa Ġ== Ġb } ĠshouldBe ĠFL Cons ( Pair ( 1 , 1 ), FL Nil ) ĊĠĠĠ Ġint ListOf One . f zip When ( F List . of (* array Of < Int >( 3 , Ġ 1 )) ){ a , Ġb Ġ-> Ġa Ġ== Ġb } ĠshouldBe ĠFL Nil ĊĊĠĠĠ Ġint ListOf Two . f zip When ( F List . of (* empty ArrayOf Int )){ a , Ġb Ġ-> Ġa Ġ== Ġb } ĠshouldBe ĠFL Nil ĊĠĠĠ Ġint ListOf Two . f zip When ( F List . of (* array Of < Int >( 1 )) ){ a , Ġb Ġ-> Ġa Ġ== Ġb } ĠshouldBe ĠFL Cons ( Pair ( 1 , 1 ), FL Nil ) ĊĠĠĠ Ġint ListOf Two . f zip When ( F List . of (* array Of < Int >( 2 )) ){ a , Ġb Ġ-> Ġa Ġ== Ġb } ĠshouldBe ĠFL Nil ĊĠĠĠ Ġint ListOf Two . f zip When ( F List . of (* array Of < Int >( 1 , Ġ 3 )) ){ a , Ġb Ġ-> Ġa Ġ== Ġb } ĠshouldBe ĠFL Cons ( Pair ( 1 , 1 ), FL Nil ) ĊĠĠĠ Ġint ListOf Two . f zip When ( F List . of (* array Of < Int >( 3 , Ġ 2 )) ){ a , Ġb Ġ-> Ġa Ġ== Ġb } ĠshouldBe ĠFL Cons ( Pair ( 2 , 2 ), FL Nil ) ĊĠĠĠ Ġint ListOf Two . f zip When ( F List . of (* array Of < Int >( 1 , Ġ 2 )) ){ a , Ġb Ġ-> Ġa Ġ== Ġb } ĠshouldBe ĠFL Cons ( Pair ( 1 , 1 ), FL Cons ( Pair ( 2 , 2 ), FL Nil )) ĊĠĠĠ Ġint ListOf Two . f zip When ( F List . of (* array Of < Int >( 1 , Ġ 2 , Ġ 3 )) ){ a , Ġb Ġ-> Ġa Ġ== Ġb } ĠshouldBe ĠFL Cons ( Pair ( 1 , 1 ), FL Cons ( Pair ( 2 , 2 ), FL Nil )) ĊĊĠĠĠ Ġint ListOf Three . f zip When ( F List . of (* empty ArrayOf Int )){ a , Ġb Ġ-> Ġa Ġ== Ġb } ĠshouldBe ĠFL Nil ĊĠĠĠ Ġint ListOf Three . f zip When ( F List . of (* array Of < Int >( 2 , Ġ 3 )) ){ a , Ġb Ġ-> Ġa Ġ== Ġb } ĠshouldBe ĠFL Nil ĊĠĠĠ Ġint ListOf Three . f zip When ( F List . of (* array Of < Int >( 2 , Ġ 3 , Ġ 1 )) ){ a , Ġb Ġ-> Ġa Ġ== Ġb } ĠshouldBe ĠFL Nil ĊĠĠĠ Ġint ListOf Three . f zip When ( F List . of (* array Of < Int >( 1 , Ġ 2 )) ){ a , Ġb Ġ-> Ġa Ġ== Ġb } ĠshouldBe ĠFL Cons ( Pair ( 1 , 1 ), FL Cons ( Pair ( 2 , 2 ), FL Nil )) ĊĠĠĠ Ġint ListOf Three . f zip When ( F List . of (* array Of < Int >( 1 , Ġ 5 , Ġ 3 )) ){ a , Ġb Ġ-> Ġa Ġ== Ġb } ĠshouldBe ĠFL Cons ( Pair ( 1 , 1 ), FL Cons ( Pair ( 3 , 3 ), FL Nil )) ĊĠĠĠ Ġint ListOf Three . f zip When ( F List . of (* array Of < Int >( 1 , Ġ 3 , Ġ 5 )) ){ a , Ġb Ġ-> Ġa Ġ== Ġb } ĠshouldBe ĠFL Cons ( Pair ( 1 , 1 ), ĠFL Nil ) ĊĠĠĠ Ġint ListOf Three . f zip When ( F List . of (* array Of < Int >( 1 , Ġ 2 , Ġ 3 )) ){ a , Ġb Ġ-> Ġa Ġ== Ġb } ĠshouldBe ĠFL Cons ( Pair ( 1 , 1 ), FL Cons ( Pair ( 2 , 2 ), FL Cons ( Pair ( 3 , 3 ), FL Nil ))) ĊĠĠĠ Ġint ListOf Three . f zip When ( F List . of (* array Of < Int >( 1 , Ġ 2 , Ġ 3 , Ġ 4 )) ){ a , Ġb Ġ-> Ġa Ġ== Ġb } ĠshouldBe ĠFL Cons ( Pair ( 1 , 1 ), FL Cons ( Pair ( 2 , 2 ), FL Cons ( Pair ( 3 , 3 ), FL Nil ))) ĊĠ Ġ} ĊĊĠ Ġtest (" zip While ") Ġ{ ĊĠĠĠ Ġint ListOf None . f zip While ( F List . of (* empty ArrayOf Int )){ a , Ġb Ġ-> Ġa Ġ== Ġb } ĠshouldBe ĠFL Nil ĊĠĠĠ Ġint ListOf None . f zip While ( F List . of (* array Of < Int >( 1 )) ){ a , Ġb Ġ-> Ġa Ġ== Ġb } ĠshouldBe ĠFL Nil ĊĊĠĠĠ Ġint ListOf One . f zip While ( F List . of (* empty ArrayOf Int )){ a , Ġb Ġ-> Ġa Ġ== Ġb } ĠshouldBe ĠFL Nil ĊĠĠĠ Ġint ListOf One . f zip While ( F List . of (* array Of < Int >( 1 )) ){ a , Ġb Ġ-> Ġa Ġ== Ġb } ĠshouldBe ĠFL Cons ( Pair ( 1 , 1 ), FL Nil ) ĊĠĠĠ Ġint ListOf One . f zip While ( F List . of (* array Of < Int >( 2 )) ){ a , Ġb Ġ-> Ġa Ġ== Ġb } ĠshouldBe ĠFL Nil ĊĠĠĠ Ġint ListOf One . f zip While ( F List . of (* array Of < Int >( 1 , Ġ 3 )) ){ a , Ġb Ġ-> Ġa Ġ== Ġb } ĠshouldBe ĠFL Cons ( Pair ( 1 , 1 ), FL Nil ) ĊĠĠĠ Ġint ListOf One . f zip While ( F List . of (* array Of < Int >( 3 , Ġ 1 )) ){ a , Ġb Ġ-> Ġa Ġ== Ġb } ĠshouldBe ĠFL Nil ĊĊĠĠĠ Ġint ListOf Two . f zip While ( F List . of (* empty ArrayOf Int )){ a , Ġb Ġ-> Ġa Ġ== Ġb } ĠshouldBe ĠFL Nil ĊĠĠĠ Ġint ListOf Two . f zip While ( F List . of (* array Of < Int >( 1 )) ){ a , Ġb Ġ-> Ġa Ġ== Ġb } ĠshouldBe ĠFL Cons ( Pair ( 1 , 1 ), FL Nil ) ĊĠĠĠ Ġint ListOf Two . f zip While ( F List . of (* array Of < Int >( 2 )) ){ a , Ġb Ġ-> Ġa Ġ== Ġb } ĠshouldBe ĠFL Nil ĊĠĠĠ Ġint ListOf Two . f zip While ( F List . of (* array Of < Int >( 1 , Ġ 3 )) ){ a , Ġb Ġ-> Ġa Ġ== Ġb } ĠshouldBe ĠFL Cons ( Pair ( 1 , 1 ), FL Nil ) ĊĠĠĠ Ġint ListOf Two . f zip While ( F List . of (* array Of < Int >( 3 , Ġ 2 )) ){ a , Ġb Ġ-> Ġa Ġ== Ġb } ĠshouldBe ĠFL Nil ĊĠĠĠ Ġint ListOf Two . f zip While ( F List . of (* array Of < Int >( 1 , Ġ 2 )) ){ a , Ġb Ġ-> Ġa Ġ== Ġb } ĠshouldBe ĠFL Cons ( Pair ( 1 , 1 ), FL Cons ( Pair ( 2 , 2 ), FL Nil )) ĊĠĠĠ Ġint ListOf Two . f zip While ( F List . of (* array Of < Int >( 1 , Ġ 2 , Ġ 3 )) ){ a , Ġb Ġ-> Ġa Ġ== Ġb } ĠshouldBe ĠFL Cons ( Pair ( 1 , 1 ), FL Cons ( Pair ( 2 , 2 ), FL Nil )) ĊĊĠĠĠ Ġint ListOf Three . f zip While ( F List . of (* empty ArrayOf Int )){ a , Ġb Ġ-> Ġa Ġ== Ġb } ĠshouldBe ĠFL Nil ĊĠĠĠ Ġint ListOf Three . f zip While ( F List . of (* array Of < Int >( 2 , Ġ 3 )) ){ a , Ġb Ġ-> Ġa Ġ== Ġb } ĠshouldBe ĠFL Nil ĊĠĠĠ Ġint ListOf Three . f zip While ( F List . of (* array Of < Int >( 2 , Ġ 3 , Ġ 1 )) ){ a , Ġb Ġ-> Ġa Ġ== Ġb } ĠshouldBe ĠFL Nil ĊĠĠĠ Ġint ListOf Three . f zip While ( F List . of (* array Of < Int >( 1 , Ġ 2 )) ){ a , Ġb Ġ-> Ġa Ġ== Ġb } ĠshouldBe ĠFL Cons ( Pair ( 1 , 1 ), FL Cons ( Pair ( 2 , 2 ), FL Nil )) ĊĠĠĠ Ġint ListOf Three . f zip While ( F List . of (* array Of < Int >( 1 , Ġ 5 , Ġ 3 )) ){ a , Ġb Ġ-> Ġa Ġ== Ġb } ĠshouldBe ĠFL Cons ( Pair ( 1 , 1 ), FL Nil ) ĊĠĠĠ Ġint ListOf Three . f zip While ( F List . of (* array Of < Int >( 1 , Ġ 3 , Ġ 5 )) ){ a , Ġb Ġ-> Ġa Ġ== Ġb } ĠshouldBe ĠFL Cons ( Pair ( 1 , 1 ), ĠFL Nil ) ĊĠĠĠ Ġint ListOf Three . f zip While ( F List . of (* array Of < Int >( 1 , Ġ 2 , Ġ 3 )) ){ a , Ġb Ġ-> Ġa Ġ== Ġb } ĠshouldBe ĠFL Cons ( Pair ( 1 , 1 ), FL Cons ( Pair ( 2 , 2 ), FL Cons ( Pair ( 3 , 3 ), FL Nil ))) ĊĠĠĠ Ġint ListOf Three . f zip While ( F List . of (* array Of < Int >( 1 , Ġ 2 , Ġ 3 , Ġ 4 )) ){ a , Ġb Ġ-> Ġa Ġ== Ġb } ĠshouldBe ĠFL Cons ( Pair ( 1 , 1 ), FL Cons ( Pair ( 2 , 2 ), FL Cons ( Pair ( 3 , 3 ), FL Nil ))) ĊĠ Ġ} ĊĊĠ Ġtest (" zip While Ġiterable ") Ġ{} ĊĊĠ Ġtest (" f zip With Index ") Ġ{ ĊĠĠĠ ĠF List . of (* empty ArrayOf Str ). f zip With Index () ĠshouldBe ĠFL Nil ĊĠĠĠ Ġstr ListOf One . f zip With Index () ĠshouldBe ĠFL Cons ( Pair (" a ", 0 ), FL Nil ) ĊĠĠĠ Ġstr ListOf Two . f zip With Index () ĠshouldBe ĠFL Cons ( Pair (" a ", 0 ), FL Cons ( Pair (" b ", 1 ), FL Nil )) ĊĠĠĠ Ġstr ListOf Three . f zip With Index () ĠshouldBe ĠFL Cons ( Pair (" a ", 0 ), FL Cons ( Pair (" b ", 1 ), FL Cons ( Pair (" c ", 2 ), FL Nil ))) ĊĠ Ġ} ĊĊĠ Ġtest (" f zip With Index Ġoffset ") Ġ{ ĊĠĠĠ ĠF List . of (* empty ArrayOf Str ). f zip With Index ( 1 0 ) ĠshouldBe ĠFL Nil ĊĠĠĠ Ġstr ListOf One . f zip With Index ( 1 ) ĠshouldBe ĠFL Nil ĊĠĠĠ Ġstr ListOf Two . f zip With Index ( 1 ) ĠshouldBe ĠFL Cons ( Pair (" b ", 0 ), FL Nil ) ĊĠĠĠ Ġstr ListOf Three . f zip With Index ( 1 ) ĠshouldBe ĠFL Cons ( Pair (" b ", 0 ), FL Cons ( Pair (" c ", 1 ), FL Nil )) ĊĠĠĠ Ġstr ListOf Three . f zip With Index ( 2 ) ĠshouldBe ĠFL Cons ( Pair (" c ", 0 ), FL Nil ) ĊĠ Ġ} Ċ }) Ċ