Safe Haskell | Safe-Inferred |
---|---|
Language | Haskell2010 |
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
Metric Cyclomatic Function Source # | |
Defined in Language.Haskell.Homplexity.Cyclomatic measure :: Function -> Cyclomatic Source # | |
Metric Depth Function Source # | |
CodeFragment c => Metric LOC c Source # | |
Defined in Language.Haskell.Homplexity.Metric | |
Metric RecordFieldsCount DataDef Source # | |
Defined in Language.Haskell.Homplexity.RecordFieldsCount measure :: DataDef -> RecordFieldsCount Source # | |
Metric AssocTypeCount TypeClass Source # | |
Defined in Language.Haskell.Homplexity.TypeClassComplexity measure :: TypeClass -> AssocTypeCount Source # | |
Metric NonTypeDeclCount TypeClass Source # | |
Defined in Language.Haskell.Homplexity.TypeClassComplexity measure :: TypeClass -> NonTypeDeclCount Source # | |
Metric ConDepth TypeSignature Source # | |
Defined in Language.Haskell.Homplexity.TypeComplexity measure :: TypeSignature -> ConDepth Source # | |
Metric NumFunArgs TypeSignature Source # | |
Defined in Language.Haskell.Homplexity.TypeComplexity measure :: TypeSignature -> NumFunArgs Source # |
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 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.