lib, web: tweaks to keep building with GHC 7
This commit is contained in:
parent
6becbc78f3
commit
16157bc711
@ -732,7 +732,6 @@ addOrAssignAmountAndCheckAssertionB p@Posting{paccount=acc, pamount=amt, pbalanc
|
|||||||
newbal <- addAmountB acc amt
|
newbal <- addAmountB acc amt
|
||||||
whenM (R.reader bsAssrt) $ checkBalanceAssertionB p newbal
|
whenM (R.reader bsAssrt) $ checkBalanceAssertionB p newbal
|
||||||
return p
|
return p
|
||||||
| Nothing <- mba = return p
|
|
||||||
| Just BalanceAssertion{baamount,batotal} <- mba = do
|
| Just BalanceAssertion{baamount,batotal} <- mba = do
|
||||||
(diff,newbal) <- case batotal of
|
(diff,newbal) <- case batotal of
|
||||||
True -> do
|
True -> do
|
||||||
@ -750,6 +749,8 @@ addOrAssignAmountAndCheckAssertionB p@Posting{paccount=acc, pamount=amt, pbalanc
|
|||||||
let p' = p{pamount=diff, poriginal=Just $ originalPosting p}
|
let p' = p{pamount=diff, poriginal=Just $ originalPosting p}
|
||||||
whenM (R.reader bsAssrt) $ checkBalanceAssertionB p' newbal
|
whenM (R.reader bsAssrt) $ checkBalanceAssertionB p' newbal
|
||||||
return p'
|
return p'
|
||||||
|
-- no amount, no balance assertion (GHC 7 doesn't like Nothing <- mba here)
|
||||||
|
| otherwise = return p
|
||||||
|
|
||||||
-- | Add the posting's amount to its account's running balance, and
|
-- | Add the posting's amount to its account's running balance, and
|
||||||
-- optionally check the posting's balance assertion if any.
|
-- optionally check the posting's balance assertion if any.
|
||||||
|
|||||||
@ -120,7 +120,7 @@ instance FromJSON Account
|
|||||||
-- https://github.com/PaulJohnson/Haskell-Decimal/issues/6
|
-- https://github.com/PaulJohnson/Haskell-Decimal/issues/6
|
||||||
--deriving instance Generic Decimal
|
--deriving instance Generic Decimal
|
||||||
--instance FromJSON Decimal
|
--instance FromJSON Decimal
|
||||||
deriving instance Generic (DecimalRaw Integer)
|
deriving instance Generic (DecimalRaw a)
|
||||||
instance FromJSON (DecimalRaw Integer)
|
instance FromJSON (DecimalRaw Integer)
|
||||||
--
|
--
|
||||||
-- @simonmichael, I think the code in your first comment should work if it compiles—though “work” doesn’t mean you can parse a JSON number directly into a `Decimal` using the generic instance, as you’ve discovered.
|
-- @simonmichael, I think the code in your first comment should work if it compiles—though “work” doesn’t mean you can parse a JSON number directly into a `Decimal` using the generic instance, as you’ve discovered.
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user