Copyright | (c) Galois Inc 2014-2019 |
---|---|

Maintainer | Joe Hendrix <jhendrix@galois.com> |

Safe Haskell | Safe |

Language | Haskell98 |

## Synopsis

- data MaybeS v
- fromMaybeS :: a -> MaybeS a -> a
- data Updated a
- updatedValue :: Updated a -> a
- data TreeApp e t
- class IsBinTree t e | t -> e where
- balanceL :: IsBinTree c e => e -> c -> c -> c
- balanceR :: IsBinTree c e => e -> c -> c -> c
- glue :: IsBinTree c e => c -> c -> c
- merge :: IsBinTree c e => c -> c -> c
- filterGt :: IsBinTree c e => (e -> Ordering) -> c -> MaybeS c
- filterLt :: IsBinTree c e => (e -> Ordering) -> c -> MaybeS c
- insert :: IsBinTree c e => (e -> e -> Ordering) -> e -> c -> Updated c
- delete :: IsBinTree c e => (e -> Ordering) -> c -> MaybeS c
- union :: IsBinTree c e => (e -> e -> Ordering) -> c -> c -> c
- link :: IsBinTree c e => e -> c -> c -> c
- data PairS f s = PairS !f !s

# Documentation

A strict version of `Maybe`

fromMaybeS :: a -> MaybeS a -> a Source #

`Updated a`

contains a value that has been flagged on whether it was
modified by an operation.

updatedValue :: Updated a -> a Source #

balanceL :: IsBinTree c e => e -> c -> c -> c Source #

`balanceL p l r`

returns a balanced tree for the sequence `l ++ [p] ++ r`

.

It assumes that `l`

and `r`

are close to being balanced, and that only
`l`

may contain too many elements.

balanceR :: IsBinTree c e => e -> c -> c -> c Source #

`balanceR p l r`

returns a balanced tree for the sequence `l ++ [p] ++ r`

.

It assumes that `l`

and `r`

are close to being balanced, and that only
`r`

may contain too many elements.

glue :: IsBinTree c e => c -> c -> c Source #

`glue l r`

concatenates `l`

and `r`

.

It assumes that `l`

and `r`

are already balanced with respect to each other.

merge :: IsBinTree c e => c -> c -> c Source #

Concatenate two trees that are ordered with respect to each other.

filterGt :: IsBinTree c e => (e -> Ordering) -> c -> MaybeS c Source #

Returns only entries that are less than predicate with respect to the ordering and Nothing if no elements are discarded.

filterLt :: IsBinTree c e => (e -> Ordering) -> c -> MaybeS c Source #

`filterLt k m`

returns submap of `m`

that only contains entries
that are smaller than `k`

. If no entries are deleted then return Nothing.

insert :: IsBinTree c e => (e -> e -> Ordering) -> e -> c -> Updated c Source #

`insert p m`

inserts the binding into `m`

. It returns
an Unchanged value if the map stays the same size and an updated
value if a new entry was inserted.