@@ -120,6 +120,12 @@ let rec extractType ~env ~package (t : Types.type_expr) =
120
120
| Tconstr (Path. Pident {name = "bool" } , [] , _ ) -> Some (Tbool env)
121
121
| Tconstr (Path. Pident {name = "string" } , [] , _ ) -> Some (Tstring env)
122
122
| Tconstr (Path. Pident {name = "exn" } , [] , _ ) -> Some (Texn env)
123
+ | Tconstr (Pident {name = "function$" } , [t ; _ ], _ ) -> (
124
+ (* Uncurried functions. *)
125
+ match extractFunctionType t ~env ~package with
126
+ | args , _tRet when args <> [] ->
127
+ Some (Tfunction {env; args; typ = t; uncurried = true })
128
+ | _args , _tRet -> None )
123
129
| Tconstr (path , _ , _ ) -> (
124
130
match References. digConstructor ~env ~package path with
125
131
| Some (env , {item = {decl = {type_manifest = Some t1 } } } ) ->
@@ -151,7 +157,8 @@ let rec extractType ~env ~package (t : Types.type_expr) =
151
157
Some (Tpolyvariant {env; constructors; typeExpr = t})
152
158
| Tarrow _ -> (
153
159
match extractFunctionType t ~env ~package with
154
- | args , _tRet when args <> [] -> Some (Tfunction {env; args; typ = t})
160
+ | args , _tRet when args <> [] ->
161
+ Some (Tfunction {env; args; typ = t; uncurried = false })
155
162
| _args , _tRet -> None )
156
163
| _ -> None
157
164
0 commit comments