Stream: ideas

Topic: Exposes vs Exports


view this post on Zulip Luke Boswell (Apr 14 2023 at 09:06):

Just a random thought, I was typing out an Interface module header and accidentally thought it was exports but then realised it is exposes. I wonder if there is a story behind using exposes? I feel like exports is the antonym for imports and would also be a viable option here.

view this post on Zulip Anton (Apr 14 2023 at 09:12):

I wonder if there is a story behind using exposes?

I think we inherited it from exposing in elm. exports could work just as well but I have no real favorite out of those two options.

view this post on Zulip Richard Feldman (Apr 14 2023 at 11:59):

yeah they're different though

view this post on Zulip Richard Feldman (Apr 14 2023 at 12:00):

like in conversations it makes more sense to say "this module doesn't expose that" than "this module doesn't export that"

view this post on Zulip Richard Feldman (Apr 14 2023 at 12:01):

because the key thing about something not being (exposed/exported) is that it's hidden

view this post on Zulip Richard Feldman (Apr 14 2023 at 12:01):

and hidden things are not exposed, but "exported" doesn't really have to do with things being hidden :big_smile:

view this post on Zulip Richard Feldman (Apr 14 2023 at 12:01):

I could see an argument for uses over imports

view this post on Zulip Kevin Gillette (Apr 15 2023 at 01:41):

uses has the nice properties that: 1) it's shorter than imports, and 2) it seems less likely to be useful as an identifier (i.e. imports would be a reasonable name for a List if it weren't already reserved as a keyword).

I do agree with @Luke Boswell that exports is the naturally paired inverse of imports; if you import something, it implies that something else is exporting that thing (otherwise, it's not actually an import... at best you're returning with "salvage" from international waters :wink:)

view this post on Zulip Richard Feldman (Apr 15 2023 at 01:47):

I agree that it's the natural converse of imports, I just don't think that's as important as the keyword giving the right intuitions about how it should be used :big_smile:

view this post on Zulip Kevin Gillette (Apr 15 2023 at 01:53):

Interesting, gotcha


Last updated: Jun 16 2026 at 16:19 UTC