fixfile-0.1.0.0: File-backed recursive data structures.

Copyright(C) 2016 Rev. Johnny Healey
LicenseLGPL-3
MaintainerRev. Johnny Healey <rev.null@gmail.com>
Stabilityexperimental
Portabilityunknown
Safe HaskellNone
LanguageHaskell2010

Data.FixFile.Set

Description

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.

Synopsis

Documentation

data Set i a Source

A Fixed (Set i) is a set of items represented as a binary tree.

Instances

Functor (Set i) Source 
Foldable (Set i) Source 
Traversable (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 Rep (Set i a) Source 

createSetFile :: (Binary i, Typeable i) => FilePath -> IO (FixFile (Ref (Set i))) Source

Create a FixFile (Set i).

openSetFile :: (Binary i, Typeable i) => FilePath -> IO (FixFile (Ref (Set i))) Source

Open a FixFile (Set i).

empty :: Fixed g => g (Set i) Source

An empty Set.

insertSet :: (Ord i, Fixed g) => i -> g (Set i) -> g (Set i) Source

Insert an item i into a Fixed recursive Set i.

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

deleteSet :: (Ord i, Fixed g) => i -> g (Set i) -> g (Set i) Source

Delete an item i into a Fixed recursive Set i.

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

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.

toListSet :: Fixed g => g (Set i) -> [i] Source

Turn a Fixed recurive structure of Set i into a list.