AERN-Real-0.9.7.1: arbitrary precision interval arithmetic for approximating exact real numbers

Portabilityportable
Stabilityexperimental
Maintainermik@konecny.aow.cz

Data.Number.ER.Misc

Description

Miscelaneous utilities (eg related to Ordering, pairs, booleans, strings)

Synopsis

Documentation

compareCompose :: Ordering -> Ordering -> OrderingSource

Compose as when defining the lexicographical ordering.

compareComposeMany :: [Ordering] -> OrderingSource

Compose as when defining the lexicographical ordering.

compareLex :: Ord a => [a] -> [a] -> OrderingSource

The lexicographical ordering.

mapFst :: (a1 -> a2) -> (a1, b) -> (a2, b)Source

mapSnd :: (b1 -> b2) -> (a, b1) -> (a, b2)Source

mapPair :: (a1 -> a2, b1 -> b2) -> (a1, b1) -> (a2, b2)Source

mapPairHomog :: (a1 -> a2) -> (a1, a1) -> (a2, a2)Source

unpair :: [(a, a)] -> [a]Source

dropLast :: Int -> [a] -> [a]Source

concatWithSource

Arguments

:: String

a connective

-> [String] 
-> String 

eg

    concatWith "," ["a","b"] = "a,b"

replicateSeveral :: [(Int, a)] -> [a]Source

eg

    replicateSeveral [(2,"a"),(1,"b")] = "aab"

countDuplicates :: Eq a => [a] -> [(Int, a)]Source

eg

    countDuplicates "aaba" = [(2,"a"),(1,"b"),(1,"a")]

allCombinations :: [(k, [v])] -> [[(k, v)]]Source

eg

    allCombinations 
        [
         (1,['a']), 
         (2,['b','c']), 
         (3,['d','e','f'])
        ] =
            [
             [(1,'a'),(2,'b'),(3,'d')], 
             [(1,'a'),(2,'b'),(3,'e')],
             [(1,'a'),(2,'b'),(3,'f')],
             [(1,'a'),(2,'c'),(3,'d')], 
             [(1,'a'),(2,'c'),(3,'e')],
             [(1,'a'),(2,'c'),(3,'f')]
            ]

allPairsCombinations :: [(k, (v, v))] -> [[(k, v)]]Source

allPairsCombinationsEvenOddSource

Arguments

:: [(k, (v, v))]

the first value is even, the second odd

-> ([[(k, v)]], [[(k, v)]]) 

eg

    allPairsCombinationsEvenOdd 
        [
         (1,('a0','a1'), 
         (2,('b0','b1'), 
         (3,('c0','c1')
        ] =
           ([
             [(1,'a0'),(2,'b0'),(3,'c0')], 
             [(1,'a0'),(2,'b1'),(3,'c1')], 
             [(1,'a1'),(2,'b1'),(3,'c0')], 
             [(1,'a1'),(2,'b0'),(3,'c1')] 
            ]
           ,[
             [(1,'a0'),(2,'b0'),(3,'c1')], 
             [(1,'a0'),(2,'b1'),(3,'c0')], 
             [(1,'a1'),(2,'b0'),(3,'c0')], 
             [(1,'a1'),(2,'b1'),(3,'c1')] 
            ]
           )

intLogSource

Arguments

:: (Num n1, Num n2, Ord n1, Integral n2) 
=> n1

base

-> n1

x

-> (n2, n2) 

plusDown :: Num t => t -> t -> tSource

Directionally rounded versions of +,*,sum,prod.

timesUp :: Num t => t -> t -> tSource

timesDown :: Num t => t -> t -> tSource

plusUp :: Num t => t -> t -> tSource

sumDown :: Num t => [t] -> tSource

productDown :: Num t => [t] -> tSource

productUp :: Num t => [t] -> tSource

sumUp :: Num t => [t] -> tSource

showFirstLastLinesSource

Arguments

:: Show a 
=> Int

how many initial lines to use

-> Int

how many final lines to use

-> a 
-> String 

listUpdate :: Int -> a -> [a] -> [a]Source

listHasMatch :: (a -> Bool) -> [a] -> BoolSource