@@ -13,7 +13,7 @@ type myty =
13
13
myty_pretty_right ;
14
14
Mkmyty_pretty0 ;
15
15
Mkmyty_pretty1
16
- ] ( entry " _pretty " (` %myty ))
16
+ ] ( entry " myty_pretty " (` %myty ))
17
17
18
18
(* Sanity check *)
19
19
let right ( x : myty ) : r : myty_pretty { myty_pretty_right x == r } =
@@ -32,17 +32,17 @@ type named_ty =
32
32
( named " Case1" (( named " x" int & int) & ( named " y" int & string)))
33
33
( named " Case2" ( named " b" bool))
34
34
35
- // bijection record disabled for now
36
- (*
37
35
%splice [
38
36
named_ty_pretty ;
39
- Case1 ;
40
- Case2 ;
41
- named_ty_pretty_bij;
42
- ] (entry "_pretty " (`%named_ty))
37
+ Mknamed_ty_pretty_Case1 ;
38
+ Mknamed_ty_pretty_Case2 ;
39
+ // named_ty_pretty_bij; // bijection record disabled for now
40
+ ] ( entry " named_ty_pretty " (` %named_ty ))
43
41
44
42
// test bijection
45
43
44
+ // bijection record disabled for now
45
+ (*
46
46
let _ = assert (Inl ((1, 2), (3, "a")) >> named_ty_pretty_bij == Case1 1 2 3 "a")
47
47
let _ = assert (Case2 false << named_ty_pretty_bij == Inr false)
48
48
*)
@@ -51,22 +51,46 @@ let _ = assert (Case2 false << named_ty_pretty_bij == Inr false)
51
51
type can't be called? *)
52
52
// let test (i : named_ty_pretty) =
53
53
// match i with
54
- // | Case1 _ _ _ _ ->
55
- // let _ = Case1 ?.x i in
56
- // let _ = Case1 ?.y i in
54
+ // | Mknamed_ty_pretty_Case1 _ _ _ _ ->
55
+ // let _ = Mknamed_ty_pretty_Case1 ?.x i in
56
+ // let _ = Mknamed_ty_pretty_Case1 ?.y i in
57
57
// ()
58
- // | Case2 _ ->
59
- // let _ = Case2 ?.b i in
58
+ // | Mknamed_ty_pretty_Case2 _ ->
59
+ // let _ = Mknamed_ty_pretty_Case2 ?.b i in
60
60
// ()
61
61
62
+ let test_named_ty1 ( i : named_ty_pretty ) =
63
+ match i with
64
+ | Mknamed_ty_pretty_Case1 _ _ _ _
65
+ | Mknamed_ty_pretty_Case2 _ ->
66
+ ()
67
+
68
+ (* Named test: *)
69
+ type named_ty2 =
70
+ either
71
+ ( named " Case1" (( named " x" int & int) & ( named " y" int & string)))
72
+ ( named " Case2" ( named " b" bool))
73
+
74
+ %splice [
75
+ named_ty2_pretty ;
76
+ Mknamed_ty2_pretty_Case1 ;
77
+ Mknamed_ty2_pretty_Case2 ;
78
+ ] ( entry " named_ty2_pretty" (` %named_ty2 ))
79
+
80
+ let test_named_ty2 ( i : named_ty2_pretty ) =
81
+ match i with
82
+ | Mknamed_ty2_pretty_Case1 _ _ _ _
83
+ | Mknamed_ty2_pretty_Case2 _ ->
84
+ ()
85
+
62
86
type t2 = tuple2 int int
63
- %splice [ t2_pretty ] ( entry " _pretty " (` %t2 ))
87
+ %splice [ t2_pretty ] ( entry " t2_pretty " (` %t2 ))
64
88
65
89
type t3 = tuple2 int ( either bool string)
66
- %splice [ t3_pretty ] ( entry " _pretty " (` %t3 ))
90
+ %splice [ t3_pretty ] ( entry " t3_pretty " (` %t3 ))
67
91
68
92
type t4 = either t3 ( tuple2 int ( either bool string))
69
- %splice [ t4_pretty ; t4_pretty_left_right ] ( entry " _pretty " (` %t4 ))
93
+ %splice [ t4_pretty ; t4_pretty_left_right ] ( entry " t4_pretty " (` %t4 ))
70
94
71
95
let inv ( x : t4 ) = t4_pretty_left_right x
72
96
@@ -79,7 +103,7 @@ type t5 =
79
103
noextract
80
104
noeq (* will only go to the generated type. *)
81
105
unfold
82
- %splice [ t5_quals ; t5_quals_left_right ] ( entry " _quals " (` %t5 ))
106
+ %splice [ t5_quals ; t5_quals_left_right ] ( entry " t5_quals " (` %t5 ))
83
107
84
108
type big =
85
109
either int <|
@@ -126,4 +150,6 @@ type bigger =
126
150
) bool
127
151
128
152
[ @@no_auto_projectors ] // makes it a bit faster
129
- %splice [] ( entry " _pretty" (` %bigger ))
153
+ %splice [ huger ] ( entry " huger" (` %bigger ))
154
+
155
+ let _ = huger
0 commit comments