[Haskell-cafe] What is a safe Haskell data type to store and manipulate Money values?

Saurabh Nanda saurabhnanda at gmail.com
Tue Apr 4 11:21:02 UTC 2017


Hi Manuel,

Thank you for your reply. Some clarifications below...


> It depends on what sort of computation you'll be doing upon those
> monetary values and on the expectations of your users.  It's typical
> that payment processing applications sacrifice precision and instead
> prefer to deal in exact quantities


Is there a document which explains common use-cases for monetary values and
best-practices for dealing with them? Any guidelines for which **Haskell**
data-types to use for what kind of monetary calculations?

Here is what we are doing in our app:

* Powering web-based e-commerce checkout flows
* Allowing store owners to input tax rates
* Allowing end-customers to see product prices in different currencies (so,
currency conversion)
* Various reports to see total sales, total receivables, and total payables
(basically a **very** small subset of small-business accounting)
* Exporting data to full-fledged accounting systems, like Quickbooks and
Xero.

Based on this use-case, which Haskell data-type would you suggest?

-- Saurabh.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.haskell.org/pipermail/haskell-cafe/attachments/20170404/cdc5c899/attachment.html>


More information about the Haskell-Cafe mailing list