Maintainer | Toshio Ito <debug.ito@gmail.com> |
---|---|
Safe Haskell | None |
Language | Haskell2010 |
Since: 0.4.3.0
Synopsis
- data SeqIDMaker n i
- newSeqIDMaker :: i -> SeqIDMaker n i
- convertGraph :: (Eq n, Hashable n, Enum i, Eq i, Hashable i) => SeqIDMaker n i -> SnapshotGraph n na la -> (SeqIDMaker n i, SnapshotGraph i na la)
- convertLink :: (Eq n, Hashable n, Enum i, Eq i, Hashable i) => SeqIDMaker n i -> SnapshotLink n la -> (SeqIDMaker n i, SnapshotLink i la)
- convertNode :: (Eq n, Hashable n, Enum i, Eq i, Hashable i) => SeqIDMaker n i -> SnapshotNode n na -> (SeqIDMaker n i, SnapshotNode i na)
- convertNodeID :: (Eq n, Hashable n, Enum i, Eq i, Hashable i) => SeqIDMaker n i -> n -> (SeqIDMaker n i, i)
- originalIDFor :: (Eq i, Hashable i) => SeqIDMaker n i -> i -> Maybe n
Type
data SeqIDMaker n i Source #
SeqIDMaker
converts node ID type n
into the new node ID type
i
. The type i
is supposed to be an Enum
, and it generates the
node ID of type i
sequentially for each node ID of type n
.
SeqIDMaker
is useful to convert the SnapshotGraph
into a graph
representation of another graph library such as
fgl. Note that the
target graph library can provide a better way for conversion. For
example, fgl has NodeMap
type to do basically the same thing.
Instances
(Eq n, Eq i) => Eq (SeqIDMaker n i) Source # | |
Defined in NetSpider.SeqID (==) :: SeqIDMaker n i -> SeqIDMaker n i -> Bool # (/=) :: SeqIDMaker n i -> SeqIDMaker n i -> Bool # | |
(Show n, Show i) => Show (SeqIDMaker n i) Source # | |
Defined in NetSpider.SeqID showsPrec :: Int -> SeqIDMaker n i -> ShowS # show :: SeqIDMaker n i -> String # showList :: [SeqIDMaker n i] -> ShowS # |
Construction
Conversion
convertGraph :: (Eq n, Hashable n, Enum i, Eq i, Hashable i) => SeqIDMaker n i -> SnapshotGraph n na la -> (SeqIDMaker n i, SnapshotGraph i na la) Source #
Convert node IDs in the SnapshotGraph
.
convertLink :: (Eq n, Hashable n, Enum i, Eq i, Hashable i) => SeqIDMaker n i -> SnapshotLink n la -> (SeqIDMaker n i, SnapshotLink i la) Source #
Convert node IDs in the SnapshotLink
.
convertNode :: (Eq n, Hashable n, Enum i, Eq i, Hashable i) => SeqIDMaker n i -> SnapshotNode n na -> (SeqIDMaker n i, SnapshotNode i na) Source #
Convert node ID in the SnapshotNode
.
:: (Eq n, Hashable n, Enum i, Eq i, Hashable i) | |
=> SeqIDMaker n i | |
-> n | Old ID |
-> (SeqIDMaker n i, i) | Updated |
Convert the given node ID of type n
into the sequential ID of
type i
.
originalIDFor :: (Eq i, Hashable i) => SeqIDMaker n i -> i -> Maybe n Source #
Get the original ID of type n
for the new ID of type i
.