stil4m/elm-syntax/7.0.6

NOTE: the latest version is 7.3.9

Elm.Syntax.Exposing

Exposing Syntax

This syntax represents the exposing declaration for both imports and module headers. For example:

exposing (Foo(..))
exposing (..)

Types

= All Range
| Explicit (List (Node TopLevelExpose))

Diffent kind of exposing declarations

= InfixExpose String
| FunctionExpose String
| TypeOrAliasExpose String
| TypeExpose ExposedType

An exposed entity

type alias ExposedType =
{ name : String
, open : Maybe Range
}

Exposed Type

Functions

exposesFunction : String -> Exposing -> Bool

Check whether an import/module exposing list exposes a certain function. Will yield True if Exposing is exposing everything (All).

exposesFunction "something" (All someRange) == True


exposesFunction "divide" (Explicit [ Node someRange (FunctionExpose "add") ]) == False


exposesFunction "add" (Explicit [ Node someRange (FunctionExpose "add") ]) == True
operators : List TopLevelExpose -> List String

Collect all operator names from a list of TopLevelExposes

Serialization

encode : Exposing -> Value

Encode an Exposing syntax element to JSON.

decoder : Decoder Exposing

JSON decoder for an Exposing syntax element.