I just realized that Elm already uses this strategy... with `Color`! It has two constructors: RGBA and HSLA ( https://github.com/elm-lang/core/blob/master/src/Color.elm ), but neither is exported. This forces the user to use the various 'creation' functions to create one ( http://package.elm-lang.org/packages/elm-lang/core/4.0.4/Color ). There's no reason why the same thing couldn't be done with an `Angle` type. All the trig functions and angle creation functions in `Basics` should probably be moved to a new `Angle` module too then.
On Friday, July 29, 2016 at 11:55:35 AM UTC-5, Duane Johnson wrote: > > > On Fri, Jul 29, 2016 at 10:48 AM, Anton Lorenzen <[email protected] > <javascript:>> wrote: > >> I just created a small library for this: >> https://github.com/anfelor/elm-units >> >> It allows for time to be used like this: >> Units.Time.every (30 ::: milliseconds) Tick >> > > > Neat! I'm surprised at what can be done with existing syntax and types. > -- 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.
