Copyright | (c) OleksandrZhabenko 2020-2021 |
---|---|
License | MIT |
Maintainer | olexandr543@yahoo.com |
Stability | Experimental |
Safe Haskell | None |
Language | Haskell2010 |
Some special functions to work with lists (with zip).
Synopsis
- normFst :: (Fractional a, Ord a) => [(a, b)] -> IO [(a, b)]
- normSnd :: (Fractional b, Ord b) => [(a, b)] -> IO [(a, b)]
- evalFstFV :: (Fractional a, Ord a, Eq b) => (a -> b) -> [a] -> IO [((a, b), (a, b))]
- evalFstFVM :: (Fractional a, Ord a, Eq b) => (a -> IO b) -> [a] -> IO [((a, b), (a, b))]
- evalSndFV :: (Fractional b, Ord b, Eq a) => (a -> b) -> [a] -> IO [((a, b), (a, b))]
- evalSndFVM :: (Fractional b, Ord b, Eq a) => (a -> IO b) -> [a] -> IO [((a, b), (a, b))]
- double42Float4 :: ((Double, Double), (Double, Double)) -> ((Float, Float), (Float, Float))
- float42Double4 :: ((Float, Float), (Float, Float)) -> ((Double, Double), (Double, Double))
Documentation
normFst :: (Fractional a, Ord a) => [(a, b)] -> IO [(a, b)] Source #
Norms a tuples in a list by their first elements so that the greatest by an absolute value first element is equal to 1 (or -1). If all the first elements are zeros then prints a warning message and exits successfully.
normSnd :: (Fractional b, Ord b) => [(a, b)] -> IO [(a, b)] Source #
Norms a tuples in a list by their second elements so that the greatest by an absolute value second element is equal to 1 (or -1). If all the second elements are zeros then prints a warning message and exits successfully.
evalFstFV :: (Fractional a, Ord a, Eq b) => (a -> b) -> [a] -> IO [((a, b), (a, b))] Source #
A special function transformation to obtain the resulting list so that its first elements in the inner tuples are in a special way
normed to 1 (or -1) by normFst
and the inner tuples are sequenced one by another as a 2D points of the generating function f :: a -> b
.
To obtain non-empty result the given second argument must have at least two elements.
evalFstFVM :: (Fractional a, Ord a, Eq b) => (a -> IO b) -> [a] -> IO [((a, b), (a, b))] Source #
The same as evalFstFV
but uses a monadic IO function f.
evalSndFV :: (Fractional b, Ord b, Eq a) => (a -> b) -> [a] -> IO [((a, b), (a, b))] Source #
A special function transformation to obtain the resulting list so that its second elements in the inner tuples are in a special way
normed to 1 (or -1) by normSnd
and the inner tuples are sequenced one by another as a 2D points of the generating function f :: a -> b
.
To obtain non-empty result the given second argument must have at least two elements. Is similar to evalFstFV
.
evalSndFVM :: (Fractional b, Ord b, Eq a) => (a -> IO b) -> [a] -> IO [((a, b), (a, b))] Source #
The same as evalSndFV
but uses a monadic IO function f.