If I try to import a union tag as if it was a type, I'm told the module doesn't expose it.
SSCCE. Option.elm:
module Option exposing (Option(Some, None))
type Option a
= Some a
| None
Import statement in another file:
import Option exposing (Option, None)
The correct syntax is of course import Option exposing (Option(None)), but the incorrect version produces:
-- NAMING ERROR --------------------------------------------------- Main.elm
Module `Option` does not expose `None`
3| import Option exposing (Option, None)
Ideally, the compiler would recognize what I'm trying to do and suggest import Option exposing (Option, None) (or perhaps with Some in there, or both). But it would be an improvement if it said "the type None", which would be a clue.
If I try to import a union tag as if it was a type, I'm told the module doesn't expose it.
SSCCE. Option.elm:
Import statement in another file:
The correct syntax is of course
import Option exposing (Option(None))
, but the incorrect version produces:Ideally, the compiler would recognize what I'm trying to do and suggest
import Option exposing (Option, None)
(or perhaps withSome
in there, or both). But it would be an improvement if it said "the typeNone
", which would be a clue.