/// The prelude: visible in every module without an import. /// /// Operators are trait methods: `==` `!=` use `Eq`, `<` `>` `<=` `>=` use /// `Ord`, `+` `-` `*` `/` `%` and unary `-` use `Num`, `<>` uses /// `Semigroup` (Strings, Lists, Bytes, Order). `&&`, `||` and `!` work on /// Bool. /// A signed integer of any size: a 63-bit word, promoted to a big /// integer when a result does not fit (arithmetic never overflows). @builtin pub type Int /// A 64-bit IEEE float. @builtin pub type Float /// Immutable UTF-8 text. @builtin pub type String /// Immutable binary data (see std/bytes). @builtin pub type Bytes /// Built-in effects, handled by the runtime around `main`, tests and /// actors. `io`: input/output. `ffi`: foreign calls. The others with it /// are `proc` (std/process), `clock` (std/time) and `random` (std/random). /// (Mutable state is `st`, handled by `region { }`: see std/ref.) pub effect io {} pub effect ffi {} /// The compiler's, for an early `return` from inside a `use` callback or a /// `defer`, `handle` or `region` body (ADR 0037): the function handles it /// around that construct, and leaves with the value. Private: no program /// can name it. effect early_return { final ctl early_return :: value: a -> Never } pub type Bool { False, True } pub type List { Nil, Cons(a, List) } pub type Option { None, Some(a) } pub type Result { Ok(a), Error(e) } /// The type with no values: the result of computations that never return. pub type Never pub type Order { Lt, Eq, Gt } /// Stop the program (or the current actor) with a message. Panics are not /// tracked in effect rows (ADR 0001); use `Result` or an effect for errors /// a caller should handle. @extern c "tl_panic" pub fn panic :: message: String -> Never /// Derivable. Derived equality compares constructors, then fields in /// order, and stops at the first difference. @derivable pub trait Eq { fn eq :: x: a y: a -> Bool } /// Derivable. Derived order compares constructors in declaration order, /// then fields lexicographically. @derivable pub trait Ord { fn compare :: x: a y: a -> Order } pub trait Num { fn add :: x: a y: a -> a fn sub :: x: a y: a -> a fn mul :: x: a y: a -> a fn div :: x: a y: a -> a fn rem :: x: a y: a -> a fn negate :: x: a -> a } /// `<>`: one value followed by another of the same type (ADR 0027). /// Strings, lists and `Bytes` are joined in order (`[1] <> [2, 3]` is /// `[1, 2, 3]`). On `Order`, `<>` breaks ties: the first that is not `Eq`, /// so `compare(a.last, b.last) <> compare(a.first, b.first)` sorts by last /// name, then first name. pub trait Semigroup { fn append :: x: a y: a -> a } /// Derivable: `Name` or `Name(field, ...)`. @derivable show_constructor pub trait Show { fn show :: x: a -> String } /// A programmer-facing representation, like Rust's `Debug`: strings are /// quoted and escaped, records show their field names. Derivable. /// (`Show` is for text meant for users, like Rust's `Display`.) @derivable debug_constructor pub trait Debug { fn debug :: x: a -> String } /// Hash values, e.g. for dictionary keys. Derivable: the constructor's /// index mixed with every field's hash, with `hash_combine`. @derivable pub trait Hash { fn hash :: x: a -> Int } /// A default value. Derivable for single-constructor types. @derivable pub trait Default { fn default :: -> a } /// Values that can be sent to another actor (ADR 0004, Revision 6). The /// compiler decides it from the type's structure: a `Ref` never is, a /// `Resource` is when `k` is `@thread_safe`, and a type is when all its /// fields are. It cannot be implemented, and costs nothing at run time. pub trait Send {} /// Values that can cross hosts, to an actor on another node (ADR 0072). /// The compiler decides it from the type's structure, like `Send`: the /// built-in values (`Int`, `String`, `Bytes`, `Pid`, `Array`, ...), /// tuples, a `Subject` when `m` is, and a type whose fields are. Never /// a function, a `Ref`, a `Resource`, a `Dynamic`, or a type whose /// constructor hides or refines a type (ADR 0041). `Wire` implies /// `Send`. It cannot be implemented; its dictionary describes the /// type. pub trait Wire {} /// The label of a function type's capture row that says it may capture /// what cannot be sent (ADR 0004, Revision 6): written `fn` in a type's /// field, or a closure that captured a `Ref`. Used by the compiler only. type LocalCapture { LocalCapture } /// A value seen through its constructor, for derived impls (ADR 0019): /// the constructor's name, its index in its type's declaration, and one /// field for each of its fields, in order. A trait marked /// `@derivable(f)` derives its method `m` as `f(Constructor(..., fields))`, /// where each field's value is `m` applied to that field. pub type Constructor { Constructor(name: String, index: Int, fields: List>) } /// A field's label (`""` for a positional field) and its value. pub type Field { Field(label: String, value: r) } fn show_constructor :: c: Constructor -> String { match c.fields { [] -> c.name, fields -> c.name <> "(" <> join_fields fields False <> ")" } } /// Labelled fields as `Name { label: value, ... }`, as Rust does. fn debug_constructor :: c: Constructor -> String { match c.fields { [] -> c.name , fields if all_labelled fields -> c.name <> " \{ " <> join_fields fields True <> " \}" , fields -> c.name <> "(" <> join_fields fields False <> ")" } } fn join_fields :: fields: List> labelled: Bool -> String { match fields { [] -> "" , [f] -> field_text f labelled , [f, ..rest] -> field_text f labelled <> ", " <> join_fields rest labelled } } fn field_text :: f: Field labelled: Bool -> String { if labelled { f.label <> ": " <> f.value } else { f.value } } fn all_labelled :: fields: List> -> Bool { match fields { [] -> True, [f, ..rest] -> f.label != "" && all_labelled rest } } @extern c "tl_int_eq" fn int_eq :: x: Int y: Int -> Bool @extern c "tl_int_compare" fn int_compare :: x: Int y: Int -> Order @extern c "tl_int_add" fn int_add :: x: Int y: Int -> Int @extern c "tl_int_sub" fn int_sub :: x: Int y: Int -> Int @extern c "tl_int_mul" fn int_mul :: x: Int y: Int -> Int @extern c "tl_int_div" fn int_div :: x: Int y: Int -> Int @extern c "tl_int_rem" fn int_rem :: x: Int y: Int -> Int @extern c "tl_int_show" fn int_show :: x: Int -> String @extern c "tl_float_eq" fn float_eq :: x: Float y: Float -> Bool @extern c "tl_float_compare" fn float_compare :: x: Float y: Float -> Order @extern c "tl_float_add" fn float_add :: x: Float y: Float -> Float @extern c "tl_float_sub" fn float_sub :: x: Float y: Float -> Float @extern c "tl_float_mul" fn float_mul :: x: Float y: Float -> Float @extern c "tl_float_div" fn float_div :: x: Float y: Float -> Float @extern c "tl_float_rem" fn float_rem :: x: Float y: Float -> Float @extern c "tl_float_show" fn float_show :: x: Float -> String @extern c "tl_string_eq" fn string_eq :: x: String y: String -> Bool @extern c "tl_string_compare" fn string_compare :: x: String y: String -> Order @extern c "tl_string_concat" fn string_concat :: x: String y: String -> String @extern c "tl_bytes_concat" fn bytes_concat :: x: Bytes y: Bytes -> Bytes impl Semigroup { fn append :: x y { string_concat x y } } /// Copies `xs`, unless it is unique: then its cells are reused. impl Semigroup> { fn append :: xs ys { append_lists xs ys } } fn append_lists :: xs ys { match xs { [] -> ys, [x, ..rest] -> [x, ..append_lists rest ys] } } impl Semigroup { fn append :: x y { bytes_concat x y } } impl Semigroup { fn append :: x y { match x { Eq -> y, first -> first } } } impl Eq { fn eq :: x y { int_eq x y } } impl Ord { fn compare :: x y { int_compare x y } } impl Num { fn add :: x y { int_add x y } fn sub :: x y { int_sub x y } fn mul :: x y { int_mul x y } fn div :: x y { int_div x y } fn rem :: x y { int_rem x y } fn negate :: x { int_sub 0 x } } impl Show { fn show :: x { int_show x } } impl Eq { fn eq :: x y { float_eq x y } } impl Ord { fn compare :: x y { float_compare x y } } impl Num { fn add :: x y { float_add x y } fn sub :: x y { float_sub x y } fn mul :: x y { float_mul x y } fn div :: x y { float_div x y } fn rem :: x y { float_rem x y } fn negate :: x { float_sub 0.0 x } } impl Show { fn show :: x { float_show x } } impl Eq { fn eq :: x y { string_eq x y } } impl Ord { fn compare :: x y { string_compare x y } } impl Show { fn show :: x { x } } @extern c "tl_bytes_eq" fn bytes_eq :: x: Bytes y: Bytes -> Bool @extern c "tl_bytes_compare" fn bytes_compare :: x: Bytes y: Bytes -> Order impl Eq { fn eq :: x y { bytes_eq x y } } /// Lexicographic, byte by byte: a prefix is smaller. impl Ord { fn compare :: x y { bytes_compare x y } } impl Eq { fn eq :: x y { match (x, y) { (True, True) | (False, False) -> True, _ -> False } } } impl Show { fn show :: x { if x { "True" } else { "False" } } } impl Eq> where Eq { fn eq :: xs ys { match (xs, ys) { (Nil, Nil) -> True , (Cons(x, xs), Cons(y, ys)) -> x == y && xs == ys , _ -> False } } } impl Eq> where Eq { fn eq :: x y { match (x, y) { (None, None) -> True, (Some(a), Some(b)) -> a == b, _ -> False } } } impl Show> where Show { fn show :: xs { "[" <> show_items xs <> "]" } } fn show_items :: xs { match xs { [] -> "", [x] -> show x, [x, ..rest] -> show x <> ", " <> show_items rest } } impl Show> where Show { fn show :: o { match o { Some(x) -> "Some(" <> show x <> ")", None -> "None" } } } @extern c "tl_hash_int" fn hash_int :: x: Int -> Int @extern c "tl_hash_float" fn hash_float :: x: Float -> Int @extern c "tl_hash_string" fn hash_string :: x: String -> Int @extern c "tl_hash_bytes" fn hash_bytes :: x: Bytes -> Int /// Mix two hashes (what derived `Hash` uses for fields). @extern c "tl_hash_combine" pub fn hash_combine :: a: Int b: Int -> Int impl Hash { fn hash :: x { hash_int x } } impl Hash { fn hash :: x { hash_float x } } impl Hash { fn hash :: x { hash_string x } } impl Hash { fn hash :: x { hash_bytes x } } impl Hash { fn hash :: x { if x { 1 } else { 0 } } } impl Hash> where Hash { fn hash :: xs { hash_items xs 7 } } fn hash_items :: xs acc { match xs { [] -> acc, [x, ..rest] -> hash_items rest (hash_combine acc (hash x)) } } impl Hash> where Hash { fn hash :: o { match o { None -> 0, Some(x) -> hash_combine 1 (hash x) } } } impl Default { fn default :: { 0 } } impl Default { fn default :: { 0.0 } } impl Default { fn default :: { "" } } impl Default { fn default :: { False } } impl Default> { fn default :: { [] } } impl Default> { fn default :: { None } } impl Ord { fn compare :: x y { match (x, y) { (False, True) -> Lt, (True, False) -> Gt, _ -> Eq } } } /// Lexicographic, as in Rust: a prefix is smaller. impl Ord> where Ord { fn compare :: xs ys { match (xs, ys) { ([], []) -> Eq , ([], _) -> Lt , (_, []) -> Gt , ([x, ..xs], [y, ..ys]) -> match compare x y { Eq -> compare xs ys, other -> other } } } } /// `None` is smaller than any `Some`. impl Ord> where Ord { fn compare :: x y { match (x, y) { (None, None) -> Eq , (None, Some(_)) -> Lt , (Some(_), None) -> Gt , (Some(a), Some(b)) -> compare a b } } } @extern c "tl_string_debug" fn string_debug :: x: String -> String impl Debug { fn debug :: x { show x } } impl Debug { fn debug :: x { show x } } impl Debug { fn debug :: x { show x } } impl Debug { fn debug :: x { string_debug x } } @extern c "tl_bytes_debug" fn bytes_debug :: x: Bytes -> String /// `b"..."`: printable ASCII as is, other bytes escaped (`\xff`). impl Debug { fn debug :: x { bytes_debug x } } impl Debug> where Debug { fn debug :: xs { "[" <> debug_items xs <> "]" } } fn debug_items :: xs { match xs { [] -> "" , [x] -> debug x , [x, ..rest] -> debug x <> ", " <> debug_items rest } } impl Debug> where Debug { fn debug :: o { match o { Some(x) -> "Some(" <> debug x <> ")", None -> "None" } } } impl Eq> where Eq, Eq { fn eq :: x y { match (x, y) { (Ok(a), Ok(b)) -> a == b, (Error(a), Error(b)) -> a == b, _ -> False } } } impl Show> where Show, Show { fn show :: r { match r { Ok(x) -> "Ok(" <> show x <> ")", Error(x) -> "Error(" <> show x <> ")" } } } impl Debug> where Debug, Debug { fn debug :: r { match r { Ok(x) -> "Ok(" <> debug x <> ")", Error(x) -> "Error(" <> debug x <> ")" } } } /// `Ok` is smaller than any `Error` (declaration order, as derived). impl Ord> where Ord, Ord { fn compare :: x y { match (x, y) { (Ok(a), Ok(b)) -> compare a b , (Ok(_), Error(_)) -> Lt , (Error(_), Ok(_)) -> Gt , (Error(a), Error(b)) -> compare a b } } } impl Hash> where Hash, Hash { fn hash :: r { match r { Ok(x) -> hash_combine 0 (hash x), Error(x) -> hash_combine 1 (hash x) } } } // --- `()` and tuples: generated by scripts/gen-tuple-impls.py, do not edit --- // Tuples compare element by element, in order; they show as `(1, a)` // and debug as `(1, "a")`. A tuple's hash folds its elements' with // `hash_combine`, as a derived impl does. impl Eq<()> { fn eq :: _ _ { True } } impl Ord<()> { fn compare :: _ _ { Eq } } impl Show<()> { fn show :: _ { "()" } } impl Debug<()> { fn debug :: _ { "()" } } impl Hash<()> { fn hash :: _ { 0 } } impl Default<()> { fn default :: { () } } impl Eq<(a, b)> where Eq, Eq { fn eq :: x y { x.0 == y.0 && x.1 == y.1 } } impl Ord<(a, b)> where Ord, Ord { fn compare :: x y { compare x.0 y.0 <> compare x.1 y.1 } } impl Show<(a, b)> where Show, Show { fn show :: x { "(" <> show x.0 <> ", " <> show x.1 <> ")" } } impl Debug<(a, b)> where Debug, Debug { fn debug :: x { "(" <> debug x.0 <> ", " <> debug x.1 <> ")" } } impl Hash<(a, b)> where Hash, Hash { fn hash :: x { hash_combine (hash_combine 0 (hash x.0)) (hash x.1) } } impl Default<(a, b)> where Default, Default { fn default :: { (default (), default ()) } } impl Eq<(a, b, c)> where Eq, Eq, Eq { fn eq :: x y { x.0 == y.0 && x.1 == y.1 && x.2 == y.2 } } impl Ord<(a, b, c)> where Ord, Ord, Ord { fn compare :: x y { compare x.0 y.0 <> compare x.1 y.1 <> compare x.2 y.2 } } impl Show<(a, b, c)> where Show, Show, Show { fn show :: x { "(" <> show x.0 <> ", " <> show x.1 <> ", " <> show x.2 <> ")" } } impl Debug<(a, b, c)> where Debug, Debug, Debug { fn debug :: x { "(" <> debug x.0 <> ", " <> debug x.1 <> ", " <> debug x.2 <> ")" } } impl Hash<(a, b, c)> where Hash, Hash, Hash { fn hash :: x { hash_combine (hash_combine (hash_combine 0 (hash x.0)) (hash x.1)) (hash x.2) } } impl Default<(a, b, c)> where Default, Default, Default { fn default :: { (default (), default (), default ()) } } impl Eq<(a, b, c, d)> where Eq, Eq, Eq, Eq { fn eq :: x y { x.0 == y.0 && x.1 == y.1 && x.2 == y.2 && x.3 == y.3 } } impl Ord<(a, b, c, d)> where Ord, Ord, Ord, Ord { fn compare :: x y { compare x.0 y.0 <> compare x.1 y.1 <> compare x.2 y.2 <> compare x.3 y.3 } } impl Show<(a, b, c, d)> where Show, Show, Show, Show { fn show :: x { "(" <> show x.0 <> ", " <> show x.1 <> ", " <> show x.2 <> ", " <> show x.3 <> ")" } } impl Debug<(a, b, c, d)> where Debug, Debug, Debug, Debug { fn debug :: x { "(" <> debug x.0 <> ", " <> debug x.1 <> ", " <> debug x.2 <> ", " <> debug x.3 <> ")" } } impl Hash<(a, b, c, d)> where Hash, Hash, Hash, Hash { fn hash :: x { hash_combine ( hash_combine (hash_combine (hash_combine 0 (hash x.0)) (hash x.1)) (hash x.2) ) (hash x.3) } } impl Default<(a, b, c, d)> where Default, Default, Default, Default { fn default :: { (default (), default (), default (), default ()) } } impl Eq<(a, b, c, d, e)> where Eq, Eq, Eq, Eq, Eq { fn eq :: x y { x.0 == y.0 && x.1 == y.1 && x.2 == y.2 && x.3 == y.3 && x.4 == y.4 } } impl Ord<(a, b, c, d, e)> where Ord, Ord, Ord, Ord, Ord { fn compare :: x y { compare x.0 y.0 <> compare x.1 y.1 <> compare x.2 y.2 <> compare x.3 y.3 <> compare x.4 y.4 } } impl Show<(a, b, c, d, e)> where Show, Show, Show, Show, Show { fn show :: x { "(" <> show x.0 <> ", " <> show x.1 <> ", " <> show x.2 <> ", " <> show x.3 <> ", " <> show x.4 <> ")" } } impl Debug<(a, b, c, d, e)> where Debug , Debug , Debug , Debug , Debug { fn debug :: x { "(" <> debug x.0 <> ", " <> debug x.1 <> ", " <> debug x.2 <> ", " <> debug x.3 <> ", " <> debug x.4 <> ")" } } impl Hash<(a, b, c, d, e)> where Hash, Hash, Hash, Hash, Hash { fn hash :: x { hash_combine ( hash_combine ( hash_combine (hash_combine (hash_combine 0 (hash x.0)) (hash x.1)) (hash x.2) ) (hash x.3) ) (hash x.4) } } impl Default<(a, b, c, d, e)> where Default , Default , Default , Default , Default { fn default :: { (default (), default (), default (), default (), default ()) } } impl Eq<(a, b, c, d, e, f)> where Eq, Eq, Eq, Eq, Eq, Eq { fn eq :: x y { x.0 == y.0 && x.1 == y.1 && x.2 == y.2 && x.3 == y.3 && x.4 == y.4 && x.5 == y.5 } } impl Ord<(a, b, c, d, e, f)> where Ord , Ord , Ord , Ord , Ord , Ord { fn compare :: x y { compare x.0 y.0 <> compare x.1 y.1 <> compare x.2 y.2 <> compare x.3 y.3 <> compare x.4 y.4 <> compare x.5 y.5 } } impl Show<(a, b, c, d, e, f)> where Show , Show , Show , Show , Show , Show { fn show :: x { "(" <> show x.0 <> ", " <> show x.1 <> ", " <> show x.2 <> ", " <> show x.3 <> ", " <> show x.4 <> ", " <> show x.5 <> ")" } } impl Debug<(a, b, c, d, e, f)> where Debug , Debug , Debug , Debug , Debug , Debug { fn debug :: x { "(" <> debug x.0 <> ", " <> debug x.1 <> ", " <> debug x.2 <> ", " <> debug x.3 <> ", " <> debug x.4 <> ", " <> debug x.5 <> ")" } } impl Hash<(a, b, c, d, e, f)> where Hash , Hash , Hash , Hash , Hash , Hash { fn hash :: x { hash_combine ( hash_combine ( hash_combine ( hash_combine (hash_combine (hash_combine 0 (hash x.0)) (hash x.1)) (hash x.2) ) (hash x.3) ) (hash x.4) ) (hash x.5) } } impl Default<(a, b, c, d, e, f)> where Default , Default , Default , Default , Default , Default { fn default :: { (default (), default (), default (), default (), default (), default ()) } } impl Eq<(a, b, c, d, e, f, g)> where Eq , Eq , Eq , Eq , Eq , Eq , Eq { fn eq :: x y { x.0 == y.0 && x.1 == y.1 && x.2 == y.2 && x.3 == y.3 && x.4 == y.4 && x.5 == y.5 && x.6 == y.6 } } impl Ord<(a, b, c, d, e, f, g)> where Ord , Ord , Ord , Ord , Ord , Ord , Ord { fn compare :: x y { compare x.0 y.0 <> compare x.1 y.1 <> compare x.2 y.2 <> compare x.3 y.3 <> compare x.4 y.4 <> compare x.5 y.5 <> compare x.6 y.6 } } impl Show<(a, b, c, d, e, f, g)> where Show , Show , Show , Show , Show , Show , Show { fn show :: x { "(" <> show x.0 <> ", " <> show x.1 <> ", " <> show x.2 <> ", " <> show x.3 <> ", " <> show x.4 <> ", " <> show x.5 <> ", " <> show x.6 <> ")" } } impl Debug<(a, b, c, d, e, f, g)> where Debug , Debug , Debug , Debug , Debug , Debug , Debug { fn debug :: x { "(" <> debug x.0 <> ", " <> debug x.1 <> ", " <> debug x.2 <> ", " <> debug x.3 <> ", " <> debug x.4 <> ", " <> debug x.5 <> ", " <> debug x.6 <> ")" } } impl Hash<(a, b, c, d, e, f, g)> where Hash , Hash , Hash , Hash , Hash , Hash , Hash { fn hash :: x { hash_combine ( hash_combine ( hash_combine ( hash_combine ( hash_combine (hash_combine (hash_combine 0 (hash x.0)) (hash x.1)) (hash x.2) ) (hash x.3) ) (hash x.4) ) (hash x.5) ) (hash x.6) } } impl Default<(a, b, c, d, e, f, g)> where Default , Default , Default , Default , Default , Default , Default { fn default :: { ( default () , default () , default () , default () , default () , default () , default () ) } } impl Eq<(a, b, c, d, e, f, g, h)> where Eq , Eq , Eq , Eq , Eq , Eq , Eq , Eq { fn eq :: x y { x.0 == y.0 && x.1 == y.1 && x.2 == y.2 && x.3 == y.3 && x.4 == y.4 && x.5 == y.5 && x.6 == y.6 && x.7 == y.7 } } impl Ord<(a, b, c, d, e, f, g, h)> where Ord , Ord , Ord , Ord , Ord , Ord , Ord , Ord { fn compare :: x y { compare x.0 y.0 <> compare x.1 y.1 <> compare x.2 y.2 <> compare x.3 y.3 <> compare x.4 y.4 <> compare x.5 y.5 <> compare x.6 y.6 <> compare x.7 y.7 } } impl Show<(a, b, c, d, e, f, g, h)> where Show , Show , Show , Show , Show , Show , Show , Show { fn show :: x { "(" <> show x.0 <> ", " <> show x.1 <> ", " <> show x.2 <> ", " <> show x.3 <> ", " <> show x.4 <> ", " <> show x.5 <> ", " <> show x.6 <> ", " <> show x.7 <> ")" } } impl Debug<(a, b, c, d, e, f, g, h)> where Debug , Debug , Debug , Debug , Debug , Debug , Debug , Debug { fn debug :: x { "(" <> debug x.0 <> ", " <> debug x.1 <> ", " <> debug x.2 <> ", " <> debug x.3 <> ", " <> debug x.4 <> ", " <> debug x.5 <> ", " <> debug x.6 <> ", " <> debug x.7 <> ")" } } impl Hash<(a, b, c, d, e, f, g, h)> where Hash , Hash , Hash , Hash , Hash , Hash , Hash , Hash { fn hash :: x { hash_combine ( hash_combine ( hash_combine ( hash_combine ( hash_combine ( hash_combine (hash_combine (hash_combine 0 (hash x.0)) (hash x.1)) (hash x.2) ) (hash x.3) ) (hash x.4) ) (hash x.5) ) (hash x.6) ) (hash x.7) } } impl Default<(a, b, c, d, e, f, g, h)> where Default , Default , Default , Default , Default , Default , Default , Default { fn default :: { ( default () , default () , default () , default () , default () , default () , default () , default () ) } } impl Eq<(a, b, c, d, e, f, g, h, i)> where Eq , Eq , Eq , Eq , Eq , Eq , Eq , Eq , Eq { fn eq :: x y { x.0 == y.0 && x.1 == y.1 && x.2 == y.2 && x.3 == y.3 && x.4 == y.4 && x.5 == y.5 && x.6 == y.6 && x.7 == y.7 && x.8 == y.8 } } impl Ord<(a, b, c, d, e, f, g, h, i)> where Ord , Ord , Ord , Ord , Ord , Ord , Ord , Ord , Ord { fn compare :: x y { compare x.0 y.0 <> compare x.1 y.1 <> compare x.2 y.2 <> compare x.3 y.3 <> compare x.4 y.4 <> compare x.5 y.5 <> compare x.6 y.6 <> compare x.7 y.7 <> compare x.8 y.8 } } impl Show<(a, b, c, d, e, f, g, h, i)> where Show , Show , Show , Show , Show , Show , Show , Show , Show { fn show :: x { "(" <> show x.0 <> ", " <> show x.1 <> ", " <> show x.2 <> ", " <> show x.3 <> ", " <> show x.4 <> ", " <> show x.5 <> ", " <> show x.6 <> ", " <> show x.7 <> ", " <> show x.8 <> ")" } } impl Debug<(a, b, c, d, e, f, g, h, i)> where Debug , Debug , Debug , Debug , Debug , Debug , Debug , Debug , Debug { fn debug :: x { "(" <> debug x.0 <> ", " <> debug x.1 <> ", " <> debug x.2 <> ", " <> debug x.3 <> ", " <> debug x.4 <> ", " <> debug x.5 <> ", " <> debug x.6 <> ", " <> debug x.7 <> ", " <> debug x.8 <> ")" } } impl Hash<(a, b, c, d, e, f, g, h, i)> where Hash , Hash , Hash , Hash , Hash , Hash , Hash , Hash , Hash { fn hash :: x { hash_combine ( hash_combine ( hash_combine ( hash_combine ( hash_combine ( hash_combine ( hash_combine ( hash_combine (hash_combine 0 (hash x.0)) (hash x.1) ) (hash x.2) ) (hash x.3) ) (hash x.4) ) (hash x.5) ) (hash x.6) ) (hash x.7) ) (hash x.8) } } impl Default<(a, b, c, d, e, f, g, h, i)> where Default , Default , Default , Default , Default , Default , Default , Default , Default { fn default :: { ( default () , default () , default () , default () , default () , default () , default () , default () , default () ) } } impl Eq<(a, b, c, d, e, f, g, h, i, j)> where Eq , Eq , Eq , Eq , Eq , Eq , Eq , Eq , Eq , Eq { fn eq :: x y { x.0 == y.0 && x.1 == y.1 && x.2 == y.2 && x.3 == y.3 && x.4 == y.4 && x.5 == y.5 && x.6 == y.6 && x.7 == y.7 && x.8 == y.8 && x.9 == y.9 } } impl Ord<(a, b, c, d, e, f, g, h, i, j)> where Ord , Ord , Ord , Ord , Ord , Ord , Ord , Ord , Ord , Ord { fn compare :: x y { compare x.0 y.0 <> compare x.1 y.1 <> compare x.2 y.2 <> compare x.3 y.3 <> compare x.4 y.4 <> compare x.5 y.5 <> compare x.6 y.6 <> compare x.7 y.7 <> compare x.8 y.8 <> compare x.9 y.9 } } impl Show<(a, b, c, d, e, f, g, h, i, j)> where Show , Show , Show , Show , Show , Show , Show , Show , Show , Show { fn show :: x { "(" <> show x.0 <> ", " <> show x.1 <> ", " <> show x.2 <> ", " <> show x.3 <> ", " <> show x.4 <> ", " <> show x.5 <> ", " <> show x.6 <> ", " <> show x.7 <> ", " <> show x.8 <> ", " <> show x.9 <> ")" } } impl Debug<(a, b, c, d, e, f, g, h, i, j)> where Debug , Debug , Debug , Debug , Debug , Debug , Debug , Debug , Debug , Debug { fn debug :: x { "(" <> debug x.0 <> ", " <> debug x.1 <> ", " <> debug x.2 <> ", " <> debug x.3 <> ", " <> debug x.4 <> ", " <> debug x.5 <> ", " <> debug x.6 <> ", " <> debug x.7 <> ", " <> debug x.8 <> ", " <> debug x.9 <> ")" } } impl Hash<(a, b, c, d, e, f, g, h, i, j)> where Hash , Hash , Hash , Hash , Hash , Hash , Hash , Hash , Hash , Hash { fn hash :: x { hash_combine ( hash_combine ( hash_combine ( hash_combine ( hash_combine ( hash_combine ( hash_combine ( hash_combine ( hash_combine (hash_combine 0 (hash x.0)) (hash x.1) ) (hash x.2) ) (hash x.3) ) (hash x.4) ) (hash x.5) ) (hash x.6) ) (hash x.7) ) (hash x.8) ) (hash x.9) } } impl Default<(a, b, c, d, e, f, g, h, i, j)> where Default , Default , Default , Default , Default , Default , Default , Default , Default , Default { fn default :: { ( default () , default () , default () , default () , default () , default () , default () , default () , default () , default () ) } } impl Eq<(a, b, c, d, e, f, g, h, i, j, k)> where Eq , Eq , Eq , Eq , Eq , Eq , Eq , Eq , Eq , Eq , Eq { fn eq :: x y { x.0 == y.0 && x.1 == y.1 && x.2 == y.2 && x.3 == y.3 && x.4 == y.4 && x.5 == y.5 && x.6 == y.6 && x.7 == y.7 && x.8 == y.8 && x.9 == y.9 && x.10 == y.10 } } impl Ord<(a, b, c, d, e, f, g, h, i, j, k)> where Ord , Ord , Ord , Ord , Ord , Ord , Ord , Ord , Ord , Ord , Ord { fn compare :: x y { compare x.0 y.0 <> compare x.1 y.1 <> compare x.2 y.2 <> compare x.3 y.3 <> compare x.4 y.4 <> compare x.5 y.5 <> compare x.6 y.6 <> compare x.7 y.7 <> compare x.8 y.8 <> compare x.9 y.9 <> compare x.10 y.10 } } impl Show<(a, b, c, d, e, f, g, h, i, j, k)> where Show , Show , Show , Show , Show , Show , Show , Show , Show , Show , Show { fn show :: x { "(" <> show x.0 <> ", " <> show x.1 <> ", " <> show x.2 <> ", " <> show x.3 <> ", " <> show x.4 <> ", " <> show x.5 <> ", " <> show x.6 <> ", " <> show x.7 <> ", " <> show x.8 <> ", " <> show x.9 <> ", " <> show x.10 <> ")" } } impl Debug<(a, b, c, d, e, f, g, h, i, j, k)> where Debug , Debug , Debug , Debug , Debug , Debug , Debug , Debug , Debug , Debug , Debug { fn debug :: x { "(" <> debug x.0 <> ", " <> debug x.1 <> ", " <> debug x.2 <> ", " <> debug x.3 <> ", " <> debug x.4 <> ", " <> debug x.5 <> ", " <> debug x.6 <> ", " <> debug x.7 <> ", " <> debug x.8 <> ", " <> debug x.9 <> ", " <> debug x.10 <> ")" } } impl Hash<(a, b, c, d, e, f, g, h, i, j, k)> where Hash , Hash , Hash , Hash , Hash , Hash , Hash , Hash , Hash , Hash , Hash { fn hash :: x { hash_combine ( hash_combine ( hash_combine ( hash_combine ( hash_combine ( hash_combine ( hash_combine ( hash_combine ( hash_combine ( hash_combine (hash_combine 0 (hash x.0)) (hash x.1) ) (hash x.2) ) (hash x.3) ) (hash x.4) ) (hash x.5) ) (hash x.6) ) (hash x.7) ) (hash x.8) ) (hash x.9) ) (hash x.10) } } impl Default<(a, b, c, d, e, f, g, h, i, j, k)> where Default , Default , Default , Default , Default , Default , Default , Default , Default , Default , Default { fn default :: { ( default () , default () , default () , default () , default () , default () , default () , default () , default () , default () , default () ) } } impl Eq<(a, b, c, d, e, f, g, h, i, j, k, l)> where Eq , Eq , Eq , Eq , Eq , Eq , Eq , Eq , Eq , Eq , Eq , Eq { fn eq :: x y { x.0 == y.0 && x.1 == y.1 && x.2 == y.2 && x.3 == y.3 && x.4 == y.4 && x.5 == y.5 && x.6 == y.6 && x.7 == y.7 && x.8 == y.8 && x.9 == y.9 && x.10 == y.10 && x.11 == y.11 } } impl Ord<(a, b, c, d, e, f, g, h, i, j, k, l)> where Ord , Ord , Ord , Ord , Ord , Ord , Ord , Ord , Ord , Ord , Ord , Ord { fn compare :: x y { compare x.0 y.0 <> compare x.1 y.1 <> compare x.2 y.2 <> compare x.3 y.3 <> compare x.4 y.4 <> compare x.5 y.5 <> compare x.6 y.6 <> compare x.7 y.7 <> compare x.8 y.8 <> compare x.9 y.9 <> compare x.10 y.10 <> compare x.11 y.11 } } impl Show<(a, b, c, d, e, f, g, h, i, j, k, l)> where Show , Show , Show , Show , Show , Show , Show , Show , Show , Show , Show , Show { fn show :: x { "(" <> show x.0 <> ", " <> show x.1 <> ", " <> show x.2 <> ", " <> show x.3 <> ", " <> show x.4 <> ", " <> show x.5 <> ", " <> show x.6 <> ", " <> show x.7 <> ", " <> show x.8 <> ", " <> show x.9 <> ", " <> show x.10 <> ", " <> show x.11 <> ")" } } impl Debug<(a, b, c, d, e, f, g, h, i, j, k, l)> where Debug , Debug , Debug , Debug , Debug , Debug , Debug , Debug , Debug , Debug , Debug , Debug { fn debug :: x { "(" <> debug x.0 <> ", " <> debug x.1 <> ", " <> debug x.2 <> ", " <> debug x.3 <> ", " <> debug x.4 <> ", " <> debug x.5 <> ", " <> debug x.6 <> ", " <> debug x.7 <> ", " <> debug x.8 <> ", " <> debug x.9 <> ", " <> debug x.10 <> ", " <> debug x.11 <> ")" } } impl Hash<(a, b, c, d, e, f, g, h, i, j, k, l)> where Hash , Hash , Hash , Hash , Hash , Hash , Hash , Hash , Hash , Hash , Hash , Hash { fn hash :: x { hash_combine ( hash_combine ( hash_combine ( hash_combine ( hash_combine ( hash_combine ( hash_combine ( hash_combine ( hash_combine ( hash_combine ( hash_combine (hash_combine 0 (hash x.0)) (hash x.1) ) (hash x.2) ) (hash x.3) ) (hash x.4) ) (hash x.5) ) (hash x.6) ) (hash x.7) ) (hash x.8) ) (hash x.9) ) (hash x.10) ) (hash x.11) } } impl Default<(a, b, c, d, e, f, g, h, i, j, k, l)> where Default , Default , Default , Default , Default , Default , Default , Default , Default , Default , Default , Default { fn default :: { ( default () , default () , default () , default () , default () , default () , default () , default () , default () , default () , default () , default () ) } } // --- end of the generated tuple impls ---