You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Alternatively: Lenses and Combinator could become private modules, with their functions being re-exported by the Pathex module. This means the behavior of use Pathex would not need to change and documentation would be consolidated.
zachallaun
changed the title
Suggestion: use Pathex should import everything
Single-line import of core, lenses, and combinator
Feb 15, 2023
Yeah, I've thought about this and I came up with different approaches for this
Leave it all as it is. It is simple, explicit and it reflects how people use the library.
For 90% use cases, you just import Pathex. For 9% of use cases you also import Pathex.Lenses. And only for 1% of use cases import Pathex.Combinator. And even in most cases, one could just call functions from Pathex.Lenses or Pathex.Combinator directly
Move everything to Pathex and suggest using import Pathex.
This would add a lot of complex functions with very generic names. Using only option would be even more verbose
Move everything to use Pathex has the same problem as above
use Pathex, lenses: true, combinator: true. Nice, but this saves only a few characters and is less explicit
Pathex is super neat, but the ergonomics are hampered by having to import 2-3 different modules for even relatively simple uses. This example on the forum, for instance: https://elixirforum.com/t/find-a-specific-string-in-an-unstructured-and-nested-list/53918/10?u=zachallaun
I’d propose that
use Pathex
should be updated to import a much larger set of primitives, including those from combinator, lenses, etc.The text was updated successfully, but these errors were encountered: