stable-tree-0.6.1: Trees whose branches are resistant to change

CopyrightJeremy Groven
LicenseBSD3
Safe HaskellNone
LanguageHaskell2010

Data.StableTree.Key

Description

Tools for working with StableTree keys.

Synopsis

Documentation

data Key t k Source

A wrapper for keys; this has an ephemeral t that will be either Terminal or Nonterminal depending on the result of byte k.

Instances

Eq k => Eq (Key t k) 
Ord k => Ord (Key t k) 
Show k => Show (Key t k) 

data SomeKey k Source

A sum type to contain either a Terminal or a Nonterminal Key

Instances

Eq k => Eq (SomeKey k) 
Ord k => Ord (SomeKey k) 
Show k => Show (SomeKey k) 

data Terminal Source

Used to indicate that a Key is terminal

data Nonterminal Source

Used to indicate that a Key is not terminal

wrap :: Serialize k => k -> SomeKey k Source

Do the magic of wrapping up a key into a SomeKey

unwrap :: SomeKey k -> k Source

Extract the original key from a wrapped one