Safe Haskell | Safe-Inferred |
---|---|
Language | Haskell2010 |
Language.Haskell.Homplexity.Metric
Description
Class for defining code metrics, and its simplest implementation - number of lines of code.
Synopsis
- class (CodeFragment c, Show m) => Metric m c where
- measure :: c -> m
- data LOC
- locT :: Proxy LOC
- measureAs :: Metric m c => Proxy m -> c -> m
- measureFor :: Metric m c => Proxy m -> Proxy c -> c -> m
Documentation
class (CodeFragment c, Show m) => Metric m c where Source #
Metric can be computed on a set of CodeFragment
fragments
and then shown.
Instances
Number of lines of code (example metric)
Instances
Enum LOC Source # | |
Num LOC Source # | |
Read LOC Source # | |
Defined in Language.Haskell.Homplexity.Metric | |
Integral LOC Source # | |
Real LOC Source # | |
Defined in Language.Haskell.Homplexity.Metric Methods toRational :: LOC -> Rational | |
Show LOC Source # | |
Eq LOC Source # | |
Ord LOC Source # | |
CodeFragment c => Metric LOC c Source # | |
Defined in Language.Haskell.Homplexity.Metric |
measureAs :: Metric m c => Proxy m -> c -> m Source #
Convenience function for fixing the Metric
type.
measureFor :: Metric m c => Proxy m -> Proxy c -> c -> m Source #
Convenience function for fixing both the Metric
and CodeFragment
for which the metric is computed.