1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
use crate::*;

document! {
    for ()
        => TypeKind::Tuple {
            fields: Default::default()
        };

    for bool
        => TypeKind::Bool;

    for char
        => TypeKind::String;

    for str
        => TypeKind::String;

    for f32
        => TypeKind::Float;

    for f64
        => TypeKind::Float;

    for u8
        => TypeKind::Integer;

    for i8
        => TypeKind::Integer;

    for u16
        => TypeKind::Integer;

    for i16
        => TypeKind::Integer;

    for u32
        => TypeKind::Integer;

    for i32
        => TypeKind::Integer;

    for u64
        => TypeKind::Integer;

    for i64
        => TypeKind::Integer;

    for u128
        => TypeKind::Integer;

    for i128
        => TypeKind::Integer;

    for usize
        => TypeKind::Integer;

    for isize
        => TypeKind::Integer;

    /* ----- */

    for &T where (T: Document + ?Sized)
        => T::ty();

    for &mut T where (T: Document + ?Sized)
        => T::ty();

    /* ----- */

    for [T; N] where (T: Document, const N: usize)
        => TypeKind::Array {
            ty: Box::new(T::ty()),
            size: Some(N),
        };

    for &[T] where (T: Document)
        => TypeKind::Array {
            ty: Box::new(T::ty()),
            size: None,
        };

    for &mut [T] where (T: Document)
        => <&[T]>::ty();

    /* ----- */

    for (A,) where (A: Document)
        => TypeKind::Tuple {
            fields: vec![A::ty()],
        };

    for (A, B) where (A: Document, B: Document)
        => TypeKind::Tuple {
            fields: vec![A::ty(), B::ty()],
        };

    for (A, B, C) where (A: Document, B: Document, C: Document)
        => TypeKind::Tuple {
            fields: vec![A::ty(), B::ty(), C::ty()],
        };

    for (A, B, C, D) where (A: Document, B: Document, C: Document, D: Document)
        => TypeKind::Tuple {
            fields: vec![A::ty(), B::ty(), C::ty(), D::ty()],
        };

    for (A, B, C, D, E) where (A: Document, B: Document, C: Document, D: Document, E: Document)
        => TypeKind::Tuple {
            fields: vec![A::ty(), B::ty(), C::ty(), D::ty(), E::ty()],
        };

    for (A, B, C, D, E, F) where (A: Document, B: Document, C: Document, D: Document, E: Document, F: Document)
        => TypeKind::Tuple {
            fields: vec![A::ty(), B::ty(), C::ty(), D::ty(), E::ty(), F::ty()],
        };

    for (A, B, C, D, E, F, G) where (A: Document, B: Document, C: Document, D: Document, E: Document, F: Document, G: Document)
        => TypeKind::Tuple {
            fields: vec![A::ty(), B::ty(), C::ty(), D::ty(), E::ty(), F::ty(), G::ty()],
        };

    for (A, B, C, D, E, F, G, H) where (A: Document, B: Document, C: Document, D: Document, E: Document, F: Document, G: Document, H: Document)
        => TypeKind::Tuple {
            fields: vec![A::ty(), B::ty(), C::ty(), D::ty(), E::ty(), F::ty(), G::ty(), H::ty()],
        };

    for (A, B, C, D, E, F, G, H, I) where (A: Document, B: Document, C: Document, D: Document, E: Document, F: Document, G: Document, H: Document, I: Document)
        => TypeKind::Tuple {
            fields: vec![A::ty(), B::ty(), C::ty(), D::ty(), E::ty(), F::ty(), G::ty(), H::ty(), I::ty()],
        };

    for (A, B, C, D, E, F, G, H, I, J) where (A: Document, B: Document, C: Document, D: Document, E: Document, F: Document, G: Document, H: Document, I: Document, J: Document)
        => TypeKind::Tuple {
            fields: vec![A::ty(), B::ty(), C::ty(), D::ty(), E::ty(), F::ty(), G::ty(), H::ty(), I::ty(), J::ty()],
        };
}