2 | import Prelude.Basics
16 | interface Cast from to where
20 | cast : (orig : from) -> to
29 | Cast Int String where
30 | cast = prim__cast_IntString
33 | Cast Integer String where
34 | cast = prim__cast_IntegerString
37 | Cast Char String where
38 | cast = prim__cast_CharString
41 | Cast Double String where
42 | cast = prim__cast_DoubleString
45 | Cast Nat String where
46 | cast = cast . natToInteger
49 | Cast Int8 String where
50 | cast = prim__cast_Int8String
53 | Cast Int16 String where
54 | cast = prim__cast_Int16String
57 | Cast Int32 String where
58 | cast = prim__cast_Int32String
61 | Cast Int64 String where
62 | cast = prim__cast_Int64String
65 | Cast Bits8 String where
66 | cast = prim__cast_Bits8String
69 | Cast Bits16 String where
70 | cast = prim__cast_Bits16String
73 | Cast Bits32 String where
74 | cast = prim__cast_Bits32String
77 | Cast Bits64 String where
78 | cast = prim__cast_Bits64String
83 | Cast Int Integer where
84 | cast = prim__cast_IntInteger
87 | Cast Char Integer where
88 | cast = prim__cast_CharInteger
91 | Cast Double Integer where
92 | cast = prim__cast_DoubleInteger
95 | Cast String Integer where
96 | cast = prim__cast_StringInteger
99 | Cast Nat Integer where
100 | cast = natToInteger
103 | Cast Bits8 Integer where
104 | cast = prim__cast_Bits8Integer
107 | Cast Bits16 Integer where
108 | cast = prim__cast_Bits16Integer
111 | Cast Bits32 Integer where
112 | cast = prim__cast_Bits32Integer
115 | Cast Bits64 Integer where
116 | cast = prim__cast_Bits64Integer
119 | Cast Int8 Integer where
120 | cast = prim__cast_Int8Integer
123 | Cast Int16 Integer where
124 | cast = prim__cast_Int16Integer
127 | Cast Int32 Integer where
128 | cast = prim__cast_Int32Integer
131 | Cast Int64 Integer where
132 | cast = prim__cast_Int64Integer
137 | Cast Integer Int where
138 | cast = prim__cast_IntegerInt
141 | Cast Char Int where
142 | cast = prim__cast_CharInt
145 | Cast Double Int where
146 | cast = prim__cast_DoubleInt
149 | Cast String Int where
150 | cast = prim__cast_StringInt
154 | cast = fromInteger . natToInteger
157 | Cast Bits8 Int where
158 | cast = prim__cast_Bits8Int
161 | Cast Bits16 Int where
162 | cast = prim__cast_Bits16Int
165 | Cast Bits32 Int where
166 | cast = prim__cast_Bits32Int
169 | Cast Bits64 Int where
170 | cast = prim__cast_Bits64Int
173 | Cast Int8 Int where
174 | cast = prim__cast_Int8Int
177 | Cast Int16 Int where
178 | cast = prim__cast_Int16Int
181 | Cast Int32 Int where
182 | cast = prim__cast_Int32Int
185 | Cast Int64 Int where
186 | cast = prim__cast_Int64Int
191 | Cast Int Char where
192 | cast = prim__cast_IntChar
195 | Cast Integer Char where
196 | cast = prim__cast_IntegerChar
199 | Cast Nat Char where
200 | cast = cast . natToInteger
203 | Cast Bits8 Char where
204 | cast = prim__cast_Bits8Char
207 | Cast Bits16 Char where
208 | cast = prim__cast_Bits16Char
211 | Cast Bits32 Char where
212 | cast = prim__cast_Bits32Char
215 | Cast Bits64 Char where
216 | cast = prim__cast_Bits64Char
219 | Cast Int8 Char where
220 | cast = prim__cast_Int8Char
223 | Cast Int16 Char where
224 | cast = prim__cast_Int16Char
227 | Cast Int32 Char where
228 | cast = prim__cast_Int32Char
231 | Cast Int64 Char where
232 | cast = prim__cast_Int64Char
237 | Cast Int Double where
238 | cast = prim__cast_IntDouble
241 | Cast Integer Double where
242 | cast = prim__cast_IntegerDouble
245 | Cast String Double where
246 | cast = prim__cast_StringDouble
249 | Cast Nat Double where
250 | cast = prim__cast_IntegerDouble . natToInteger
253 | Cast Bits8 Double where
254 | cast = prim__cast_Bits8Double
257 | Cast Bits16 Double where
258 | cast = prim__cast_Bits16Double
261 | Cast Bits32 Double where
262 | cast = prim__cast_Bits32Double
265 | Cast Bits64 Double where
266 | cast = prim__cast_Bits64Double
269 | Cast Int8 Double where
270 | cast = prim__cast_Int8Double
273 | Cast Int16 Double where
274 | cast = prim__cast_Int16Double
277 | Cast Int32 Double where
278 | cast = prim__cast_Int32Double
281 | Cast Int64 Double where
282 | cast = prim__cast_Int64Double
288 | Cast Int Bits8 where
289 | cast = prim__cast_IntBits8
292 | Cast Integer Bits8 where
293 | cast = prim__cast_IntegerBits8
296 | Cast Bits16 Bits8 where
297 | cast = prim__cast_Bits16Bits8
300 | Cast Bits32 Bits8 where
301 | cast = prim__cast_Bits32Bits8
304 | Cast Bits64 Bits8 where
305 | cast = prim__cast_Bits64Bits8
308 | Cast String Bits8 where
309 | cast = prim__cast_StringBits8
312 | Cast Double Bits8 where
313 | cast = prim__cast_DoubleBits8
316 | Cast Char Bits8 where
317 | cast = prim__cast_CharBits8
320 | Cast Nat Bits8 where
321 | cast = cast . natToInteger
324 | Cast Int8 Bits8 where
325 | cast = prim__cast_Int8Bits8
328 | Cast Int16 Bits8 where
329 | cast = prim__cast_Int16Bits8
332 | Cast Int32 Bits8 where
333 | cast = prim__cast_Int32Bits8
336 | Cast Int64 Bits8 where
337 | cast = prim__cast_Int64Bits8
343 | Cast Int Bits16 where
344 | cast = prim__cast_IntBits16
347 | Cast Integer Bits16 where
348 | cast = prim__cast_IntegerBits16
351 | Cast Bits8 Bits16 where
352 | cast = prim__cast_Bits8Bits16
355 | Cast Bits32 Bits16 where
356 | cast = prim__cast_Bits32Bits16
359 | Cast Bits64 Bits16 where
360 | cast = prim__cast_Bits64Bits16
363 | Cast String Bits16 where
364 | cast = prim__cast_StringBits16
367 | Cast Double Bits16 where
368 | cast = prim__cast_DoubleBits16
371 | Cast Char Bits16 where
372 | cast = prim__cast_CharBits16
375 | Cast Nat Bits16 where
376 | cast = cast . natToInteger
379 | Cast Int8 Bits16 where
380 | cast = prim__cast_Int8Bits16
383 | Cast Int16 Bits16 where
384 | cast = prim__cast_Int16Bits16
387 | Cast Int32 Bits16 where
388 | cast = prim__cast_Int32Bits16
391 | Cast Int64 Bits16 where
392 | cast = prim__cast_Int64Bits16
398 | Cast Int Bits32 where
399 | cast = prim__cast_IntBits32
402 | Cast Integer Bits32 where
403 | cast = prim__cast_IntegerBits32
406 | Cast Bits8 Bits32 where
407 | cast = prim__cast_Bits8Bits32
410 | Cast Bits16 Bits32 where
411 | cast = prim__cast_Bits16Bits32
414 | Cast Bits64 Bits32 where
415 | cast = prim__cast_Bits64Bits32
418 | Cast String Bits32 where
419 | cast = prim__cast_StringBits32
422 | Cast Double Bits32 where
423 | cast = prim__cast_DoubleBits32
426 | Cast Char Bits32 where
427 | cast = prim__cast_CharBits32
430 | Cast Nat Bits32 where
431 | cast = cast . natToInteger
434 | Cast Int8 Bits32 where
435 | cast = prim__cast_Int8Bits32
438 | Cast Int16 Bits32 where
439 | cast = prim__cast_Int16Bits32
442 | Cast Int32 Bits32 where
443 | cast = prim__cast_Int32Bits32
446 | Cast Int64 Bits32 where
447 | cast = prim__cast_Int64Bits32
452 | Cast Int Bits64 where
453 | cast = prim__cast_IntBits64
456 | Cast Integer Bits64 where
457 | cast = prim__cast_IntegerBits64
460 | Cast Bits8 Bits64 where
461 | cast = prim__cast_Bits8Bits64
464 | Cast Bits16 Bits64 where
465 | cast = prim__cast_Bits16Bits64
468 | Cast Bits32 Bits64 where
469 | cast = prim__cast_Bits32Bits64
472 | Cast String Bits64 where
473 | cast = prim__cast_StringBits64
476 | Cast Double Bits64 where
477 | cast = prim__cast_DoubleBits64
480 | Cast Char Bits64 where
481 | cast = prim__cast_CharBits64
484 | Cast Nat Bits64 where
485 | cast = cast . natToInteger
488 | Cast Int8 Bits64 where
489 | cast = prim__cast_Int8Bits64
492 | Cast Int16 Bits64 where
493 | cast = prim__cast_Int16Bits64
496 | Cast Int32 Bits64 where
497 | cast = prim__cast_Int32Bits64
500 | Cast Int64 Bits64 where
501 | cast = prim__cast_Int64Bits64
506 | Cast String Int8 where
507 | cast = prim__cast_StringInt8
510 | Cast Double Int8 where
511 | cast = prim__cast_DoubleInt8
514 | Cast Char Int8 where
515 | cast = prim__cast_CharInt8
518 | Cast Int Int8 where
519 | cast = prim__cast_IntInt8
522 | Cast Integer Int8 where
523 | cast = prim__cast_IntegerInt8
526 | Cast Nat Int8 where
527 | cast = cast . natToInteger
530 | Cast Bits8 Int8 where
531 | cast = prim__cast_Bits8Int8
534 | Cast Bits16 Int8 where
535 | cast = prim__cast_Bits16Int8
538 | Cast Bits32 Int8 where
539 | cast = prim__cast_Bits32Int8
542 | Cast Bits64 Int8 where
543 | cast = prim__cast_Bits64Int8
546 | Cast Int16 Int8 where
547 | cast = prim__cast_Int16Int8
550 | Cast Int32 Int8 where
551 | cast = prim__cast_Int32Int8
554 | Cast Int64 Int8 where
555 | cast = prim__cast_Int64Int8
560 | Cast String Int16 where
561 | cast = prim__cast_StringInt16
564 | Cast Double Int16 where
565 | cast = prim__cast_DoubleInt16
568 | Cast Char Int16 where
569 | cast = prim__cast_CharInt16
572 | Cast Int Int16 where
573 | cast = prim__cast_IntInt16
576 | Cast Integer Int16 where
577 | cast = prim__cast_IntegerInt16
580 | Cast Nat Int16 where
581 | cast = cast . natToInteger
584 | Cast Bits8 Int16 where
585 | cast = prim__cast_Bits8Int16
588 | Cast Bits16 Int16 where
589 | cast = prim__cast_Bits16Int16
592 | Cast Bits32 Int16 where
593 | cast = prim__cast_Bits32Int16
596 | Cast Bits64 Int16 where
597 | cast = prim__cast_Bits64Int16
600 | Cast Int8 Int16 where
601 | cast = prim__cast_Int8Int16
604 | Cast Int32 Int16 where
605 | cast = prim__cast_Int32Int16
608 | Cast Int64 Int16 where
609 | cast = prim__cast_Int64Int16
614 | Cast String Int32 where
615 | cast = prim__cast_StringInt32
618 | Cast Double Int32 where
619 | cast = prim__cast_DoubleInt32
622 | Cast Char Int32 where
623 | cast = prim__cast_CharInt32
626 | Cast Int Int32 where
627 | cast = prim__cast_IntInt32
630 | Cast Integer Int32 where
631 | cast = prim__cast_IntegerInt32
634 | Cast Nat Int32 where
635 | cast = cast . natToInteger
638 | Cast Bits8 Int32 where
639 | cast = prim__cast_Bits8Int32
642 | Cast Bits16 Int32 where
643 | cast = prim__cast_Bits16Int32
646 | Cast Bits32 Int32 where
647 | cast = prim__cast_Bits32Int32
650 | Cast Bits64 Int32 where
651 | cast = prim__cast_Bits64Int32
654 | Cast Int8 Int32 where
655 | cast = prim__cast_Int8Int32
658 | Cast Int16 Int32 where
659 | cast = prim__cast_Int16Int32
662 | Cast Int64 Int32 where
663 | cast = prim__cast_Int64Int32
668 | Cast String Int64 where
669 | cast = prim__cast_StringInt64
672 | Cast Double Int64 where
673 | cast = prim__cast_DoubleInt64
676 | Cast Char Int64 where
677 | cast = prim__cast_CharInt64
680 | Cast Int Int64 where
681 | cast = prim__cast_IntInt64
684 | Cast Integer Int64 where
685 | cast = prim__cast_IntegerInt64
688 | Cast Nat Int64 where
689 | cast = cast . natToInteger
692 | Cast Bits8 Int64 where
693 | cast = prim__cast_Bits8Int64
696 | Cast Bits16 Int64 where
697 | cast = prim__cast_Bits16Int64
700 | Cast Bits32 Int64 where
701 | cast = prim__cast_Bits32Int64
704 | Cast Bits64 Int64 where
705 | cast = prim__cast_Bits64Int64
708 | Cast Int8 Int64 where
709 | cast = prim__cast_Int8Int64
712 | Cast Int16 Int64 where
713 | cast = prim__cast_Int16Int64
716 | Cast Int32 Int64 where
717 | cast = prim__cast_Int32Int64
722 | Cast String Nat where
723 | cast = integerToNat . cast
726 | Cast Double Nat where
727 | cast = integerToNat . cast
730 | Cast Char Nat where
731 | cast = integerToNat . cast {to = Integer}
735 | cast = integerToNat . cast
738 | Cast Integer Nat where
739 | cast = integerToNat
742 | Cast Bits8 Nat where
743 | cast = integerToNat . cast {to = Integer}
746 | Cast Bits16 Nat where
747 | cast = integerToNat . cast {to = Integer}
750 | Cast Bits32 Nat where
751 | cast = integerToNat . cast {to = Integer}
754 | Cast Bits64 Nat where
755 | cast = integerToNat . cast {to = Integer}
758 | Cast Int8 Nat where
759 | cast = integerToNat . cast
762 | Cast Int16 Nat where
763 | cast = integerToNat . cast
766 | Cast Int32 Nat where
767 | cast = integerToNat . cast
770 | Cast Int64 Nat where
771 | cast = integerToNat . cast