From 4523f2ffdfa7e4c0fa13952d46ddead73dc80470 Mon Sep 17 00:00:00 2001 From: Tim Makarios Date: Wed, 23 Apr 2014 14:53:45 +1200 Subject: [PATCH] Report on total value in terms of each currency, as well as ROR --- rootstock.hs | 24 ++++++++++++++++-------- 1 file changed, 16 insertions(+), 8 deletions(-) diff --git a/rootstock.hs b/rootstock.hs index 7d016b9..286abcf 100644 --- a/rootstock.hs +++ b/rootstock.hs @@ -722,14 +722,22 @@ report = do vs <- readValueSimplexAt lastInterventionTime return (vs, lastInterventionTime) vs' <- gets valueSimplex - forM_ (distinctPairsOneWay $ nodes vs) $ \(x, y) -> do - liftIO $ putStrLn $ show $ nodeFund $ entityVal x - liftIO $ putStrLn $ show $ nodeFund $ entityVal y - liftIO $ putStrLn $ show $ - (linkValueSquared vs' x y / linkValueSquared vs x y) - ** ((60 * 60 * 24 * 365 / 2) - / (fromRational $ toRational $ diffUTCTime now lastInterventionTime)) - liftIO $ putStrLn "" + let xs = nodes vs + liftIO $ do + forM_ (distinctPairsOneWay xs) $ \(x, y) -> mapM_ putStrLn + [ show $ nodeFund $ entityVal x + , show $ nodeFund $ entityVal y + , show $ + (linkValueSquared vs' x y / linkValueSquared vs x y) + ** ((60 * 60 * 24 * 365 / 2) + / (fromRational $ toRational $ diffUTCTime now lastInterventionTime)) + , "" + ] + forM_ xs $ \x -> mapM_ putStrLn + [ show $ nodeFund $ entityVal x + , show $ totalValue vs' x + , "" + ] -------------------------------------------------------------------------------- -- 2.11.4.GIT