@@ -120,6 +120,12 @@ let rec extractType ~env ~package (t : Types.type_expr) =
120120 | Tconstr (Path. Pident {name = "bool" } , [] , _ ) -> Some (Tbool env)
121121 | Tconstr (Path. Pident {name = "string" } , [] , _ ) -> Some (Tstring env)
122122 | 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 )
123129 | Tconstr (path , _ , _ ) -> (
124130 match References. digConstructor ~env ~package path with
125131 | Some (env , {item = {decl = {type_manifest = Some t1 } } } ) ->
@@ -151,7 +157,8 @@ let rec extractType ~env ~package (t : Types.type_expr) =
151157 Some (Tpolyvariant {env; constructors; typeExpr = t})
152158 | Tarrow _ -> (
153159 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 })
155162 | _args , _tRet -> None )
156163 | _ -> None
157164
0 commit comments