Copyright | (c) 2015 David Farrell |
---|---|
License | PublicDomain |
Stability | unstable |
Portability | non-portable (GHC extensions) |
Safe Haskell | Safe |
Language | Haskell2010 |
Polygonal maps for Haskell with flexible storage.
- module Data.PolyMap.Relation
- module Data.PolyMap.Storage.Set
- data family PolyMap as
- type SimplePolyMap as s = PolyMap (MapStorage s as)
- null :: PolyMapClass as => PolyMap as -> Bool
- size :: PolyMapClass as => PolyMap as -> Int
- member :: PolyMapLookup n as => Proxy n -> TypeAt n (MapFst as) -> PolyMap as -> Bool
- notMember :: PolyMapLookup n as => Proxy n -> TypeAt n (MapFst as) -> PolyMap as -> Bool
- lookup :: (PolyMapClass as, PolyMapLookup n as) => Proxy n -> TypeAt n (MapFst as) -> PolyMap as -> Maybe (Relation (MapFst as))
- empty :: PolyMapClass as => PolyMap as
- singleton :: (PolyMapClass as, ToRelation a (MapFst as)) => a -> PolyMap as
- insert :: (PolyMapClass as, ToRelation a (MapFst as)) => a -> PolyMap as -> PolyMap as
- lookupIndex :: PolyMapLookup n as => Proxy n -> TypeAt n (MapFst as) -> PolyMap as -> Maybe Int
- lookupRelation :: PolyMapClass as => Int -> PolyMap as -> Maybe (Relation (MapFst as))
Documentation
module Data.PolyMap.Relation
module Data.PolyMap.Storage.Set
PolyMap Type
A polymap whose sides are defined by a list of types zipped with storage types.
(Show a, Show (s a), Show (PolyMap as)) => Show (PolyMap ((:) ((,) * (* -> *)) ((,) * (* -> *) a s) as)) Source | |
Show (PolyMap ([] ((,) * (* -> *)))) Source | |
data PolyMap ([] ((,) * (* -> *))) = UnitPolyMap Source | |
data PolyMap ((:) ((,) * (* -> *)) ((,) * (* -> *) a s) as) = (s a) :<=>: (PolyMap as) Source |
type SimplePolyMap as s = PolyMap (MapStorage s as) Source
A simple polymap whose sides are defined by a list of types and a single storage type.
Query
member :: PolyMapLookup n as => Proxy n -> TypeAt n (MapFst as) -> PolyMap as -> Bool Source
Is the key a member at the specified side of the polymap.
notMember :: PolyMapLookup n as => Proxy n -> TypeAt n (MapFst as) -> PolyMap as -> Bool Source
Is the key not a member at the specified side of the polymap? See also member
.
lookup :: (PolyMapClass as, PolyMapLookup n as) => Proxy n -> TypeAt n (MapFst as) -> PolyMap as -> Maybe (Relation (MapFst as)) Source
Construction
singleton :: (PolyMapClass as, ToRelation a (MapFst as)) => a -> PolyMap as Source
A polymap with a single relation.
Insertion
insert :: (PolyMapClass as, ToRelation a (MapFst as)) => a -> PolyMap as -> PolyMap as Source
Insert a new relation into the polymap.