OCaml newbie here - coming from Haskell land out of curiosity.
I’m interested how you guys find your way around stdlib/packages etc?
Example: I’m writing a script and I want to lookup an environment variable. I know there’s probably some function along the lines of
get_env somewhere, so I’d like to know where it is and what type it has. In Haskell I’d do a hoogle search along the lines of https://www.stackage.org/lts-13.18/hoogle?q=getenv - what would be my process in OCaml?
I tried googling “get env var in Ocaml” - first hit is a link to stdlib, but I’m using base. It did at least give me the hint that
Sys is a relevant namespace, so I go and look at the docs for
Base.Sys (many clicks later - https://ocaml.janestreet.com/ocaml-core/latest/doc/base/Base/Sys/index.html) but
getenv isn’t listed. But it is apparently there…
There must be a better way?