Re: [elm-discuss] Re: Unit Types : A Radical Proposal

2016-08-04 Thread John Bugner
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 (

Re: [elm-discuss] Re: Unit Types : A Radical Proposal

2016-07-29 Thread Duane Johnson
On Fri, Jul 29, 2016 at 10:48 AM, Anton Lorenzen 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

Re: [elm-discuss] Re: Unit Types : A Radical Proposal

2016-07-28 Thread Joey Eremondi
There is also some prior art with Haskell for this: https://hackage.haskell.org/package/uom-plugin https://hackage.haskell.org/package/units https://hackage.haskell.org/package/Measure On Thu, Jul 28, 2016 at 12:33 PM, Duane Johnson wrote: > > On Thu, Jul 28, 2016

Re: [elm-discuss] Re: Unit Types : A Radical Proposal

2016-07-28 Thread Duane Johnson
On Thu, Jul 28, 2016 at 1:11 PM, art yerkes wrote: > F# is kind of radical in that it has units. > > https://fsharpforfunandprofit.com/posts/units-of-measure/ > Wow, very neat! I like that F# keeps the units after the number, actually adding to readability. -- You