UMinho Haskell Libraries (1.0)ContentsIndex
Data.Metrics
Portability portable
Stability experimental
Maintainer Tiago Alves and Joost Visser
Contents
Defined data structures
Operations on metrics
Functions to aid pretty-printing the metrics
Description
This module contains data types for representing individual metrics and groups of metrics. Printing support for these is supplied as well.
Synopsis
data Metric = Metric {
description :: String
name :: String
value :: String
}
data GroupMetric = GroupMetric String [Metric]
summaryMetrics :: [GroupMetric] -> [Metric]
average :: Integral a => [a] -> Ratio a
printGroupMetricList :: [GroupMetric] -> [String]
printGroupMetricRow :: [GroupMetric] -> [String]
printGroupMetricHeaderRow :: [GroupMetric] -> [String]
printMetricsList :: [Metric] -> [String]
printMetricsRow :: [Metric] -> [String]
printMetricHeadersRow :: [Metric] -> [String]
Defined data structures
data Metric
Individual metric.
Constructors
Metric
description :: StringFull description of the metric.
name :: StringSmall name of the metric.
value :: StringValue of the calculated metric.
data GroupMetric
Named group of metrics.
Constructors
GroupMetric String [Metric]
Operations on metrics
summaryMetrics :: [GroupMetric] -> [Metric]
Compute summary metrics of group metrics. For each group metric, we compute minimum, average, and maximum.
average :: Integral a => [a] -> Ratio a
Utility function to compute average of a list of integral numbers.
Functions to aid pretty-printing the metrics
printGroupMetricList :: [GroupMetric] -> [String]
Creates a list of strings representing a list of GroupMetrics. Returns the name of the group metric, an empty string, each of the metrics and a final blank string.
printGroupMetricRow :: [GroupMetric] -> [String]
Creates a list of strings representing a list of GroupMetrics. Returns only the values of the metrics (put them in a row).
printGroupMetricHeaderRow :: [GroupMetric] -> [String]
Creates a list with the small name of the metrics (put them in a row).
printMetricsList :: [Metric] -> [String]
Creates a string representation of a list of individual metrics. Each string will contain the metric's description, the small name (between brackets and its value. The results will be aligned.
printMetricsRow :: [Metric] -> [String]
Creates a list with the metrics values (put them in a row).
printMetricHeadersRow :: [Metric] -> [String]
Creates a list with the metrics small names (put them in a row).
Produced by Haddock version 0.6