user6435535
user6435535

Reputation:

Module import in Elm with and without (..)

I have seen a couple of examples using either syntax of:

import Browser exposing (..)

or

import Browser

Are these equivalent? Does the second syntax implicitly exposes everything?

Upvotes: 3

Views: 165

Answers (1)

michid
michid

Reputation: 10834

No those are not equivalent.

import Browser

is a qualified import where

import Browser exposing (..)

is an unqualified import.

When using qualified imports you still have to use the fully qualified names of the imported functions and types. With unqualified imports those become available without having to fully qualify them.

See Elm Modules and Imports for a good introduction.

Upvotes: 5

Related Questions