I'm trying to understand the very first Elm example and it has this:
import Graphics.Element exposing (..)
What does exposing (..)
mean?
exposing (..)
allows you to call all the functions in the package directly.
For example, if SamplePackage had the functions x and y,
import SamplePackage
would let you call SamplePackage.x
and SamplePackage.y
, while
import SamplePackage exposing (..)
would let you call x
and y
without specifying their containing package.
Note that import SamplePackage exposing (x)
would let you call x
directly, but you would still need to call y with SamplePackage.y
. Likewise, import SamplePackage exposing (x, y)
would let you call x
and y
, but not any other functions in the package.
It means that you can access everything directly within the Graphics.Element module, without specifying the package first. Since this example only uses "show" and "Element", you could change the import line to:
import Graphics.Element exposing (Element, show)
And it will still work for this example.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With