3 ms·
Wow, this is really well designed and the article is a pleasure to read. I wonder if it might be even better for the ExchangeRate constructor to take two diffe
by anonymouz 9y ago
Wow, this is really well designed and the article is a pleasure to read.
I wonder if it might be even better for the ExchangeRate constructor to take two different Dense values, something like:
exchangeRate (1 :: Dense "EUR") (12 % 10 Dense "USD")
Then the type system could automatically prevent you from making an error by accidentally entering the reciprocal exchange rate from what is expected.