I have an elm module of Types that consists of types and type aliases Foo, Bar and Baz. When I export everything like so, the code works:
module Types exposing (..)
However, if I include all of the types explicitly, the code breaks.
module Types exposing (Foo, Bar, Baz)
This is also true of the import statements on the consuming file; both need to be exposing (..)
What is the difference between these two approaches?
I'm only learning Elm myself very recently but it sounds like since one of your types (Msg
) is being defined as a union type that you will need to use the Msg(..)
syntax when exporting this type.
module Types exposing (Msg (..))
type Msg = FirstAction | SecondAction | ThirdAction
Or in the case of importing the union type.
import Types exposing (Msg (..))
Please see GitHub issue #968 for an explanation of why this is required for union types.
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