Copyright | (C) 2015, Yu Fukuzawa |
---|---|

License | BSD3 |

Maintainer | minpou.primer@email.com |

Stability | experimental |

Portability | portable |

Safe Haskell | None |

Language | Haskell2010 |

An implementation of heterogeneous tree-map by open unions.
This module uses the `Data.IntMap`

inside,
see also https://hackage.haskell.org/package/containers.

- data UnionIntMap r
- type Key = Int
- (\\) :: UnionIntMap r -> UnionIntMap r -> UnionIntMap r
- (!) :: Member as a => UnionIntMap as -> Key -> a
- empty :: UnionIntMap r
- singleton :: Member as a => Key -> a -> UnionIntMap as
- null :: UnionIntMap r -> Bool
- size :: UnionIntMap r -> Int
- member :: Key -> UnionIntMap r -> Bool
- notMember :: Key -> UnionIntMap r -> Bool
- lookup :: Member as a => Key -> UnionIntMap as -> Maybe a
- lookupU :: Key -> UnionIntMap r -> Maybe (K0 :| r)
- find :: Member as a => Key -> UnionIntMap as -> a
- findU :: Key -> UnionIntMap r -> K0 :| r
- findWithDefault :: Member as a => a -> Key -> UnionIntMap as -> a
- insert :: Member as a => Key -> a -> UnionIntMap as -> UnionIntMap as
- insertWith :: Member as a => (a -> a -> a) -> Key -> a -> UnionIntMap as -> UnionIntMap as
- insertWithKey :: Member as a => (Key -> a -> a -> a) -> Key -> a -> UnionIntMap as -> UnionIntMap as
- delete :: Key -> UnionIntMap as -> UnionIntMap as
- adjust :: Member as a => (a -> a) -> Key -> UnionIntMap as -> UnionIntMap as
- adjustWithKey :: Member as a => (Key -> a -> a) -> Key -> UnionIntMap as -> UnionIntMap as
- update :: Member as a => (a -> Maybe a) -> Key -> UnionIntMap as -> UnionIntMap as
- updateWithKey :: Member as a => (Key -> a -> Maybe a) -> Key -> UnionIntMap as -> UnionIntMap as
- union :: UnionIntMap r -> UnionIntMap r -> UnionIntMap r
- unions :: [UnionIntMap r] -> UnionIntMap r
- difference :: UnionIntMap r -> UnionIntMap r -> UnionIntMap r
- intersection :: UnionIntMap r -> UnionIntMap r -> UnionIntMap r
- keys :: UnionIntMap r -> [Key]
- rebuild :: Include s r => UnionIntMap r -> UnionIntMap s
- mapU :: ((K0 :| r) -> K0 :| s) -> UnionIntMap r -> UnionIntMap s
- mapWithKeyU :: (Key -> (K0 :| r) -> K0 :| s) -> UnionIntMap r -> UnionIntMap s
- mapU' :: ((K0 :| r) -> a) -> UnionIntMap r -> IntMap a
- mapWithKeyU' :: (Key -> (K0 :| r) -> a) -> UnionIntMap r -> IntMap a
- filterU :: ((K0 :| r) -> Bool) -> UnionIntMap r -> UnionIntMap r
- filterWithKeyU :: (Key -> (K0 :| r) -> Bool) -> UnionIntMap r -> UnionIntMap r
- foldrU :: ((K0 :| r) -> b -> b) -> b -> UnionIntMap r -> b
- foldrWithKeyU :: (Key -> (K0 :| r) -> b -> b) -> b -> UnionIntMap r -> b
- foldlU' :: (a -> (K0 :| r) -> a) -> a -> UnionIntMap r -> a
- foldlWithKeyU' :: (a -> Key -> (K0 :| r) -> a) -> a -> UnionIntMap r -> a
- showTree :: Show (K0 :| r) => UnionIntMap r -> String

# Types

data UnionIntMap r Source

Monoid (UnionIntMap r) |

# Operators

(\\) :: UnionIntMap r -> UnionIntMap r -> UnionIntMap r Source

(!) :: Member as a => UnionIntMap as -> Key -> a Source

# Construction

empty :: UnionIntMap r Source

singleton :: Member as a => Key -> a -> UnionIntMap as Source

# Query

null :: UnionIntMap r -> Bool Source

size :: UnionIntMap r -> Int Source

member :: Key -> UnionIntMap r -> Bool Source

notMember :: Key -> UnionIntMap r -> Bool Source

find :: Member as a => Key -> UnionIntMap as -> a Source

findWithDefault :: Member as a => a -> Key -> UnionIntMap as -> a Source

## Insertion

insert :: Member as a => Key -> a -> UnionIntMap as -> UnionIntMap as Source

insertWith :: Member as a => (a -> a -> a) -> Key -> a -> UnionIntMap as -> UnionIntMap as Source

insertWithKey :: Member as a => (Key -> a -> a -> a) -> Key -> a -> UnionIntMap as -> UnionIntMap as Source

## Delete/Update

delete :: Key -> UnionIntMap as -> UnionIntMap as Source

adjust :: Member as a => (a -> a) -> Key -> UnionIntMap as -> UnionIntMap as Source

adjustWithKey :: Member as a => (Key -> a -> a) -> Key -> UnionIntMap as -> UnionIntMap as Source

update :: Member as a => (a -> Maybe a) -> Key -> UnionIntMap as -> UnionIntMap as Source

updateWithKey :: Member as a => (Key -> a -> Maybe a) -> Key -> UnionIntMap as -> UnionIntMap as Source

# Set Operation

union :: UnionIntMap r -> UnionIntMap r -> UnionIntMap r Source

unions :: [UnionIntMap r] -> UnionIntMap r Source

difference :: UnionIntMap r -> UnionIntMap r -> UnionIntMap r Source

intersection :: UnionIntMap r -> UnionIntMap r -> UnionIntMap r Source

# Conversion

keys :: UnionIntMap r -> [Key] Source

rebuild :: Include s r => UnionIntMap r -> UnionIntMap s Source

# Map

mapU :: ((K0 :| r) -> K0 :| s) -> UnionIntMap r -> UnionIntMap s Source

mapWithKeyU :: (Key -> (K0 :| r) -> K0 :| s) -> UnionIntMap r -> UnionIntMap s Source

mapWithKeyU' :: (Key -> (K0 :| r) -> a) -> UnionIntMap r -> IntMap a Source

# Filter

filterU :: ((K0 :| r) -> Bool) -> UnionIntMap r -> UnionIntMap r Source

filterWithKeyU :: (Key -> (K0 :| r) -> Bool) -> UnionIntMap r -> UnionIntMap r Source

# Folds

foldrU :: ((K0 :| r) -> b -> b) -> b -> UnionIntMap r -> b Source

foldrWithKeyU :: (Key -> (K0 :| r) -> b -> b) -> b -> UnionIntMap r -> b Source

foldlU' :: (a -> (K0 :| r) -> a) -> a -> UnionIntMap r -> a Source

foldlWithKeyU' :: (a -> Key -> (K0 :| r) -> a) -> a -> UnionIntMap r -> a Source