Add Lib.public_name

This commit is contained in:
Rudi Grinberg 2018-01-30 20:12:38 +08:00
parent ce65e27045
commit 1013db83b5
2 changed files with 6 additions and 0 deletions

View File

@ -101,3 +101,7 @@ let remove_dups_preserve_order libs =
in
loop String_set.empty libs []
;;
let public_name = function
| External pkg -> Some pkg.name
| Internal (_, lib) -> Option.map lib.public ~f:(fun p -> p.name)

View File

@ -33,3 +33,5 @@ val remove_dups_preserve_order : t list -> t list
(*val ppx_runtime_libraries : t list -> String_set.t
*)
val public_name : t -> string option