2
2
// Please use `import service "ic:canister_id"` instead to call canisters on the IC if possible.
3
3
4
4
module {
5
- public type A = B ;
6
- public type B = ?A ;
5
+ public type my_variant = {
6
+ // / Doc comment for my_variant field a
7
+ #a : {
8
+ // / Doc comment for my_variant field a field b
9
+ b : Text ;
10
+ };
11
+ // / Doc comment for my_variant field c
12
+ #c : ?{
13
+ // / Doc comment for my_variant field c field d
14
+ d : Text ;
15
+ e : [
16
+ {
17
+ // / Doc comment for my_variant field c field e inner vec element
18
+ f : Nat ;
19
+ }
20
+ ];
21
+ };
22
+ };
23
+ // / Doc comment for service id
24
+ public type s = actor { f : t; g : shared list -> async (B , tree, stream) };
7
25
// / Doc comment for List
8
26
public type List = ?{
9
27
// / Doc comment for List head
10
28
head : Int ;
11
29
// / Doc comment for List tail
12
30
tail : List ;
13
31
};
32
+ public type list = ?node;
33
+ public type tree = {
34
+ #branch : { val : Int ; left : tree; right : tree };
35
+ #leaf : Int ;
36
+ };
14
37
public type a = { #a; #b : b };
15
- public type b = (Int , Nat );
16
38
// / Doc comment for broker service
17
39
public type broker = actor {
18
40
find : shared (name : Text ) -> async actor {
19
41
current : shared () -> async Nat32 ;
20
42
up : shared () -> async ();
21
43
};
22
44
};
45
+ public type t = shared (server : s) -> async ();
46
+ // / Doc comment for prim type
47
+ public type my_type = Principal ;
23
48
public type f = shared (List , shared Int32 -> async Int64 ) -> async (
24
49
?List ,
25
50
res,
26
51
);
27
- public type list = ?node;
28
- // / Doc comment for prim type
29
- public type my_type = Principal ;
30
- public type my_variant = {
31
- // / Doc comment for my_variant field a
32
- #a : {
33
- // / Doc comment for my_variant field a field b
34
- b : Text ;
35
- };
36
- // / Doc comment for my_variant field c
37
- #c : ?{
38
- // / Doc comment for my_variant field c field d
39
- d : Text ;
40
- e : [
41
- {
42
- // / Doc comment for my_variant field c field e inner vec element
43
- f : Nat ;
44
- }
45
- ];
46
- };
47
- };
52
+ public type b = (Int , Nat );
53
+ public type stream = ?{ head : Nat ; next : shared query () -> async stream };
54
+ public type A = B ;
48
55
// / Doc comment for nested type
49
56
public type nested = {
50
57
_0_ : Nat ;
@@ -56,14 +63,6 @@ module {
56
63
_41_ : { #_42_ ; #A ; #B ; #C };
57
64
_42_ : Nat ;
58
65
};
59
- // / Doc comment for nested_records
60
- public type nested_records = {
61
- // / Doc comment for nested_records field nested
62
- nested : ?{
63
- // / Doc comment for nested_records field nested_field
64
- nested_field : Text ;
65
- };
66
- };
67
66
public type nested_res = {
68
67
#Ok : { #Ok ; #Err };
69
68
#Err : {
@@ -73,7 +72,15 @@ module {
73
72
#Err : { _0_ : Int };
74
73
};
75
74
};
76
- public type node = { head : Nat ; tail : list };
75
+ // / Doc comment for nested_records
76
+ public type nested_records = {
77
+ // / Doc comment for nested_records field nested
78
+ nested : ?{
79
+ // / Doc comment for nested_records field nested_field
80
+ nested_field : Text ;
81
+ };
82
+ };
83
+ public type B = ?A ;
77
84
// / Doc comment for res type
78
85
public type res = {
79
86
// / Doc comment for Ok variant
@@ -85,14 +92,7 @@ module {
85
92
error : Text ;
86
93
};
87
94
};
88
- // / Doc comment for service id
89
- public type s = actor { f : t; g : shared list -> async (B , tree, stream) };
90
- public type stream = ?{ head : Nat ; next : shared query () -> async stream };
91
- public type t = shared (server : s) -> async ();
92
- public type tree = {
93
- #branch : { val : Int ; left : tree; right : tree };
94
- #leaf : Int ;
95
- };
95
+ public type node = { head : Nat ; tail : list };
96
96
// / Doc comment for service
97
97
public type Self = actor {
98
98
// / Doc comment for f1 method of service
0 commit comments