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

Safe HaskellNone
LanguageHaskell2010

Data.Relational.Lists

Contents

Description

Deprecated: This module will be replaced in a future release.

Tuples and relations as lists.

Synopsis

Types

type Tabulation a = Table (Record a) Source #

A tabulation.

newtype Record a Source #

A record.

Constructors

Record 

Fields

Instances

Functor Record Source # 

Methods

fmap :: (a -> b) -> Record a -> Record b #

(<$) :: a -> Record b -> Record a #

Foldable Record Source # 

Methods

fold :: Monoid m => Record m -> m #

foldMap :: Monoid m => (a -> m) -> Record a -> m #

foldr :: (a -> b -> b) -> b -> Record a -> b #

foldr' :: (a -> b -> b) -> b -> Record a -> b #

foldl :: (b -> a -> b) -> b -> Record a -> b #

foldl' :: (b -> a -> b) -> b -> Record a -> b #

foldr1 :: (a -> a -> a) -> Record a -> a #

foldl1 :: (a -> a -> a) -> Record a -> a #

toList :: Record a -> [a] #

null :: Record a -> Bool #

length :: Record a -> Int #

elem :: Eq a => a -> Record a -> Bool #

maximum :: Ord a => Record a -> a #

minimum :: Ord a => Record a -> a #

sum :: Num a => Record a -> a #

product :: Num a => Record a -> a #

Eq a => Eq (Record a) Source # 

Methods

(==) :: Record a -> Record a -> Bool #

(/=) :: Record a -> Record a -> Bool #

Read a => Read (Record a) Source # 
Show a => Show (Record a) Source # 

Methods

showsPrec :: Int -> Record a -> ShowS #

show :: Record a -> String #

showList :: [Record a] -> ShowS #

Binary a => Binary (Record a) Source # 

Methods

put :: Record a -> Put #

get :: Get (Record a) #

putList :: [Record a] -> Put #

Tuple (Record a) Source # 

Associated Types

type Attribute (Record a) :: * Source #

type Attribute (Record a) Source # 
type Attribute (Record a) = a

data Table r Source #

A table.

Constructors

Table 

Fields

Instances

Functor Table Source # 

Methods

fmap :: (a -> b) -> Table a -> Table b #

(<$) :: a -> Table b -> Table a #

Foldable Table Source # 

Methods

fold :: Monoid m => Table m -> m #

foldMap :: Monoid m => (a -> m) -> Table a -> m #

foldr :: (a -> b -> b) -> b -> Table a -> b #

foldr' :: (a -> b -> b) -> b -> Table a -> b #

foldl :: (b -> a -> b) -> b -> Table a -> b #

foldl' :: (b -> a -> b) -> b -> Table a -> b #

foldr1 :: (a -> a -> a) -> Table a -> a #

foldl1 :: (a -> a -> a) -> Table a -> a #

toList :: Table a -> [a] #

null :: Table a -> Bool #

length :: Table a -> Int #

elem :: Eq a => a -> Table a -> Bool #

maximum :: Ord a => Table a -> a #

minimum :: Ord a => Table a -> a #

sum :: Num a => Table a -> a #

product :: Num a => Table a -> a #

Tuple r => Relation String r (Table r) Source # 

Methods

names :: Table r -> [String] Source #

empty :: [String] -> Table r Source #

makeRelation :: [String] -> [r] -> Table r Source #

tuples :: Table r -> [r] Source #

attributeMaybe :: Table r -> String -> r -> Maybe (Attribute r) Source #

attribute :: Table r -> String -> r -> Attribute r Source #

(Read (Attribute r), Tuple r) => Read (Table r) Source # 
(Show (Attribute r), Tuple r) => Show (Table r) Source # 

Methods

showsPrec :: Int -> Table r -> ShowS #

show :: Table r -> String #

showList :: [Table r] -> ShowS #

(Monoid (Attribute r), Tuple r) => Monoid (Table r) Source # 

Methods

mempty :: Table r #

mappend :: Table r -> Table r -> Table r #

mconcat :: [Table r] -> Table r #

Binary r => Binary (Table r) Source # 

Methods

put :: Table r -> Put #

get :: Get (Table r) #

putList :: [Table r] -> Put #

Input/Output

readTable Source #

Arguments

:: (Stringy (Attribute r), Tuple r) 
=> FilePath

The file path.

-> IO (Table r)

Action to read the table.

Read a table.

writeTable Source #

Arguments

:: (Stringy (Attribute r), Tuple r) 
=> FilePath

The file path.

-> Table r

The table.

-> IO ()

Action to write the table.

Write a table.

makeTable Source #

Arguments

:: (Default (Table r), Tuple r) 
=> [r]

The records.

-> Table r

The table.

Make a table.