aantron / lambdasoup

Functional HTML scraping and rewriting with CSS in OCaml
https://aantron.github.io/lambdasoup
MIT License
383 stars 31 forks source link

The ocamlfind library name ("lambdasoup") is different from the name of the main module ("Soup") #17

Closed copy closed 5 years ago

copy commented 6 years ago

This is confusing, especially for newcomers. I believe one could leave the old module name but mark it as deprecated.

aantron commented 6 years ago

Yes, this is a problem due to my inexperience, as it was my first OCaml release :/ Note also the different repo name, but I guess that can be easily changed and GitHub will give a redirect.

I called the main module Soup mainly because I found Lambdasoup and other variants too annoying to type. This suggests renaming the package to soup instead, but I don't like that either. It's also possible to create Lambdasoup as a deprecated module aliasing Soup, but that wouldn't help with the package name being different, as people probably start from the code examples, which use Soup, and then run into the package name problem.

So, I'm not sure what to do here (yet)...

copy commented 6 years ago

I think either naming everything soup or lambdasoup is fine. I don't mind the longer name, and a the shorter name would also require a renaming of the opam package, which is trickier, so I suggested to go with the longer one.

aantron commented 5 years ago

I renamed the repo to lambdasoup, and added a Lambdasoup module. However, Lambdasoup.parse is marked deprecated, with message:

Warning 3: deprecated: Lambdasoup.parse
The module name Lambdasoup is deprecated. Use Soup instead.
copy commented 4 years ago

@aantron Isn't that the wrong way around? (Soup.parse should be deprecated, not Lambdasoup.parse)

aantron commented 4 years ago

I chose to forward the consistent, but longer and unused name to the short, original name that is already in use, so I marked Lambdasoup deprecated. The docs still all use Soup, Lambdasoup is just for catching different usage in this scheme.

copy commented 4 years ago

Makes sense, thanks for clarifying.

I'm hoping that one day this practice will go away across the OCaml ecosystem and installing foo will always give me a module Foo and nothing else, but for now that seems like a reasonable compromise.