Copyright | (C) 2016 Rev. Johnny Healey |
---|---|

License | LGPL-3 |

Maintainer | Rev. Johnny Healey <rev.null@gmail.com> |

Stability | experimental |

Portability | unknown |

Safe Haskell | None |

Language | Haskell2010 |

This is a data type that can be used with a `FixFile`

to store a set of
`Ordered`

items as an unbalanced binary tree. This file is not recommended
for use, but exists for educational purposes. It has a simple
implementation that is easier to read than some of the more advanced
balanced data types.

- data Set i a
- createSetFile :: (Binary i, Typeable i) => FilePath -> IO (FixFile (Ref (Set i)))
- openSetFile :: (Binary i, Typeable i) => FilePath -> IO (FixFile (Ref (Set i)))
- empty :: Fixed g => g (Set i)
- insertSet :: (Ord i, Fixed g) => i -> g (Set i) -> g (Set i)
- insertSetT :: (Ord i, Binary i) => i -> Transaction (Ref (Set i)) s ()
- deleteSet :: (Ord i, Fixed g) => i -> g (Set i) -> g (Set i)
- deleteSetT :: (Ord i, Binary i) => i -> Transaction (Ref (Set i)) s ()
- lookupSet :: (Ord i, Fixed g) => i -> g (Set i) -> Bool
- lookupSetT :: (Ord i, Binary i) => i -> Transaction (Ref (Set i)) s Bool
- toListSet :: Fixed g => g (Set i) -> [i]
- toListSetT :: Binary i => Transaction (Ref (Set i)) s [i]

# Documentation

Warning: Set is unbalanced and not recommended.

A `Fixed`

`(`

is a set of items represented as a binary tree.`Set`

i)

Functor (Set i) Source # | |

Foldable (Set i) Source # | |

Traversable (Set i) Source # | |

FixedFoldable (Set i) Source # | |

FixedAlg (Set i) Source # | |

(Read i, Read a) => Read (Set i a) Source # | |

(Show i, Show a) => Show (Set i a) Source # | |

Generic (Set i a) Source # | |

(Binary i, Binary a) => Binary (Set i a) Source # | |

type Alg (Set i) Source # | |

type Rep (Set i a) Source # | |

insertSetT :: (Ord i, Binary i) => i -> Transaction (Ref (Set i)) s () Source #

`Transaction`

version of `insertSet`

.

deleteSetT :: (Ord i, Binary i) => i -> Transaction (Ref (Set i)) s () Source #

`Transaction`

version of `deleteSet`

.

lookupSet :: (Ord i, Fixed g) => i -> g (Set i) -> Bool Source #

Predicate to lookup an item from a

.`Set`

i

lookupSetT :: (Ord i, Binary i) => i -> Transaction (Ref (Set i)) s Bool Source #

`FTransaction`

version of `lookupSet`

.

toListSetT :: Binary i => Transaction (Ref (Set i)) s [i] Source #

`Transaction`

version of `toListSet`

.