-- Hoogle documentation, generated by Haddock
-- See Hoogle, http://www.haskell.org/hoogle/
-- | Library to provide the behaviour similar to quantum states superposition.
--
-- Has three modules with similar functionality. The functions provide
-- the somewhat generalized way to round the numbers based on some data.
@package quantizer
@version 0.2.1.1
-- | A module to provide the simple version of the obtaining from the list
-- of values the list of other values, the pre-defined ones. Provides
-- both pure functions and monadic versions. Contrary to ListQuantizer
-- module, the results in every function here depend on the two values,
-- which the point is located in between. Defined for just positive real
-- numbers of Double type.
module TwoQuantizer
round2 :: Bool -> Double -> Double -> Double -> Maybe Double
round2L :: Bool -> [Double] -> Double -> Double
twoQuantizer :: Bool -> [Double] -> [Double] -> [Double]
round2G :: Ord a => Bool -> (a -> a -> a -> Ordering) -> a -> a -> a -> Maybe a
round2GL :: Ord a => Bool -> (a -> a -> a -> Ordering) -> [a] -> a -> a
twoQuantizerG :: (Ord a, Floating a, Integral a) => Bool -> (a -> a -> a -> Ordering) -> [a] -> [a] -> [a]
round2GM :: (Ord a, Monad m) => Bool -> (a -> a -> a -> m Ordering) -> a -> a -> a -> m (Maybe a)
round2GLM :: (Ord a, Monad m) => Bool -> (a -> a -> a -> m Ordering) -> [a] -> a -> m a
-- | Simple arithmetic mean. Is vulnerable to floating point rounding error
-- so if possible use just for double-precision values.
meanF2 :: (Floating a, Integral a) => [a] -> a -> a -> a
twoQuantizerGM :: (Ord a, Floating a, Integral a, Monad m) => Bool -> (a -> a -> a -> m Ordering) -> [a] -> [a] -> m [a]
-- | A module to provide the extended variants to convert a list with some
-- values to another one with the values from the pre-defined another
-- list. Similar to the measurement of the quantum state observables with
-- the discrete spectrum. Contrary to TwoQuantizer module, the results in
-- every function here depend not just on the two values, which the point
-- is located in between, but on the whole list. Defined for just
-- positive real numbers of Double type.
module ListQuantizer
-- | A better suited variant for round2G for lists.
round2GL :: Ord a => Bool -> ([a] -> a -> Ordering) -> [a] -> a -> Maybe a
foldableQuantizerGL :: (Ord a, Floating a, Integral a) => Bool -> ([a] -> a -> Ordering) -> [a] -> [a] -> [a]
round2GML :: (Ord a, Monad m) => Bool -> ([a] -> a -> m Ordering) -> [a] -> a -> m (Maybe a)
foldableQuantizerGML :: (Ord a, Floating a, Integral a, Monad m) => Bool -> ([a] -> a -> m Ordering) -> [a] -> [a] -> m [a]
-- | A module to provide the extended variants to convert a
-- InsertLeft instance structure with some values to another one
-- with the values from the pre-defined structure. Similar to the
-- measurement of the quantum state observables with the discrete
-- spectrum. For performance reasons it is better to use module
-- ListQuantizer whenever possible (especially if the given
-- Foldable and InsertLeft instances are just lists).
-- Contrary to TwoQuantizer module, the results in every function here
-- depend not just on the two values, which the point is located in
-- between, but on the whole structure. Defined for just positive real
-- numbers of Double type.
module FoldableQuantizer
round2G :: (Ord a, InsertLeft t a, Monoid (t a)) => Bool -> (t a -> a -> Ordering) -> t a -> a -> Maybe a
foldableQuantizerG :: (Ord a, Floating a, Integral a, InsertLeft t1 a, Monoid (t1 a), Foldable t2) => Bool -> (t1 a -> a -> Ordering) -> t1 a -> t2 a -> [a]
round2GM :: (Ord a, Monad m, InsertLeft t1 a, Monoid (t1 a)) => Bool -> (t1 a -> a -> m Ordering) -> t1 a -> a -> m (Maybe a)
foldableQuantizerGM :: (Ord a, Floating a, Integral a, Monad m, InsertLeft t1 a, Monoid (t1 a), Foldable t2) => Bool -> (t1 a -> a -> m Ordering) -> t1 a -> t2 a -> m [a]