HAppS-Data-0.9.3: HAppS data manipulation librariesSource codeContentsIndex
HAppS.Data.Normalize
PortabilityNot portable
Stabilityexperimental
MaintainerAlexJacobson@HAppS.org
Contents
The interface
Writing your own instances
Advanced usage
Description
Normalizing Haskell values.
Synopsis
class Data NormalizeD a => Normalize a where
normalize :: a -> a
normalizeRecursively :: a -> a
defaultNormalize :: Normalize a => a -> a
defaultNormalizeRecursively :: Normalize a => a -> a
data NormalizeD a = NormalizeD {
normalizeD :: a -> a
normalizeRecursivelyD :: a -> a
}
normalizeProxy :: Proxy NormalizeD
The interface
class Data NormalizeD a => Normalize a whereSource

The Normalize class provides a normalize function, which is intended to normalize values only at the top-level constructor, and a normalizeRecursively function, which is intended to normalize all the subvalues and then normalize the top-level constructor.

There is a default instance that matches all types, where normalize is id and normalizeRecursively applies normalizeRecursively to all of its children and then normalize to the result.

If you want to actually do some normalization for a certain type, then just define an instance for that type; this will take precedence over the default instance.

Methods
normalize :: a -> aSource
normalizeRecursively :: a -> aSource
Writing your own instances
defaultNormalize :: Normalize a => a -> aSource
This is the normalize function in the default Normalize instance. It may be a useful building block when writing your own instances.
defaultNormalizeRecursively :: Normalize a => a -> aSource
This is the normalizeRecursively function in the default Normalize instance. It may be a useful building block when writing your own instances.
Advanced usage
data NormalizeD a Source
When writing your own generic functions for Normalize you may need to access the class methods through this datatype rather than directly.
Constructors
NormalizeD
normalizeD :: a -> a
normalizeRecursivelyD :: a -> a
show/hide Instances
normalizeProxy :: Proxy NormalizeDSource
When writing your own generic functions for Normalize you may need this, the proxy value.
Produced by Haddock version 2.4.2