project-m36-0.5.1: Relational Algebra Engine

Safe HaskellNone
LanguageHaskell2010

ProjectM36.Relation

Synopsis

Documentation

difference :: Relation -> Relation -> Either RelationalError Relation Source #

Difference takes two relations of the same type and returns a new relation which contains only tuples which appear in the first relation but not the second.

relFold :: (RelationTuple -> a -> a) -> a -> Relation -> a Source #

toList :: Relation -> IO [RelationTuple] Source #

Generate a randomly-ordered list of tuples from the relation.

typesAsRelation :: TypeConstructorMapping -> Either RelationalError Relation Source #

Return a Relation describing the types in the mapping.

relationVariablesAsRelation :: Map RelVarName Relation -> Either RelationalError Relation Source #

Return a Relation describing the relation variables.

randomizeTupleOrder :: MonadRandom m => Relation -> m Relation Source #

Randomly resort the tuples. This is useful for emphasizing that two relations are equal even when they are printed to the console in different orders.