Search a Module

Is there a way to search somewhere by module name?

As far as I understand, https://package.elm-lang.org/ allows you to search only by package, while https://klaftertief.github.io allows you to search by type.

Is there an option to search by module name?

2 Likes

I’ve also looked for this!

Then I realized I looked for it because I saw a module name in some code and I didn’t know which package it came from. There are other ways of finding that!

  • You can set up your editor so that you can “go to definition” on anything, including things from packages. You can see the package name in the file path.
  • You can search in the installed packages folder (if you know the module must come from an installed package). For example, using ripgrep (assumes a non-Windows environment):
❯ rg '^module Graph\b' ~/.elm/0.19.1/packages/`
/Users/simon/.elm/0.19.1/packages/elm-community/graph/6.0.0/src/Graph/Tree.elm
1:module Graph.Tree exposing

/Users/simon/.elm/0.19.1/packages/elm-community/graph/6.0.0/src/Graph/DOT.elm
1:module Graph.DOT exposing

/Users/simon/.elm/0.19.1/packages/elm-community/graph/6.0.0/src/Graph/TGF.elm
1:module Graph.TGF exposing (output)

/Users/simon/.elm/0.19.1/packages/elm-community/graph/6.0.0/src/Graph.elm
1:module Graph exposing

Maybe those don’t cover the reason you wanted module name search, but in case they do – hope it helps!

1 Like

https://elm.pravdomil.com/packages/ with “Group by” “Module”

4 Likes

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.