UMinho Haskell Libraries (1.0)ContentsIndex
Data.Relation.Read
Portability portable
Stability experimental
Maintainer joost.visser@di.uminho.pt
Contents
Parsing spreadsheet-like input files.
Convert to relations.
Auxiliaries
Description
Reading relations from files.
Synopsis
readMatrix :: Char -> Int -> FilePath -> IO [[String]]
tokenizeBy :: (Char -> Bool) -> String -> [String]
matrixToRel :: [[String]] -> Rel String (String, Int)
rowToRel :: Rel String (String, Int) -> [String] -> Rel String (String, Int)
type FilterMask = [Bool]
filterWithMask :: FilterMask -> [x] -> [x]
valueSets :: Ord a => [Set a] -> [[a]] -> [Set a]
Parsing spreadsheet-like input files.
readMatrix :: Char -> Int -> FilePath -> IO [[String]]
tokenizeBy :: (Char -> Bool) -> String -> [String]
Tokenize an input lines by a given separator character predicate.
Convert to relations.
matrixToRel :: [[String]] -> Rel String (String, Int)
Convert a matrix to a relation. Every cell gives rise to a pair with first element the key from the first column in the corresponding row, and with second element a pair of the cell value and the column number. Cells with null values do not give rise to any pair.
rowToRel :: Rel String (String, Int) -> [String] -> Rel String (String, Int)
Auxiliaries
type FilterMask = [Bool]
filterWithMask :: FilterMask -> [x] -> [x]
Keep or discard element of a list, depending on the truth value at the corresponding position in a given filter mask. If the mask is shorter than the given list, the list is truncated.
valueSets :: Ord a => [Set a] -> [[a]] -> [Set a]
Compute the sets of values that occur in each collumn of a given matrix.
Produced by Haddock version 0.6