Hi everyone,

I would like to have the point of view of the community regarding some 
private/public types code organisation. I have some types very useful to 
many sub modules that are currently publicly exposed in a Types module. In 
order to hide the type implementation, I wonder what you think of a module 
organization like below:

-- Private/Types.elm
module Private.Types exposing (Point2d(Point2d))
type Point2d = Point2d (Float, Float)

-- Public/Types.elm
module Public.Types exposing (Point2d)
import Private.Types exposing (Point2d)

-- Point2d.elm
module Point2d exposing (fromCoordinates)
import Private.Types exposing (..)
fromCoordinates : (Float, Float) -> Point2d

The Public.Types would act as a "symbolic" link to the equivalent private 
types without exposing the type constructors. However I wonder if it means 
that fromCoordinates is returning a non exposed private Point2d type or if 
the linkage to the equivalent public type is effective. Is this considered 
bad practice, and/or potentially forbidden in future version of elm?

-- 
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.

Reply via email to