From a48b46aa5768ba594775886404836e6fdc98472e Mon Sep 17 00:00:00 2001 From: Jean-Paul Calderone <exarkun@twistedmatrix.com> Date: Thu, 29 Aug 2019 18:48:13 -0400 Subject: [PATCH] a couple more comments --- src/PaymentServer/Persistence.hs | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/src/PaymentServer/Persistence.hs b/src/PaymentServer/Persistence.hs index 4fa499a..4163cad 100644 --- a/src/PaymentServer/Persistence.hs +++ b/src/PaymentServer/Persistence.hs @@ -64,11 +64,15 @@ class VoucherDatabase d where -> IO (Either RedeemError ()) -- ^ Left indicating the redemption is not allowed or Right indicating it is. -- | MemoryVoucherDatabase is a voucher database that only persists state --- in-memory. The state does not outlive the process which creates it. This --- is primarily useful for testing. +-- in-memory. The state does not outlive the process which creates it (nor +-- even the MemoryVoucherDatabase value). This is primarily useful for +-- testing. data MemoryVoucherDatabase = - Memory - { paid :: IORef (Set.Set Voucher) + Memory { + -- | A set of vouchers which have been paid for. + paid :: IORef (Set.Set Voucher) + -- | A mapping from redeemed vouchers to fingerprints associated with the + -- redemption. , redeemed :: IORef (Map.Map Voucher Fingerprint) } -- GitLab