3 ms·
Elm makes great use of these, for example in the Units package: https://package.elm-lang.org/packages/ianmackenzie/elm-units/latest/ https://package.elm-lang.o
by jweir 2y ago
Elm makes great use of these, for example in the Units package:
https://package.elm-lang.org/packages/ianmackenzie/elm-units/latest/ https://package.elm-lang.org/packages/ianmackenzie/elm-units...
Very nice to prevent conversions between incompatible units, but without the over head of lots of type variants.
https://thoughtbot.com/blog/modeling-currency-in-elm-using-phantom-types https://thoughtbot.com/blog/modeling-currency-in-elm-using-p...