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

ListQuantizer

Description

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.

Synopsis

Documentation

round2GL Source #

Arguments

:: Ord a 
=> Bool

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

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

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

A better suited variant for round2G for lists.

foldableQuantizerGL 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 -> Ordering) 
-> [a] 
-> [a] 
-> [a] 

round2GML 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 -> m Ordering) 
-> [a] 
-> a 
-> m (Maybe a) 

foldableQuantizerGML 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 -> m Ordering) 
-> [a] 
-> [a] 
-> m [a]