elm-in-elm / compiler / Elm.Data.Exposing

The exposing (...) line of module header and import statements.

module Foo exposing (..)
--> ExposingAll

module Foo exposing (bar)
--> ExposingSome [ExposedValue "bar"]

module Foo exposing (Bar)
--> ExposingSome [ExposedType "Bar"]

module Foo exposing (Bar(..))
--> ExposingSome [ExposedTypeAndAllConstructors "Bar"]


type Exposing
    = ExposingAll
    | ExposingSome (List ExposedItem)


type ExposedItem
    = ExposedValue Elm.Data.VarName.VarName
    | ExposedType Elm.Data.VarName.VarName
    | ExposedTypeAndAllConstructors Elm.Data.VarName.VarName

name : ExposedItem -> Elm.Data.VarName.VarName

Unwraps the variable or type name from the ExposedItem.

name (ExposedValue "foo")
--> "foo"

name (ExposedType "Foo")
--> "Foo"

name (ExposedTypeAndAllConstructors "Foo")
--> "Foo"