# Initial release of VS Code extension: Elm Module Explorer

**URL:** <https://discourse.elm-lang.org/t/initial-release-of-vs-code-extension-elm-module-explorer/8060>\
**Category:** Request Feedback\
**Created:** [January 8, 2022, 5:00pm UTC](https://discourse.elm-lang.org/t/initial-release-of-vs-code-extension-elm-module-explorer/8060 "2022-01-08T17:00:38Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![john\_s](https://yyz1.discourse-cdn.com/flex035/user_avatar/discourse.elm-lang.org/john_s/32/4425_2.png) [@john\_s](https://discourse.elm-lang.org/u/john_s)\
**Post date:** [January 8, 2022, 5:00pm UTC](https://discourse.elm-lang.org/t/initial-release-of-vs-code-extension-elm-module-explorer/8060/1 "2022-01-08T17:00:38Z")

</div>

Hello everyone!

I just released the first iteration of a VS Code extension presenting a _type oriented_ tree view of functions for the _currently open file_. In addition to organizing by type, it also attempts to classify the use of the type in each function as (Input | Output | InputOutput | Referenced), and uses (+/-) to indicate whether the function is exposed. The plugin should be fast and responsive.

The extension can either be installed directly from within VS code or from the [Visual Studio Marketplace](https://marketplace.visualstudio.com/items?itemName=jjsuder.elm-module-explorer).

If you use VS Code and think this might satisfy some need you have, then I would really appreciate feedback! Please do note that this extension is not attempting to replicate a “hoogle-like” experience as that is already covered by a plugin from another author (the name of that plugin is `elm-signature`).

Thanks

---

<div class="post-metadata">

**Author:** ![Dmitry\_Yakimov](https://yyz1.discourse-cdn.com/flex035/user_avatar/discourse.elm-lang.org/dmitry_yakimov/32/3357_2.png) [@Dmitry\_Yakimov](https://discourse.elm-lang.org/u/Dmitry_Yakimov)\
**Post date:** [January 10, 2022, 8:02pm UTC](https://discourse.elm-lang.org/t/initial-release-of-vs-code-extension-elm-module-explorer/8060/2 "2022-01-10T20:02:49Z")

</div>

Very useful thing, thank you! For big files with many types it will be useful to just make list of data and list of all functions in alphabetical order for fast navigation

---

<div class="post-metadata">

**Author:** ![Jan\_Hrcek](https://yyz1.discourse-cdn.com/flex035/user_avatar/discourse.elm-lang.org/jan_hrcek/32/451_2.png) [@Jan\_Hrcek](https://discourse.elm-lang.org/u/Jan_Hrcek)\
**Post date:** [January 12, 2022, 5:09am UTC](https://discourse.elm-lang.org/t/initial-release-of-vs-code-extension-elm-module-explorer/8060/3 "2022-01-12T05:09:19Z")

</div>

Really nice extension!  
I tried it on our codebase and it works great 😃

I just want to comment on the overview page

> **[Elm Module Explorer - Visual Studio Marketplace](https://marketplace.visualstudio.com/items?itemName=jjsuder.elm-module-explorer)**
>
> Extension for Visual Studio Code - Visualize functions related to types declared in the current Elm module.

what you call “truly dizzying” is in fact known as positive/negative argument position.  
[This article](https://www.fpcomplete.com/blog/2016/11/covariance-contravariance/) which explains it nicely. Although it’s using haskell to explain it, I just thought I’d mention it in case you’d want to incorporate some less hand-wavy explanation in the description.

---

<div class="post-metadata">

**Author:** ![john\_s](https://yyz1.discourse-cdn.com/flex035/user_avatar/discourse.elm-lang.org/john_s/32/4425_2.png) [@john\_s](https://discourse.elm-lang.org/u/john_s)\
**Post date:** [January 12, 2022, 12:36pm UTC](https://discourse.elm-lang.org/t/initial-release-of-vs-code-extension-elm-module-explorer/8060/4 "2022-01-12T12:36:38Z")

</div>

Thank you so much for the positive feedback! Thank you even more for the article on Covariance and Contravariance and the specific formulation in terms of positive and negative position. I was already familiar with covariance and contravariance from work in Scala and C#, but I’ve not seen such a nice description of positive and negative positions.

I would like your opinion on two different topics if you are willing to consider.

## Potentially Useless Distinction

- In `(Int -> Widget)`, the type `Widget` is in a **positive** position; covariant if widget were a type argument.
- In `(Widget -> Int)`, the type `Widget` is in a **negative** position; contravariant if a type argument.
- In `((Widget -> Int) -> Int)`, the type `Widget` is in a **positive** position because the function will clearly produce a Widget. However, in this example Widget is produced _internally_ by the function i.e. consumers of the function do not explicitly apply a Widget as an argument to this function. In this case the extension will label Widget as _referenced_ rather than as either _input_ or _output_. I speculated this could be a useful distinction when thinking about how functions and types relate from a consuming point of view (whereas I tend to think of covariance and contravariance in terms of _type assignability_ and _generalization_). Do you think this third category of referenced is a useless distinction? Perhaps it would be better to only classify types as covariant and contravariant because that is better understood by the community?

## Potentially Insulting or Underestimating Description

I did not make a formal reference to covariance and contravariance because

1. I was using a slightly different distinction.
2. I didn’t want to use “scary” language. I’ve noticed that the Elm community can sometimes avoid computer science / math terms in order to make the concepts more approachable (as opposed to PureScript which embraces categories). I was trying to do the same thing in avoiding covariance and contravariance, but perhaps that was just insulting? I should probably at least mention the topic.

---

<div class="post-metadata">

**Author:** ![Jan\_Hrcek](https://yyz1.discourse-cdn.com/flex035/user_avatar/discourse.elm-lang.org/jan_hrcek/32/451_2.png) [@Jan\_Hrcek](https://discourse.elm-lang.org/u/Jan_Hrcek)\
**Post date:** [January 12, 2022, 1:54pm UTC](https://discourse.elm-lang.org/t/initial-release-of-vs-code-extension-elm-module-explorer/8060/5 "2022-01-12T13:54:01Z")

</div>

> [@john\_s](#):
>
> Do you think this third category of referenced is a useless distinction?

I’m not sure how I would use such distinction in your tool’s output, but for me it would feel confusing  
if you classified types like `(Widget -> Int) -> Int` into either of the first two, so it makes sense to keep it. Not to mention that you can have weird types with even more nesting (however rare this kind of situation might be) like `((Widget -> Int) -> Int) -> Int` where Widget is again in negative position.

> [@john\_s](#):
>
> Elm community can sometimes avoid computer science / math terms in order to make the concepts more approachable

For this reason I was hesitating if I should post my comment 🙂 From my point of view you can still keep the beginner friendly explanation and just mention some external resource for those who want to learn more about these concepts. Unfortunately I don’t know of a good language-independent place describing positive/negative argument concepts 😕

---

<div class="post-metadata">

**Author:** ![Laurent](https://yyz1.discourse-cdn.com/flex035/user_avatar/discourse.elm-lang.org/laurent/32/5725_2.png) [@Laurent](https://discourse.elm-lang.org/u/Laurent)\
**Post date:** [January 13, 2022, 11:07am UTC](https://discourse.elm-lang.org/t/initial-release-of-vs-code-extension-elm-module-explorer/8060/6 "2022-01-13T11:07:47Z")

</div>

Nice to have extension 🙂 A fold/unfold toggle button would be useful I think.

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex035/uploads/elm_lang/original/1X/50a05e53677a2c3b47776d7abd0f113eb50193a1.png) [@system](https://discourse.elm-lang.org/u/system)\
**Post date:** [January 23, 2022, 11:08am UTC](https://discourse.elm-lang.org/t/initial-release-of-vs-code-extension-elm-module-explorer/8060/7 "2022-01-23T11:08:44Z")

</div>

Closed on January 23, 2022, 11:08am UTC

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