homeomorphic-0.1: Homeomorphic Embedding Test

Data.Homeomorphic

Synopsis

Documentation

data Shell a Source

The central data type. All data structures must be converted so they consist of Shell's, which split a value into a component at this level and the children. Create a Shell with shell.

Instances

Eq a => Eq (Shell a) 
Ord a => Ord (Shell a) 
Show a => Show (Shell a) 
Arbitrary a => Arbitrary (Shell a) 

shell :: a -> [Shell a] -> Shell aSource

Create a value with a component at the current level and all the children.

(<<|) :: Eq a => Shell a -> Shell a -> BoolSource

A simple homeomorphic embedding. O(expensive)

couple :: Eq a => Shell a -> Shell a -> BoolSource

Does the couple rule apply.

dive :: Eq a => Shell a -> Shell a -> BoolSource

Does the dive rule apply.

data Homeomorphic k v Source

Datatype to store a homemorphic embedding.

empty :: Homeomorphic k vSource

An empty embedding

insert :: Ord k => Shell k -> v -> Homeomorphic k v -> Homeomorphic k vSource

Insert a new key (coded as a shell) and an associated value into an embedding.

find :: Ord k => Shell k -> Homeomorphic k v -> [v]Source

Does any relation xs <| y hold, given y.

findOne :: Ord k => Shell k -> Homeomorphic k v -> Maybe vSource

findOne y = listToMaybe . find y