quantizer-0.2.1.0: Library to provide the behaviour similar to quantum states superposition.
Copyright(c) OleksandrZhabenko 2022-2023
LicenseMIT
Maintaineroleksandr.zhabenko@yahoo.com
StabilityExperimental
Safe HaskellSafe-Inferred
LanguageHaskell2010

TwoQuantizer

Description

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.

Documentation

round2 Source #

Arguments

:: Bool

If True then the function rounds the result in the ambiguous situation to the greater value.

-> Double 
-> Double 
-> Double 
-> Maybe Double

The numeric value (in Just case) can be equal just to the one of the two first arguments.

round2L Source #

Arguments

:: Bool

If True then the function rounds the result in the ambiguous situation to the greater value.

-> [Double] 
-> Double 
-> Double 

twoQuantizer Source #

Arguments

:: Bool

If True then the function rounds the result in the ambiguous situation to the greater value.

-> [Double] 
-> [Double] 
-> [Double] 

round2G Source #

Arguments

:: Ord a 
=> Bool

If True then the function rounds the result in the ambiguous situation to the greater value.

-> (a -> a -> a -> Ordering) 
-> a 
-> a 
-> a 
-> Maybe a

The a value (in Just case) can be equal just to the one of the two first a arguments.

round2GL Source #

Arguments

:: Ord a 
=> Bool

If True then the function rounds the result in the ambiguous situation to the greater value.

-> (a -> a -> a -> Ordering) 
-> [a] 
-> a 
-> a 

twoQuantizerG Source #

Arguments

:: (Ord a, Floating a, Integral a) 
=> Bool

If True then the function rounds the result in the ambiguous situation to the greater value.

-> (a -> a -> a -> Ordering) 
-> [a] 
-> [a] 
-> [a] 

round2GM Source #

Arguments

:: (Ord a, Monad m) 
=> Bool

If True then the function rounds the result in the ambiguous situation to the greater value.

-> (a -> a -> a -> m Ordering) 
-> a 
-> a 
-> a 
-> m (Maybe a) 

round2GLM Source #

Arguments

:: (Ord a, Monad m) 
=> Bool

If True then the function rounds the result in the ambiguous situation to the greater value.

-> (a -> a -> a -> m Ordering) 
-> [a] 
-> a 
-> m a 

meanF2 :: (Floating a, Integral a) => [a] -> a -> a -> a Source #

twoQuantizerGM Source #

Arguments

:: (Ord a, Floating a, Integral a, Monad m) 
=> Bool

If True then the function rounds the result in the ambiguous situation to the greater value.

-> (a -> a -> a -> m Ordering) 
-> [a] 
-> [a] 
-> m [a]