Skip to content

Commit

Permalink
rename Caml -> Stdlib
Browse files Browse the repository at this point in the history
Signed-off-by: Kakadu <Kakadu@pm.me>
  • Loading branch information
Kakadu committed Mar 26, 2024
1 parent 4fc91fd commit 786a50e
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 13 deletions.
2 changes: 1 addition & 1 deletion common/HelpersBase.ml
Original file line number Diff line number Diff line change
Expand Up @@ -514,7 +514,7 @@ let notify fmt =
Format.kasprintf
(fun s ->
let _cmd = Printf.sprintf "notify-send \"%s\"" s in
let (_ : int) = Caml.Sys.command _cmd in
let (_ : int) = Stdlib.Sys.command _cmd in
())
fmt
;;
Expand Down
8 changes: 4 additions & 4 deletions common/expander.ml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ open HelpersBase
open Printf
open Naming

let ( @@ ) = Caml.( @@ )
let ( @@ ) = Stdlib.( @@ )

type config_plugin =
| Skip
Expand Down Expand Up @@ -694,7 +694,7 @@ module Make (AstHelpers : GTHELPERS_sig.S) = struct
let n_new = Naming.self_typ_param_name ^ "__new" in
let t2 =
map_core_type acc ~onvar:(fun s ->
(* Caml.Printf.printf "cmp '%s' and '%s' = %b\n%!" s name (String.equal s name ); *)
(* Stdlib.Printf.printf "cmp '%s' and '%s' = %b\n%!" s name (String.equal s name ); *)
if String.equal s name then Some (ptyp_var ~loc n_new) else None)
in
n_new :: ns, t2)
Expand All @@ -720,7 +720,7 @@ module Make (AstHelpers : GTHELPERS_sig.S) = struct
end)

module T = Graph.Topological.Make (G)
module SM = Caml.Map.Make (String)
module SM = Stdlib.Map.Make (String)

let topsort_tdecls tdecls =
(* TODO: we need topological sorting because in case
Expand Down Expand Up @@ -754,7 +754,7 @@ module Make (AstHelpers : GTHELPERS_sig.S) = struct
| None -> acc
| Some s ->
(match SM.find s name_map with
| exception Caml.Not_found -> acc
| exception Stdlib.Not_found -> acc
| _ -> G.add_edge acc s tdecl.ptype_name.txt))
in
let tdecls_new = T.fold (fun s acc -> SM.find s name_map :: acc) g [] |> List.rev in
Expand Down
12 changes: 6 additions & 6 deletions common/plugin.ml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
See {!Plugin_intf} for complete description of all valuable methods
*)

module Format = Caml.Format
module Format = Stdlib.Format
open Ppxlib
open Stdppx
open Printf
Expand All @@ -22,8 +22,8 @@ let use_logging = false

let log fmt =
if use_logging
then Caml.Format.kasprintf (Caml.Format.eprintf "%s\n%!") fmt
else Caml.Format.ifprintf Caml.Format.std_formatter fmt
then Stdlib.Format.kasprintf (Stdlib.Format.eprintf "%s\n%!") fmt
else Stdlib.Format.ifprintf Stdlib.Format.std_formatter fmt
;;

module Make (AstHelpers : GTHELPERS_sig.S) = struct
Expand Down Expand Up @@ -110,8 +110,8 @@ module Make (AstHelpers : GTHELPERS_sig.S) = struct
(* parse arguments like { _1=<expr>; ...; _N=<expr>; ...} *)
val reinterpreted_args =
let check_name s =
try Caml.Scanf.sscanf s "_%d" Option.some with
| Caml.Scanf.Scan_failure _ -> None
try Stdlib.Scanf.sscanf s "_%d" Option.some with
| Stdlib.Scanf.Scan_failure _ -> None
in
List.fold_left initial_args ~init:[] ~f:(fun acc (lident, expr) ->
match lident with
Expand Down Expand Up @@ -956,7 +956,7 @@ module Make (AstHelpers : GTHELPERS_sig.S) = struct
~f:(fun {attr_name={txt}} -> String.equal txt "combinatorial")
in *)
if (* Option.is_some cmb_attr &&*)
Caml.( = ) tdecl.ptype_kind Ptype_abstract
Stdlib.( = ) tdecl.ptype_kind Ptype_abstract
&& (not (is_polyvariant_tdecl tdecl))
&& not (is_tuple_tdecl tdecl)
then (
Expand Down
2 changes: 1 addition & 1 deletion plugins/gmap.ml
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ module Make (AstHelpers : GTHELPERS_sig.S) = struct
let name_migrations = List.zip_exn param_names rez_names in
let assoc s =
try List.Assoc.find_exn ~equal:String.equal name_migrations s with
| Caml.Not_found ->
| Stdlib.Not_found ->
Ppxlib.Location.raise_errorf
~loc:Location.none
"can't find new typ for param `%s"
Expand Down
2 changes: 1 addition & 1 deletion ppx/PpxHelpers.ml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ open GTCommon
open HelpersBase
open Ppxlib.Ast_builder.Default

let ( @@ ) = Caml.( @@ )
let ( @@ ) = Stdlib.( @@ )
let nolabelize xs = List.map ~f:(fun x -> Asttypes.Nolabel, x) xs
let invariantize types = List.map types ~f:(fun x -> x, (NoVariance, NoInjectivity))

Expand Down

0 comments on commit 786a50e

Please sign in to comment.