You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Aug 23, 2018. It is now read-only.
This is an example of some of my own code and how it might interact with to the suggestion in #277 (which I agree with in general); I currently have a setup like the following:
-- Internal.elm: non-exposed modulemoduleInternalexposing (..)
type Point2d=Point2d(Float,Float)type Axis2d=Axis2d{ originPoint :Point2d, direction :Direction2d}-- Axis2d.elmmoduleAxis2dexposing (Axis2d, with)
importPoint2dexposing (Point2d)
importInternaltype alias Axis2d=Internal.Axis2dwith: { originPoint : Point2d, direction : Direction2d } ->Axis2dwith =Internal.Axis2d-- Point2d.elmmodulePoint2dexposing (Point2d, mirrorAcross)
importInternalexposing (Axis2d)
type alias Point2d=Internal.Point2dmirrorAcross:Axis2d->Point2d->Point2dmirrorAcross axis point =...
So the Axis2d module simply imports the Point2d module and the alias defined there (which is the canonical, public Point2d type), but to avoid a circular import the Point2d module simply refers directly to the non-exposed Internal.Axis2d type instead of the alias in the Axis2d module. So all the necessary types are exposed through some module, but may be referred to using different aliases in different modules. Ideally I'd like "types used in publicly exposed functions must themselves be publicly exposed" to be interpreted as "those types must be exposed via some alias in some module in the package".
The text was updated successfully, but these errors were encountered:
This is an example of some of my own code and how it might interact with to the suggestion in #277 (which I agree with in general); I currently have a setup like the following:
So the
Axis2d
module simply imports thePoint2d
module and the alias defined there (which is the canonical, publicPoint2d
type), but to avoid a circular import thePoint2d
module simply refers directly to the non-exposedInternal.Axis2d
type instead of the alias in theAxis2d
module. So all the necessary types are exposed through some module, but may be referred to using different aliases in different modules. Ideally I'd like "types used in publicly exposed functions must themselves be publicly exposed" to be interpreted as "those types must be exposed via some alias in some module in the package".The text was updated successfully, but these errors were encountered: