/*---------------------------------------------------------------------------
  Copyright 2012-2024, Microsoft Research, Daan Leijen.

  This is free software; you can redistribute it and/or modify it under the
  terms of the Apache License, Version 2.0. A copy of the License can be
  found in the LICENSE file at the root of this distribution.
---------------------------------------------------------------------------*/

// Standard tuple functions.
module std/core/tuplestd/core/tuple

import std/core/typesstd/core/types
import std/core/hndstd/core/hnd

// Map a function over a tuple of elements of the same type.
pub fun tuple2/mapstd/core/tuple/tuple2/map: forall<a,b,e> (t : (a, a), f : (a) -> e b) -> e (b, b)( tt: ($318, $318) : (std/core/types/tuple2: (V, V) -> Vaa: V,aa: V), ff: ($318) -> $320 $319 : aa: V -> ee: E bb: V )result: -> 424 (423, 423) : ee: E (std/core/types/tuple2: (V, V) -> Vbb: V, bb: V)
  (std/core/types/Tuple2: forall<a,b> (fst : a, snd : b) -> (a, b)tt: ($318, $318).fststd/core/types/tuple2/fst: (tuple2 : ($318, $318)) -> $320 $318.ff: ($318) -> $320 $319, tt: ($318, $318).sndstd/core/types/tuple2/snd: (tuple2 : ($318, $318)) -> $320 $318.ff: ($318) -> $320 $319)std/core/types/Tuple2: forall<a,b> (fst : a, snd : b) -> (a, b)

// Map a function over a triple of elements of the same type.
pub fun tuple3/mapstd/core/tuple/tuple3/map: forall<a,b,e> (t : (a, a, a), f : (a) -> e b) -> e (b, b, b)( tt: ($434, $434, $434) : (std/core/types/tuple3: (V, V, V) -> Vaa: V,aa: V,aa: V), ff: ($434) -> $436 $435 : aa: V -> ee: E bb: V )result: -> 584 (583, 583, 583) : ee: E (std/core/types/tuple3: (V, V, V) -> Vbb: V, bb: V, bb: V)
  (std/core/types/Tuple3: forall<a,b,c> (fst : a, snd : b, thd : c) -> (a, b, c)tt: ($434, $434, $434).fststd/core/types/tuple3/fst: (tuple3 : ($434, $434, $434)) -> $436 $434.ff: ($434) -> $436 $435, tt: ($434, $434, $434).sndstd/core/types/tuple3/snd: (tuple3 : ($434, $434, $434)) -> $436 $434.ff: ($434) -> $436 $435, tt: ($434, $434, $434).thdstd/core/types/tuple3/thd: (tuple3 : ($434, $434, $434)) -> $436 $434.ff: ($434) -> $436 $435)std/core/types/Tuple3: forall<a,b,c> (fst : a, snd : b, thd : c) -> (a, b, c)

// Map a function over a quadruple of elements of the same type.
pub fun tuple4/mapstd/core/tuple/tuple4/map: forall<a,b,e> (t : (a, a, a, a), f : (a) -> e b) -> e (b, b, b, b)( tt: ($594, $594, $594, $594) : (std/core/types/tuple4: (V, V, V, V) -> Vaa: V,aa: V,aa: V,aa: V), ff: ($594) -> $596 $595 : aa: V -> ee: E bb: V )result: -> 790 (789, 789, 789, 789) : ee: E (std/core/types/tuple4: (V, V, V, V) -> Vbb: V,bb: V,bb: V,bb: V)
  (std/core/types/Tuple4: forall<a,b,c,d> (fst : a, snd : b, thd : c, field4 : d) -> (a, b, c, d)tt: ($594, $594, $594, $594).fststd/core/types/tuple4/fst: (tuple4 : ($594, $594, $594, $594)) -> $596 $594.ff: ($594) -> $596 $595, tt: ($594, $594, $594, $594).sndstd/core/types/tuple4/snd: (tuple4 : ($594, $594, $594, $594)) -> $596 $594.ff: ($594) -> $596 $595, tt: ($594, $594, $594, $594).thdstd/core/types/tuple4/thd: (tuple4 : ($594, $594, $594, $594)) -> $596 $594.ff: ($594) -> $596 $595, tt: ($594, $594, $594, $594).field4std/core/types/tuple4/field4: (tuple4 : ($594, $594, $594, $594)) -> $596 $594.ff: ($594) -> $596 $595)std/core/types/Tuple4: forall<a,b,c,d> (fst : a, snd : b, thd : c, field4 : d) -> (a, b, c, d)

// Map a function over a quintuple of elements of the same type.
pub fun tuple5/mapstd/core/tuple/tuple5/map: forall<a,b,e> (t : (a, a, a, a, a), f : (a) -> e b) -> e (b, b, b, b, b)( tt: ($800, $800, $800, $800, $800) : (std/core/types/tuple5: (V, V, V, V, V) -> Vaa: V,aa: V,aa: V,aa: V,aa: V), ff: ($800) -> $802 $801 : aa: V -> ee: E bb: V )result: -> 1025 (1024, 1024, 1024, 1024, 1024) : ee: E (std/core/types/tuple5: (V, V, V, V, V) -> Vbb: V,bb: V,bb: V,bb: V,bb: V)
  (std/core/types/Tuple5: forall<a,b,c,d,a1> (fst : a, snd : b, thd : c, field4 : d, field5 : a1) -> (a, b, c, d, a1)tt: ($800, $800, $800, $800, $800).fststd/core/types/tuple5/fst: (tuple5 : ($800, $800, $800, $800, $800)) -> $802 $800.ff: ($800) -> $802 $801, tt: ($800, $800, $800, $800, $800).sndstd/core/types/tuple5/snd: (tuple5 : ($800, $800, $800, $800, $800)) -> $802 $800.ff: ($800) -> $802 $801, tt: ($800, $800, $800, $800, $800).thdstd/core/types/tuple5/thd: (tuple5 : ($800, $800, $800, $800, $800)) -> $802 $800.ff: ($800) -> $802 $801, tt: ($800, $800, $800, $800, $800).field4std/core/types/tuple5/field4: (tuple5 : ($800, $800, $800, $800, $800)) -> $802 $800.ff: ($800) -> $802 $801, tt: ($800, $800, $800, $800, $800).field5std/core/types/tuple5/field5: (tuple5 : ($800, $800, $800, $800, $800)) -> $802 $800.ff: ($800) -> $802 $801)std/core/types/Tuple5: forall<a,b,c,d,a1> (fst : a, snd : b, thd : c, field4 : d, field5 : a1) -> (a, b, c, d, a1)

// Compare unit values. Useful to build composite equality for structures containing a unit (e.g. either<string, ()>)
pub inline fun unit/(==)std/core/tuple/unit/(==): (a : (), b : ()) -> bool(aa: (): (std/core/types/unit: V)std/core/types/unit: V, bb: (): (std/core/types/unit: V)std/core/types/unit: V)result: -> total bool: boolstd/core/types/bool: V
  Truestd/core/types/True: bool

// Element-wise tuple equality
pub fun tuple2/(==)std/core/tuple/tuple2/(==): forall<a,b,e> ((a, b), (a, b), @implicit/fst/(==) : (a, a) -> e bool, @implicit/snd/(==) : (b, b) -> e bool) -> e bool( (std/core/types/Tuple2: forall<a,b> (fst : a, snd : b) -> (a, b)x1x1: $1039,y1y1: $1040)std/core/types/Tuple2: forall<a,b> (fst : a, snd : b) -> (a, b) : (std/core/types/tuple2: (V, V) -> Vaa: V,bb: V), (std/core/types/Tuple2: forall<a,b> (fst : a, snd : b) -> (a, b)x2x2: $1039,y2y2: $1040)std/core/types/Tuple2: forall<a,b> (fst : a, snd : b) -> (a, b) : (std/core/types/tuple2: (V, V) -> Vaa: V,bb: V), (@implicit/fst/==)?fst/(==): ($1039, $1039) -> $1041 bool : (aa: V,aa: V) -> ee: E boolstd/core/types/bool: V, (@implicit/snd/==)?snd/(==): ($1040, $1040) -> $1041 bool : (bb: V,bb: V) -> ee: E boolstd/core/types/bool: V )result: -> 1163 bool : ee: E boolstd/core/types/bool: V
  (x1x1: $1039==?fst/(==): ($1039, $1039) -> $1041 boolx2x2: $1039) &&std/core/types/(&&): (x : bool, y : bool) -> $1041 bool (y1y1: $1040==?snd/(==): ($1040, $1040) -> $1041 booly2y2: $1040)

// Element-wise triple equality
pub fun tuple3/(==)std/core/tuple/tuple3/(==): forall<a,b,c,e> ((a, b, c), (a, b, c), @implicit/fst/(==) : (a, a) -> e bool, @implicit/snd/(==) : (b, b) -> e bool, @implicit/thd/(==) : (c, c) -> e bool) -> e bool( (std/core/types/Tuple3: forall<a,b,c> (fst : a, snd : b, thd : c) -> (a, b, c)x1x1: $1164,y1y1: $1165,z1z1: $1166)std/core/types/Tuple3: forall<a,b,c> (fst : a, snd : b, thd : c) -> (a, b, c) : (std/core/types/tuple3: (V, V, V) -> Vaa: V,bb: V,cc: V), (std/core/types/Tuple3: forall<a,b,c> (fst : a, snd : b, thd : c) -> (a, b, c)x2x2: $1164,y2y2: $1165,z2z2: $1166)std/core/types/Tuple3: forall<a,b,c> (fst : a, snd : b, thd : c) -> (a, b, c) : (std/core/types/tuple3: (V, V, V) -> Vaa: V,bb: V,cc: V), (@implicit/fst/==)?fst/(==): ($1164, $1164) -> $1167 bool : (aa: V,aa: V) -> ee: E boolstd/core/types/bool: V, (@implicit/snd/==)?snd/(==): ($1165, $1165) -> $1167 bool : (bb: V,bb: V) -> ee: E boolstd/core/types/bool: V, (@implicit/thd/==)?thd/(==): ($1166, $1166) -> $1167 bool : (cc: V,cc: V) -> ee: E boolstd/core/types/bool: V )result: -> 1345 bool : ee: E boolstd/core/types/bool: V
  (x1x1: $1164==?fst/(==): ($1164, $1164) -> $1167 boolx2x2: $1164) &&std/core/types/(&&): (x : bool, y : bool) -> $1167 bool (y1y1: $1165==?snd/(==): ($1165, $1165) -> $1167 booly2y2: $1165) &&std/core/types/(&&): (x : bool, y : bool) -> $1167 bool (z1z1: $1166==?thd/(==): ($1166, $1166) -> $1167 boolz2z2: $1166)

// Element-wise quadruple equality
pub fun tuple4/(==)std/core/tuple/tuple4/(==): forall<a,b,c,d,e> ((a, b, c, d), (a, b, c, d), @implicit/fst/(==) : (a, a) -> e bool, @implicit/snd/(==) : (b, b) -> e bool, @implicit/thd/(==) : (c, c) -> e bool, @implicit/field4/(==) : (d, d) -> e bool) -> e bool( (std/core/types/Tuple4: forall<a,b,c,d> (fst : a, snd : b, thd : c, field4 : d) -> (a, b, c, d)x1x1: $1346,y1y1: $1347,z1z1: $1348,w1w1: $1349)std/core/types/Tuple4: forall<a,b,c,d> (fst : a, snd : b, thd : c, field4 : d) -> (a, b, c, d) : (std/core/types/tuple4: (V, V, V, V) -> Vaa: V,bb: V,cc: V,dd: V), (std/core/types/Tuple4: forall<a,b,c,d> (fst : a, snd : b, thd : c, field4 : d) -> (a, b, c, d)x2x2: $1346,y2y2: $1347,z2z2: $1348,w2w2: $1349)std/core/types/Tuple4: forall<a,b,c,d> (fst : a, snd : b, thd : c, field4 : d) -> (a, b, c, d) : (std/core/types/tuple4: (V, V, V, V) -> Vaa: V,bb: V,cc: V,dd: V), 
                      (@implicit/fst/==)?fst/(==): ($1346, $1346) -> $1350 bool : (aa: V,aa: V) -> ee: E boolstd/core/types/bool: V, (@implicit/snd/==)?snd/(==): ($1347, $1347) -> $1350 bool : (bb: V,bb: V) -> ee: E boolstd/core/types/bool: V, 
                      (@implicit/thd/==)?thd/(==): ($1348, $1348) -> $1350 bool : (cc: V,cc: V) -> ee: E boolstd/core/types/bool: V, (@implicit/field4/==)?field4/(==): ($1349, $1349) -> $1350 bool : (dd: V,dd: V) -> ee: E boolstd/core/types/bool: V )result: -> 1584 bool : ee: E boolstd/core/types/bool: V
  (x1x1: $1346==?fst/(==): ($1346, $1346) -> $1350 boolx2x2: $1346) &&std/core/types/(&&): (x : bool, y : bool) -> $1350 bool (y1y1: $1347==?snd/(==): ($1347, $1347) -> $1350 booly2y2: $1347) &&std/core/types/(&&): (x : bool, y : bool) -> $1350 bool (z1z1: $1348==?thd/(==): ($1348, $1348) -> $1350 boolz2z2: $1348) &&std/core/types/(&&): (x : bool, y : bool) -> $1350 bool (w1w1: $1349==?field4/(==): ($1349, $1349) -> $1350 boolw2w2: $1349)

// Element-wise quintuple equality
pub fun tuple5/(==)std/core/tuple/tuple5/(==): forall<a,b,c,d,e,a1> ((a, b, c, d, a1), (a, b, c, d, a1), @implicit/fst/(==) : (a, a) -> e bool, @implicit/snd/(==) : (b, b) -> e bool, @implicit/thd/(==) : (c, c) -> e bool, @implicit/field4/(==) : (d, d) -> e bool, @implicit/field5/(==) : (a1, a1) -> e bool) -> e bool( (std/core/types/Tuple5: forall<a,b,c,d,a1> (fst : a, snd : b, thd : c, field4 : d, field5 : a1) -> (a, b, c, d, a1)x1x1: $1585,y1y1: $1586,z1z1: $1587,w1w1: $1588,v1v1: $1590)std/core/types/Tuple5: forall<a,b,c,d,a1> (fst : a, snd : b, thd : c, field4 : d, field5 : a1) -> (a, b, c, d, a1) : (std/core/types/tuple5: (V, V, V, V, V) -> Vaa: V,bb: V,cc: V,dd: V,ff: V), (std/core/types/Tuple5: forall<a,b,c,d,a1> (fst : a, snd : b, thd : c, field4 : d, field5 : a1) -> (a, b, c, d, a1)x2x2: $1585,y2y2: $1586,z2z2: $1587,w2w2: $1588,v2v2: $1590)std/core/types/Tuple5: forall<a,b,c,d,a1> (fst : a, snd : b, thd : c, field4 : d, field5 : a1) -> (a, b, c, d, a1) : (std/core/types/tuple5: (V, V, V, V, V) -> Vaa: V,bb: V,cc: V,dd: V,ff: V), 
                        (@implicit/fst/==)?fst/(==): ($1585, $1585) -> $1589 bool : (aa: V,aa: V) -> ee: E boolstd/core/types/bool: V, (@implicit/snd/==)?snd/(==): ($1586, $1586) -> $1589 bool : (bb: V,bb: V) -> ee: E boolstd/core/types/bool: V, (@implicit/thd/==)?thd/(==): ($1587, $1587) -> $1589 bool : (cc: V,cc: V) -> ee: E boolstd/core/types/bool: V, 
                        (@implicit/field4/==)?field4/(==): ($1588, $1588) -> $1589 bool : (dd: V,dd: V) -> ee: E boolstd/core/types/bool: V, (@implicit/field5/==)?field5/(==): ($1590, $1590) -> $1589 bool : (ff: V,ff: V) -> ee: E boolstd/core/types/bool: V )result: -> 1879 bool : ee: E boolstd/core/types/bool: V
  (x1x1: $1585==?fst/(==): ($1585, $1585) -> $1589 boolx2x2: $1585) &&std/core/types/(&&): (x : bool, y : bool) -> $1589 bool (y1y1: $1586==?snd/(==): ($1586, $1586) -> $1589 booly2y2: $1586) &&std/core/types/(&&): (x : bool, y : bool) -> $1589 bool (z1z1: $1587==?thd/(==): ($1587, $1587) -> $1589 boolz2z2: $1587) &&std/core/types/(&&): (x : bool, y : bool) -> $1589 bool (w1w1: $1588==?field4/(==): ($1588, $1588) -> $1589 boolw2w2: $1588) &&std/core/types/(&&): (x : bool, y : bool) -> $1589 bool (v1v1: $1590==?field5/(==): ($1590, $1590) -> $1589 boolv2v2: $1590)

// Order on unit
pub inline fun unit/cmpstd/core/tuple/unit/cmp: (a : (), b : ()) -> order( aa: (): (std/core/types/unit: V)std/core/types/unit: V, bb: (): (std/core/types/unit: V)std/core/types/unit: V )result: -> total order : orderstd/core/types/order: V
  Eqstd/core/types/Eq: order

// Order on tuples
pub fun tuple2/cmpstd/core/tuple/tuple2/cmp: forall<a,b,e> ((a, b), (a, b), @implicit/fst/cmp : (a, a) -> e order, @implicit/snd/cmp : (b, b) -> e order) -> e order( (std/core/types/Tuple2: forall<a,b> (fst : a, snd : b) -> (a, b)x1x1: $1939,y1y1: $1940)std/core/types/Tuple2: forall<a,b> (fst : a, snd : b) -> (a, b) : (std/core/types/tuple2: (V, V) -> Vaa: V,bb: V), (std/core/types/Tuple2: forall<a,b> (fst : a, snd : b) -> (a, b)x2x2: $1939,y2y2: $1940)std/core/types/Tuple2: forall<a,b> (fst : a, snd : b) -> (a, b) : (std/core/types/tuple2: (V, V) -> Vaa: V,bb: V), @implicit/fst/cmp?fst/cmp: ($1939, $1939) -> $1941 order : (aa: V,aa: V) -> ee: E orderstd/core/types/order: V, @implicit/snd/cmp?snd/cmp: ($1940, $1940) -> $1941 order : (bb: V,bb: V) -> ee: E orderstd/core/types/order: V )result: -> 1985 order : ee: E orderstd/core/types/order: V
  match fst/cmp?fst/cmp: ($1939, $1939) -> $1941 order(x1x1: $1939,x2x2: $1939)
    Eqstd/core/types/Eq: order -> snd/cmp?snd/cmp: ($1940, $1940) -> $1941 order(y1y1: $1940,y2y2: $1940)
    lglg: order -> lglg: order

// Order on triples
pub fbip fun tuple3/cmpstd/core/tuple/tuple3/cmp: forall<a,b,c,e> ((a, b, c), (a, b, c), @implicit/fst/cmp : (a, a) -> e order, @implicit/snd/cmp : (b, b) -> e order, @implicit/thd/cmp : (c, c) -> e order) -> e order( (std/core/types/Tuple3: forall<a,b,c> (fst : a, snd : b, thd : c) -> (a, b, c)x1x1: $1986,y1y1: $1987,z1z1: $1988)std/core/types/Tuple3: forall<a,b,c> (fst : a, snd : b, thd : c) -> (a, b, c) : (std/core/types/tuple3: (V, V, V) -> Vaa: V,bb: V,cc: V), (std/core/types/Tuple3: forall<a,b,c> (fst : a, snd : b, thd : c) -> (a, b, c)x2x2: $1986,y2y2: $1987,z2z2: $1988)std/core/types/Tuple3: forall<a,b,c> (fst : a, snd : b, thd : c) -> (a, b, c) : (std/core/types/tuple3: (V, V, V) -> Vaa: V,bb: V,cc: V), ^@implicit/fst/cmp?fst/cmp: ($1986, $1986) -> $1989 order : (aa: V,aa: V) -> ee: E orderstd/core/types/order: V, ^@implicit/snd/cmp?snd/cmp: ($1987, $1987) -> $1989 order : (bb: V,bb: V) -> ee: E orderstd/core/types/order: V, ^@implicit/thd/cmp?thd/cmp: ($1988, $1988) -> $1989 order : (cc: V,cc: V) -> ee: E orderstd/core/types/order: V )result: -> 2050 order : ee: E orderstd/core/types/order: V
  match fst/cmp?fst/cmp: ($1986, $1986) -> $1989 order(x1x1: $1986,x2x2: $1986)
    Eqstd/core/types/Eq: order -> match snd/cmp?snd/cmp: ($1987, $1987) -> $1989 order(y1y1: $1987,y2y2: $1987)
            Eqstd/core/types/Eq: order -> thd/cmp?thd/cmp: ($1988, $1988) -> $1989 order(z1z1: $1988,z2z2: $1988)
            lglg: order -> lglg: order
    lglg: order -> lglg: order

// Order on quadruples
pub fbip fun tuple4/cmpstd/core/tuple/tuple4/cmp: forall<a,b,c,d,e> ((a, b, c, d), (a, b, c, d), @implicit/fst/cmp : (a, a) -> e order, @implicit/snd/cmp : (b, b) -> e order, @implicit/thd/cmp : (c, c) -> e order, @implicit/field4/cmp : (d, d) -> e order) -> e order( (std/core/types/Tuple4: forall<a,b,c,d> (fst : a, snd : b, thd : c, field4 : d) -> (a, b, c, d)x1x1: $2051,y1y1: $2052,z1z1: $2053,w1w1: $2054)std/core/types/Tuple4: forall<a,b,c,d> (fst : a, snd : b, thd : c, field4 : d) -> (a, b, c, d) : (std/core/types/tuple4: (V, V, V, V) -> Vaa: V,bb: V,cc: V,dd: V), (std/core/types/Tuple4: forall<a,b,c,d> (fst : a, snd : b, thd : c, field4 : d) -> (a, b, c, d)x2x2: $2051,y2y2: $2052,z2z2: $2053,w2w2: $2054)std/core/types/Tuple4: forall<a,b,c,d> (fst : a, snd : b, thd : c, field4 : d) -> (a, b, c, d) : (std/core/types/tuple4: (V, V, V, V) -> Vaa: V,bb: V,cc: V,dd: V), 
                            ^@implicit/fst/cmp?fst/cmp: ($2051, $2051) -> $2055 order : (aa: V,aa: V) -> ee: E orderstd/core/types/order: V, ^@implicit/snd/cmp?snd/cmp: ($2052, $2052) -> $2055 order : (bb: V,bb: V) -> ee: E orderstd/core/types/order: V, 
                            ^@implicit/thd/cmp?thd/cmp: ($2053, $2053) -> $2055 order : (cc: V,cc: V) -> ee: E orderstd/core/types/order: V, ^@implicit/field4/cmp?field4/cmp: ($2054, $2054) -> $2055 order : (dd: V,dd: V) -> ee: E orderstd/core/types/order: V )result: -> 2133 order : ee: E orderstd/core/types/order: V
  match fst/cmp?fst/cmp: ($2051, $2051) -> $2055 order(x1x1: $2051,x2x2: $2051)
    Eqstd/core/types/Eq: order -> match snd/cmp?snd/cmp: ($2052, $2052) -> $2055 order(y1y1: $2052,y2y2: $2052)
            Eqstd/core/types/Eq: order -> match thd/cmp?thd/cmp: ($2053, $2053) -> $2055 order(z1z1: $2053,z2z2: $2053)
                    Eqstd/core/types/Eq: order -> field4/cmp?field4/cmp: ($2054, $2054) -> $2055 order(w1w1: $2054,w2w2: $2054)
                    lglg: order -> lglg: order
            lglg: order -> lglg: order
    lglg: order -> lglg: order

// Order on quintuples
pub fbip fun tuple5/cmpstd/core/tuple/tuple5/cmp: forall<a,b,c,d,e,a1> ((a, b, c, d, a1), (a, b, c, d, a1), @implicit/fst/cmp : (a, a) -> e order, @implicit/snd/cmp : (b, b) -> e order, @implicit/thd/cmp : (c, c) -> e order, @implicit/field4/cmp : (d, d) -> e order, @implicit/field5/cmp : (a1, a1) -> e order) -> e order( (std/core/types/Tuple5: forall<a,b,c,d,a1> (fst : a, snd : b, thd : c, field4 : d, field5 : a1) -> (a, b, c, d, a1)x1x1: $2134,y1y1: $2135,z1z1: $2136,w1w1: $2137,v1v1: $2139)std/core/types/Tuple5: forall<a,b,c,d,a1> (fst : a, snd : b, thd : c, field4 : d, field5 : a1) -> (a, b, c, d, a1) : (std/core/types/tuple5: (V, V, V, V, V) -> Vaa: V,bb: V,cc: V,dd: V,ff: V), (std/core/types/Tuple5: forall<a,b,c,d,a1> (fst : a, snd : b, thd : c, field4 : d, field5 : a1) -> (a, b, c, d, a1)x2x2: $2134,y2y2: $2135,z2z2: $2136,w2w2: $2137,v2v2: $2139)std/core/types/Tuple5: forall<a,b,c,d,a1> (fst : a, snd : b, thd : c, field4 : d, field5 : a1) -> (a, b, c, d, a1) : (std/core/types/tuple5: (V, V, V, V, V) -> Vaa: V,bb: V,cc: V,dd: V,ff: V), 
                            ^@implicit/fst/cmp?fst/cmp: ($2134, $2134) -> $2138 order : (aa: V,aa: V) -> ee: E orderstd/core/types/order: V, ^@implicit/snd/cmp?snd/cmp: ($2135, $2135) -> $2138 order : (bb: V,bb: V) -> ee: E orderstd/core/types/order: V, ^@implicit/thd/cmp?thd/cmp: ($2136, $2136) -> $2138 order : (cc: V,cc: V) -> ee: E orderstd/core/types/order: V, 
                            ^@implicit/field4/cmp?field4/cmp: ($2137, $2137) -> $2138 order : (dd: V,dd: V) -> ee: E orderstd/core/types/order: V, ^@implicit/field5/cmp?field5/cmp: ($2139, $2139) -> $2138 order : (ff: V,ff: V) -> ee: E orderstd/core/types/order: V )result: -> 2233 order : ee: E orderstd/core/types/order: V
  match fst/cmp?fst/cmp: ($2134, $2134) -> $2138 order(x1x1: $2134,x2x2: $2134)
    Eqstd/core/types/Eq: order -> match snd/cmp?snd/cmp: ($2135, $2135) -> $2138 order(y1y1: $2135,y2y2: $2135)
            Eqstd/core/types/Eq: order -> match thd/cmp?thd/cmp: ($2136, $2136) -> $2138 order(z1z1: $2136,z2z2: $2136)
                    Eqstd/core/types/Eq: order -> match field4/cmp?field4/cmp: ($2137, $2137) -> $2138 order(w1w1: $2137,w2w2: $2137)
                            Eqstd/core/types/Eq: order -> field5/cmp?field5/cmp: ($2139, $2139) -> $2138 order(v1v1: $2139,v2v2: $2139)
                            lglg: order -> lglg: order
                    lglg: order -> lglg: order
            lglg: order -> lglg: order
    lglg: order -> lglg: order

// fip ordering of unit values
pub inline fip fun unit/order2std/core/tuple/unit/order2: (a : (), b : ()) -> order2<()>( aa: (): (std/core/types/unit: V)std/core/types/unit: V, bb: (): (std/core/types/unit: V)std/core/types/unit: V )result: -> total order2<()> : order2std/core/types/order2: V -> V<(std/core/types/unit: V)std/core/types/unit: V>
  Eq2std/core/types/Eq2: forall<a> (eq : a) -> order2<a>(aa: ())

// Convert a unit value `()` to a string
pub inline fun unit/showstd/core/tuple/unit/show: (u : ()) -> string( uu: () : (std/core/types/unit: V)std/core/types/unit: V )result: -> total string : stringstd/core/types/string: V
  "()"literal: string
count= 2
// Show a tuple pub fun tuple2/showstd/core/tuple/tuple2/show: forall<a,b,e> (x : (a, b), @implicit/fst/show : (a) -> e string, @implicit/snd/show : (b) -> e string) -> e string( xx: ($2304, $2305) : (std/core/types/tuple2: (V, V) -> Vaa: V,bb: V), @implicit/fst/show?fst/show: ($2304) -> $2306 string : aa: V -> ee: E stringstd/core/types/string: V, @implicit/snd/show?snd/show: ($2305) -> $2306 string : bb: V -> ee: E stringstd/core/types/string: V)result: -> 2507 string : ee: E stringstd/core/types/string: V "("literal: string
count= 1
++std/core/types/(++): (x : string, y : string) -> $2306 string xx: ($2304, $2305).fststd/core/types/tuple2/fst: (tuple2 : ($2304, $2305)) -> $2306 $2304.show?fst/show: ($2304) -> $2306 string ++std/core/types/(++): (x : string, y : string) -> $2306 string ","literal: string
count= 1
++std/core/types/(++): (x : string, y : string) -> $2306 string xx: ($2304, $2305).sndstd/core/types/tuple2/snd: (tuple2 : ($2304, $2305)) -> $2306 $2305.show?snd/show: ($2305) -> $2306 string ++std/core/types/(++): (x : string, y : string) -> $2306 string ")"literal: string
count= 1
// Show a triple pub fun tuple3/showstd/core/tuple/tuple3/show: forall<a,b,c,e> (x : (a, b, c), @implicit/fst/show : (a) -> e string, @implicit/snd/show : (b) -> e string, @implicit/thd/show : (c) -> e string) -> e string( xx: ($2508, $2509, $2510) : (std/core/types/tuple3: (V, V, V) -> Vaa: V,bb: V,cc: V), @implicit/fst/show?fst/show: ($2508) -> $2511 string : aa: V -> ee: E stringstd/core/types/string: V, @implicit/snd/show?snd/show: ($2509) -> $2511 string : bb: V -> ee: E stringstd/core/types/string: V, @implicit/thd/show?thd/show: ($2510) -> $2511 string : cc: V -> ee: E stringstd/core/types/string: V)result: -> 2811 string : ee: E stringstd/core/types/string: V "("literal: string
count= 1
++std/core/types/(++): (x : string, y : string) -> $2511 string xx: ($2508, $2509, $2510).fststd/core/types/tuple3/fst: (tuple3 : ($2508, $2509, $2510)) -> $2511 $2508.show?fst/show: ($2508) -> $2511 string ++std/core/types/(++): (x : string, y : string) -> $2511 string ","literal: string
count= 1
++std/core/types/(++): (x : string, y : string) -> $2511 string xx: ($2508, $2509, $2510).sndstd/core/types/tuple3/snd: (tuple3 : ($2508, $2509, $2510)) -> $2511 $2509.show?snd/show: ($2509) -> $2511 string ++std/core/types/(++): (x : string, y : string) -> $2511 string ","literal: string
count= 1
++std/core/types/(++): (x : string, y : string) -> $2511 string xx: ($2508, $2509, $2510).thdstd/core/types/tuple3/thd: (tuple3 : ($2508, $2509, $2510)) -> $2511 $2510.show?thd/show: ($2510) -> $2511 string ++std/core/types/(++): (x : string, y : string) -> $2511 string ")"literal: string
count= 1
// Show a quadruple pub fun tuple4/showstd/core/tuple/tuple4/show: forall<a,b,c,d,e> (x : (a, b, c, d), @implicit/fst/show : (a) -> e string, @implicit/snd/show : (b) -> e string, @implicit/thd/show : (c) -> e string, @implicit/field4/show : (d) -> e string) -> e string( xx: ($2812, $2813, $2814, $2815) : (std/core/types/tuple4: (V, V, V, V) -> Vaa: V,bb: V,cc: V,dd: V), @implicit/fst/show?fst/show: ($2812) -> $2816 string : aa: V -> ee: E stringstd/core/types/string: V, @implicit/snd/show?snd/show: ($2813) -> $2816 string : bb: V -> ee: E stringstd/core/types/string: V, @implicit/thd/show?thd/show: ($2814) -> $2816 string : cc: V -> ee: E stringstd/core/types/string: V, @implicit/field4/show?field4/show: ($2815) -> $2816 string : dd: V -> ee: E stringstd/core/types/string: V)result: -> 3213 string : ee: E stringstd/core/types/string: V "("literal: string
count= 1
++std/core/types/(++): (x : string, y : string) -> $2816 string xx: ($2812, $2813, $2814, $2815).fststd/core/types/tuple4/fst: (tuple4 : ($2812, $2813, $2814, $2815)) -> $2816 $2812.show?fst/show: ($2812) -> $2816 string ++std/core/types/(++): (x : string, y : string) -> $2816 string ","literal: string
count= 1
++std/core/types/(++): (x : string, y : string) -> $2816 string xx: ($2812, $2813, $2814, $2815).sndstd/core/types/tuple4/snd: (tuple4 : ($2812, $2813, $2814, $2815)) -> $2816 $2813.show?snd/show: ($2813) -> $2816 string ++std/core/types/(++): (x : string, y : string) -> $2816 string ","literal: string
count= 1
++std/core/types/(++): (x : string, y : string) -> $2816 string xx: ($2812, $2813, $2814, $2815).thdstd/core/types/tuple4/thd: (tuple4 : ($2812, $2813, $2814, $2815)) -> $2816 $2814.show?thd/show: ($2814) -> $2816 string ++std/core/types/(++): (x : string, y : string) -> $2816 string ","literal: string
count= 1
++std/core/types/(++): (x : string, y : string) -> $2816 string xx: ($2812, $2813, $2814, $2815).field4std/core/types/tuple4/field4: (tuple4 : ($2812, $2813, $2814, $2815)) -> $2816 $2815.show?field4/show: ($2815) -> $2816 string ++std/core/types/(++): (x : string, y : string) -> $2816 string ")"literal: string
count= 1
// Show a quintuple pub fun tuple5/showstd/core/tuple/tuple5/show: forall<a,b,c,d,e,a1> (x : (a, b, c, d, a1), @implicit/fst/show : (a) -> e string, @implicit/snd/show : (b) -> e string, @implicit/thd/show : (c) -> e string, @implicit/field4/show : (d) -> e string, @implicit/field5/show : (a1) -> e string) -> e string( xx: ($3214, $3215, $3216, $3217, $3219) : (std/core/types/tuple5: (V, V, V, V, V) -> Vaa: V,bb: V,cc: V,dd: V,ff: V), @implicit/fst/show?fst/show: ($3214) -> $3218 string : aa: V -> ee: E stringstd/core/types/string: V, @implicit/snd/show?snd/show: ($3215) -> $3218 string : bb: V -> ee: E stringstd/core/types/string: V, @implicit/thd/show?thd/show: ($3216) -> $3218 string : cc: V -> ee: E stringstd/core/types/string: V, @implicit/field4/show?field4/show: ($3217) -> $3218 string : dd: V -> ee: E stringstd/core/types/string: V, @implicit/field5/show?field5/show: ($3219) -> $3218 string : ff: V -> ee: E stringstd/core/types/string: V)result: -> 3703 string : ee: E stringstd/core/types/string: V "("literal: string
count= 1
++std/core/types/(++): (x : string, y : string) -> $3218 string xx: ($3214, $3215, $3216, $3217, $3219).fststd/core/types/tuple5/fst: (tuple5 : ($3214, $3215, $3216, $3217, $3219)) -> $3218 $3214.show?fst/show: ($3214) -> $3218 string ++std/core/types/(++): (x : string, y : string) -> $3218 string ","literal: string
count= 1
++std/core/types/(++): (x : string, y : string) -> $3218 string xx: ($3214, $3215, $3216, $3217, $3219).sndstd/core/types/tuple5/snd: (tuple5 : ($3214, $3215, $3216, $3217, $3219)) -> $3218 $3215.show?snd/show: ($3215) -> $3218 string ++std/core/types/(++): (x : string, y : string) -> $3218 string ","literal: string
count= 1
++std/core/types/(++): (x : string, y : string) -> $3218 string xx: ($3214, $3215, $3216, $3217, $3219).thdstd/core/types/tuple5/thd: (tuple5 : ($3214, $3215, $3216, $3217, $3219)) -> $3218 $3216.show?thd/show: ($3216) -> $3218 string ++std/core/types/(++): (x : string, y : string) -> $3218 string ","literal: string
count= 1
++std/core/types/(++): (x : string, y : string) -> $3218 string xx: ($3214, $3215, $3216, $3217, $3219).field4std/core/types/tuple5/field4: (tuple5 : ($3214, $3215, $3216, $3217, $3219)) -> $3218 $3217.show?field4/show: ($3217) -> $3218 string ++std/core/types/(++): (x : string, y : string) -> $3218 string ","literal: string
count= 1
++std/core/types/(++): (x : string, y : string) -> $3218 string xx: ($3214, $3215, $3216, $3217, $3219).field5std/core/types/tuple5/field5: (tuple5 : ($3214, $3215, $3216, $3217, $3219)) -> $3218 $3219.show?field5/show: ($3219) -> $3218 string ++std/core/types/(++): (x : string, y : string) -> $3218 string ")"literal: string
count= 1
// _deprecated_, use `tuple2/show` instead pub fun show-tuplestd/core/tuple/show-tuple: forall<a,b,e> (x : (a, b), showfst : (a) -> e string, showsnd : (b) -> e string) -> e string( xx: ($3759, $3760) : (std/core/types/tuple2: (V, V) -> Vaa: V,bb: V), showfstshowfst: ($3759) -> $3761 string : aa: V -> ee: E stringstd/core/types/string: V, showsndshowsnd: ($3760) -> $3761 string : bb: V -> ee: E stringstd/core/types/string: V )result: -> 3942 string : ee: E stringstd/core/types/string: V showstd/core/tuple/tuple2/show: (x : ($3759, $3760), @implicit/fst/show : ($3759) -> $3761 string, @implicit/snd/show : ($3760) -> $3761 string) -> $3761 string(xx: ($3759, $3760),@implicit/fst/show=showfstshowfst: ($3759) -> $3761 string,@implicit/snd/show=showsndshowsnd: ($3760) -> $3761 string)