-
-
Save aristidb/780617 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- | Get this amount's commodity and any commodities referenced in its price. | |
amountCommodities :: Amount -> [Commodity] | |
amountCommodities Amount{commodity=c,price=p} = | |
case p of Nothing -> [c] | |
Just (UnitPrice ma) -> c:(concatMap amountCommodities $ amounts ma) | |
Just (TotalPrice ma) -> c:(concatMap amountCommodities $ amounts ma) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment