scidb-hquery-2.8.0.434: Haskell query for SciDB via shim

Safe HaskellSafe
LanguageHaskell2010

Utils

Synopsis

Documentation

checkMajorVersion :: (Int -> t) -> String -> t Source #

Given a comparison and a string return true or false:

*Utils> checkMajorVersion (18>=) "18.1.0"
True
*Utils> checkMajorVersion (18>=) "19.3"
False
*Utils> checkMajorVersion (>=19) "19.3"
True
*Utils> checkMajorVersion (>=19) "18.1.0"
False

cleanDoubleQuotes :: String -> String Source #

Replace escaped double quotes (") by single quotes (') and remove double qoutes (").

deEscapeSingleQuotes :: String -> String Source #

De-Escape single quotes.

escapeSingleQuotes :: String -> String Source #

Escape single quotes.

nolines :: String -> String Source #

Replaces newlines (\n) with a space ( ).

replace :: Eq a => [a] -> [a] -> [a] -> [a] Source #

Replace needle in a haystack with replacement.

strip :: String -> String Source #

strip away leading and trailing space.

stripUsing :: (a -> Bool) -> [a] -> [a] Source #

stripUsing predicate p leading and trailing p x true.

toDoubleQuotedStr :: String -> String Source #

Make a double quoted string from a single quoted string, a SciDB string.

toSingleQuotedStr :: String -> String Source #

Make a single quoted string which is a SciDB string.

wrap :: Int -> String -> [String] Source #

If at all possible, wrap a string s into strings of length less than or equal to l breaking with isSpace.

wrapUsing :: (a -> Bool) -> Int -> [a] -> [[a]] Source #

wrapUsing predicate p a list xs into lists of length less than or equal to l breaking on p x true.