raft-0.3.7.0: Miscellaneous Haskell utilities for data structures and data manipulation.

Safe HaskellSafe
LanguageHaskell2010

Data.List.Util.Listable

Contents

Description

For CSV-like and TSV-like data.

Synopsis

Tabbed Strings

tab :: String Source #

Tab character.

fromTabbed Source #

Arguments

:: String

The tabbed strings.

-> [String]

The strings between the tabs.

Separate a tabbed string.

toTabbed Source #

Arguments

:: [String]

The strings.

-> String

The intercalated string.

Intercalate tabs between strings.

fromTabbeds Source #

Arguments

:: String

The string.

-> [[String]]

The lines and strings between tabs.

Separate lines and tabs.

toTabbeds Source #

Arguments

:: [[String]]

The lines and strings between tabs.

-> String

The intercalated string.

Intercalte lines and tabs.

Converting to/from Lists

class Listable a b | a -> b where Source #

Class for conversion to/from lists.

Minimal complete definition

fromList, toList

Methods

fromList :: [b] -> a Source #

Convert from a list.

toList :: a -> [b] Source #

fromStringList Source #

Arguments

:: (Listable a b, Stringy b) 
=> [String]

The strings.

-> a

The value.

Convert from a list of strings.

toStringList Source #

Arguments

:: (Listable a b, Stringy b) 
=> a

The value.

-> [String]

The strings.

Convert to a list of strings.

fromTabbedList Source #

Arguments

:: (Listable a b, Stringy b) 
=> String

The tabbed list.

-> a

The value.

Convert from a tabbed lines.

toTabbedList Source #

Arguments

:: (Listable a b, Stringy b) 
=> a

The value.

-> String

The tabbed string.

Convert to a tabbed lines.

fromStringLists Source #

Arguments

:: (Listable a b, Listable b c, Stringy c) 
=> [[String]]

The lists of strings.

-> a

The value.

Convert from a list of strings.

toStringLists Source #

Arguments

:: (Listable a b, Listable b c, Stringy c) 
=> a

The value.

-> [[String]]

The lists of strings.

Convert to a list of strings.

fromTabbedLists Source #

Arguments

:: (Listable a b, Listable b c, Stringy c) 
=> String

The tabbed lines.

-> a

The value.

Convert from tabbed lines.

toTabbedLists Source #

Arguments

:: (Listable a b, Listable b c, Stringy c) 
=> a

The value.

-> String

The tabbed lines.

Convert to tabbed lines.

fromTransposedTabbedLists Source #

Arguments

:: (Listable a b, Listable b c, Stringy c) 
=> String

The tranposed tabbed lines.

-> a

The value.

Convert from transposed tabbed lines.

toTransposedTabbedLists Source #

Arguments

:: (Listable a b, Listable b c, Stringy c) 
=> a

The value.

-> String

The transposed tabbed lines.

Convert to transposed tabbed lines.

Dealing with Headers

class WithHeader a b | a -> b where Source #

Class for lists of strings with a headers.

Minimal complete definition

fromHeaderLists, toHeaderLists

Methods

fromHeaderLists :: ([String], [b]) -> a Source #

Convert from a list of values with headers.

toHeaderLists :: a -> ([String], [b]) Source #

fromStringListsWithHeader Source #

Arguments

:: (WithHeader a b, Listable b c, Stringy c) 
=> [[String]]

The lists of strings.

-> a

The value.

Convert from lists of strings with a header.

toStringListsWithHeader Source #

Arguments

:: (WithHeader a b, Listable b c, Stringy c) 
=> a

The value.

-> [[String]]

The lists of strings.

Convert to lists of strings with a header.

fromTabbedListsWithHeader Source #

Arguments

:: (WithHeader a b, Listable b c, Stringy c) 
=> String

The lines.

-> a

The value.

Convert from lines with a header.

toTabbedListsWithHeader Source #

Arguments

:: (WithHeader a b, Listable b c, Stringy c) 
=> a

The value.

-> String

The lines.

Convert to lines with a header.

readTabbedListsWithHeader Source #

Arguments

:: (WithHeader a b, Listable b c, Stringy c) 
=> FilePath

The file.

-> IO a

Action for reading the value.

Read lines with a header.

writeTabbedListsWithHeader Source #

Arguments

:: (WithHeader a b, Listable b c, Stringy c) 
=> FilePath

The file path.

-> a

The value.

-> IO ()

The action for writing the value.

Write lines with a header.

fromTransposedTabbedListsWithHeader Source #

Arguments

:: (WithHeader a b, Listable b c, Stringy c) 
=> String

The tabbed lines.

-> a

The value.

Convert from tabbed lines with a header.

toTransposedTabbedListsWithHeader Source #

Arguments

:: (WithHeader a b, Listable b c, Stringy c) 
=> a

The value.

-> String

The tabbed lines.

Convert to tabbed lines with a header.

readTransposedTabbedListsWithHeader Source #

Arguments

:: (WithHeader a b, Listable b c, Stringy c) 
=> FilePath

The file path.

-> IO a

Action for reading the value.

Read tabbed lines with a header.

writeTransposedTabbedListsWithHeader Source #

Arguments

:: (WithHeader a b, Listable b c, Stringy c) 
=> FilePath

The file path.

-> a

The value.

-> IO ()

The action for writing the value.

Write tabbed lines with a header.