[input-output-hk/cardano-sl] [CO-347] Wallet’s UTXO histogram view (#3402)

KtorZ commented on this pull request.

> + %» upperBound=»%build
+ %» }»)
+ bucketName
+ bucketUpperBound
+
+
+data UtxoStatistics = UtxoStatistics
+ { theHistogram :: ![HistogramBar]
+ , theAllStakes :: !Word64
+ } deriving (Show, Generic, Ord)
+
+toMap :: [HistogramBar] -> Map Text Word64
+toMap = Map.fromList . map (\(HistogramBarCount key val) -> (key,val))
+
+instance Eq UtxoStatistics where
+ (UtxoStatistics h s) == (UtxoStatistics h’ s’) = s == s’ && toMap h == toMap h’

Nope indeed :), the performance argument is completely out-of-the-question here, but it’s more a general kind of remark. To compare lists, it’s usually enough to sort them :+1: