hydra-0.5.1: Type-aware transformations for data and programs
Safe HaskellSafe-Inferred
LanguageHaskell2010

Hydra.Langs.RelationalModel

Description

An interpretation of Codd's Relational Model, as described in 'A Relational Model of Data for Large Shared Data Banks' (1970). Types (domains) and values are parameterized so as to allow for application-specific implementations. No special support is provided for nonsimple domains; i.e. relations are assumed to be normalized.

Synopsis

Documentation

newtype ColumnName Source #

A name for a domain which serves to identify the role played by that domain in the given relation; a 'role name' in Codd

Constructors

ColumnName 

Fields

data ColumnSchema t Source #

An abstract specification of the domain represented by a column in a relation; a role

Constructors

ColumnSchema 

Fields

data ForeignKey Source #

A mapping from certain columns of a source relation to primary key columns of a target relation

Constructors

ForeignKey 

newtype PrimaryKey Source #

A primary key of a relation, specified either as a single column, or as a list of columns

Constructors

PrimaryKey 

newtype Relation v Source #

A set of distinct n-tuples; a table

Constructors

Relation 

Fields

Instances

Instances details
(Read v, Ord v) => Read (Relation v) Source # 
Instance details

Defined in Hydra.Langs.RelationalModel

Show v => Show (Relation v) Source # 
Instance details

Defined in Hydra.Langs.RelationalModel

Methods

showsPrec :: Int -> Relation v -> ShowS #

show :: Relation v -> String #

showList :: [Relation v] -> ShowS #

Eq v => Eq (Relation v) Source # 
Instance details

Defined in Hydra.Langs.RelationalModel

Methods

(==) :: Relation v -> Relation v -> Bool #

(/=) :: Relation v -> Relation v -> Bool #

Ord v => Ord (Relation v) Source # 
Instance details

Defined in Hydra.Langs.RelationalModel

Methods

compare :: Relation v -> Relation v -> Ordering #

(<) :: Relation v -> Relation v -> Bool #

(<=) :: Relation v -> Relation v -> Bool #

(>) :: Relation v -> Relation v -> Bool #

(>=) :: Relation v -> Relation v -> Bool #

max :: Relation v -> Relation v -> Relation v #

min :: Relation v -> Relation v -> Relation v #

data RelationSchema t Source #

An abstract relation; the name and columns of a relation without its actual data

Constructors

RelationSchema 

Fields

newtype Relationship v Source #

A domain-unordered (string-indexed, rather than position-indexed) relation

Constructors

Relationship 

newtype Row v Source #

An n-tuple which is an element of a given relation

Constructors

Row 

Fields

Instances

Instances details
Read v => Read (Row v) Source # 
Instance details

Defined in Hydra.Langs.RelationalModel

Show v => Show (Row v) Source # 
Instance details

Defined in Hydra.Langs.RelationalModel

Methods

showsPrec :: Int -> Row v -> ShowS #

show :: Row v -> String #

showList :: [Row v] -> ShowS #

Eq v => Eq (Row v) Source # 
Instance details

Defined in Hydra.Langs.RelationalModel

Methods

(==) :: Row v -> Row v -> Bool #

(/=) :: Row v -> Row v -> Bool #

Ord v => Ord (Row v) Source # 
Instance details

Defined in Hydra.Langs.RelationalModel

Methods

compare :: Row v -> Row v -> Ordering #

(<) :: Row v -> Row v -> Bool #

(<=) :: Row v -> Row v -> Bool #

(>) :: Row v -> Row v -> Bool #

(>=) :: Row v -> Row v -> Bool #

max :: Row v -> Row v -> Row v #

min :: Row v -> Row v -> Row v #