Mailing list for all users of the OCaml language and system.
 help / color / mirror / Atom feed
* [Caml-list] automatically resolving open?
@ 2025-04-23 14:10 Kenichi Asai
  2025-04-23 14:32 ` Francois Pottier
  2025-04-24  6:39 ` Virgile Prevosto
  0 siblings, 2 replies; 10+ messages in thread
From: Kenichi Asai @ 2025-04-23 14:10 UTC (permalink / raw)
  To: caml-list

Would it be possible to transform an OCaml file to the one that does
not use open?  For example, if I have:

open List
let test = map (fun x -> x + 1) [1; 2; 3]

I want to obtain:

let test = List.map (fun x -> x + 1) [1; 2; 3]

where all the opened identifiers are prefixed with the opened module
names.

ocamlc -dtypedtree appears to produce a typed tree where all the
opened variable references are resolved.  Would it be possible to
transform this typed tree back to a source program?

-- 
Kenichi Asai

^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2025-04-24 13:44 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2025-04-23 14:10 [Caml-list] automatically resolving open? Kenichi Asai
2025-04-23 14:32 ` Francois Pottier
2025-04-23 14:38   ` BOBOT François
2025-04-23 14:45   ` Ivan Gotovchits
2025-04-23 15:33     ` Jeremy Yallop
2025-04-24  4:33   ` Oleg
2025-04-24  6:39 ` Virgile Prevosto
2025-04-24  9:16   ` Ulysse Gérard
2025-04-24 13:06     ` Kenichi Asai
2025-04-24 13:44       ` Ulysse Gérard

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox