【文件属性】:
文件名称:GADTFormat:在OCaml中使用GADT的类型安全格式
文件大小:3KB
文件格式:ZIP
更新时间:2021-05-13 22:10:10
format ocaml gadt OCaml
GADT格式
在OCaml中使用GADT的类型安全格式
例子
open GADTFormat
(* "Digit: %d%s" *)
let fs0 r = lit " Digit: " @@ dig @@ str r
(* fs1 : int -> string -> string *)
let fs1 = sprintf @@ to_str fs0
(*
append format string:
"Digit: %d%s, Digit: %d%s"
*)
let fs2 r = fs0 @@ lit " , " @@ fs0 r
(* fs3 : int -> string -> int -> string -> string *)
let fs3 = printf @@ to_out fs2
let _ =
print_endline @@ fs1 3 " c "
【文件预览】:
GADTFormat-master
----.gitignore(233B)
----_tags(20B)
----README.md(566B)
----GADTFormat.ml(914B)
----LICENSE(1KB)
----Makefile(413B)
----.merlin(20B)
----main.ml(393B)