> > So I think a type becomes opaque if its constructors are not exposed, or > if its module is not exposed. > It might be better in that case, if the compiler just referred to the > opaque type as Animation.State? > Actually, the compiler can do that. I just checked and figured that it was a design choice from mdgriffith. I have made this simple example:
-- module Private exposing (..) type Test = SomeTest | OtherTest -- module Public exposing (Test) import Private type alias Test = Private.Test -- module Test exposing (testFunction) import Public exposing (Test) import Private testFunction : Test testFunction = Private.SomeTest In that case, both the documentation and the compiler refers the return type of testFunction to be Public.test. One way you can create a partially exposed type is like this: > > module Test exposing (Test(One)) > > type Test > = One > | Two > Thanks, it wasn't the kind of "partial" exposure I had in mind but good to know in case I have this kind of need some time. -- You received this message because you are subscribed to the Google Groups "Elm Discuss" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. For more options, visit https://groups.google.com/d/optout.
