fsprojects / FSharp.UMX

F# units of measure for primitive non-numeric types
MIT License
154 stars 10 forks source link

Implement unary operator for cast #1

Closed eiriktsarpalis closed 5 years ago

eiriktsarpalis commented 5 years ago

I've added a unary operator which seems to solve the awkwardness of passing tagged strings to functions that expect the underlying values

alfonsogarciacaro commented 5 years ago

Ah, great! Didn't realize the cast operation worked the other way around 😅 I will push a new release. BTW, do you want me to give you publish rights for the package?

eiriktsarpalis commented 5 years ago

I don't mind re: publish rights. FWIW I have published a variation of the library that we use internally in the master branch of my fork. It's largely compatible with what you already have, however it comes with a few benefits w.r.t. API ergonomy. Let me know what you think and I can set a new PR.

alfonsogarciacaro commented 5 years ago

Sure! Yes, please, send a PR. Or we can default to your package if you prefer. I just want to help popularize the use of units of measures for more types both in .NET and Fable :)

bartelink commented 5 years ago

FYI I'm looking to use it to resolve https://github.com/jet/equinox/issues/83 (TL;DR I/we have some very ugly/heavy boilerplate and this is obviously an ideal replacement - kudos for putting this out there)