on master help sign in
Add compilation burden
e824eb2Denis Redozubov
src/Data/Schematic.hs+72
@@ -37,6 +37,7 @@ import Data.Schematic.Validation
37import Data.Singletons.Prelude hiding ((:.))
37import Data.Singletons.Prelude hiding ((:.))
38import Data.Tagged
38import Data.Tagged
39import Data.Text as T
39import Data.Text as T
40+import Data.Vinyl
40
41
41
42
42parseAndValidateJson
43parseAndValidateJson
@@ -124,3 +125,74 @@ decodeAndValidateVersionedWithPureMList
124 -> ParseResult (JsonRepr (Head (MapSnd (AllVersions versioned))))
125 -> ParseResult (JsonRepr (Head (MapSnd (AllVersions versioned))))
125decodeAndValidateVersionedWithPureMList a b c =
126decodeAndValidateVersionedWithPureMList a b c =
126 runIdentity $ decodeAndValidateVersionedWithMList a b c
127 runIdentity $ decodeAndValidateVersionedWithMList a b c
128+
129+type SText = SchemaText '[]
130+-- type SText = SchemaText '[TRegex "[0-9]+\\.[0-9]{2}"]
131+-- type SEnum = SchemaText '[TEnum '["one", "two", "three"]]
132+
133+type BigSchema = SchemaObject
134+ '[ '("1", SText)
135+ , '("2", SText)
136+ , '("3", SText)
137+ , '("4", SText)
138+ , '("5", SText)
139+ , '("6", SText)
140+ , '("7", SText)
141+ , '("8", SText)
142+ , '("9", SText)
143+ , '("10", SText)
144+ , '("11", SText)
145+ , '("12", SText)
146+ , '("13", SText)
147+ , '("14", SText)
148+ , '("15", SText)
149+ , '("16", SText)
150+ , '("17", SText)
151+ , '("18", SText)
152+ , '("19", SText)
153+ , '("20", SText)
154+ , '("21", SText)
155+ , '("22", SText)
156+ , '("23", SText)
157+ , '("24", SText)
158+ , '("25", SText)
159+ , '("26", SText)
160+ , '("27", SText)
161+ , '("28", SText)
162+ , '("29", SText)
163+ , '("30", SText)
164+ ]
165+
166+bigSchema :: JsonRepr BigSchema
167+bigSchema = withRepr @BigSchema
168+ $ field @"1" ""
169+ :& field @"2" ""
170+ :& field @"3" ""
171+ :& field @"4" ""
172+ :& field @"5" ""
173+ :& field @"6" ""
174+ :& field @"7" ""
175+ :& field @"8" ""
176+ :& field @"9" ""
177+ :& field @"10" ""
178+ :& field @"11" ""
179+ :& field @"12" ""
180+ :& field @"13" ""
181+ :& field @"14" ""
182+ :& field @"15" ""
183+ :& field @"16" ""
184+ :& field @"17" ""
185+ :& field @"18" ""
186+ :& field @"19" ""
187+ :& field @"20" ""
188+ :& field @"21" ""
189+ :& field @"22" ""
190+ :& field @"23" ""
191+ :& field @"24" ""
192+ :& field @"25" ""
193+ :& field @"26" ""
194+ :& field @"27" ""
195+ :& field @"28" ""
196+ :& field @"29" ""
197+ :& field @"30" ""
198+ :& RNil