Maintainer | Ivan.Miljenovic@gmail.com |
---|---|
Safe Haskell | Safe-Infered |
- class PlanarEncoding ser where
- encodePlanarFile :: PlanarEncoding ser => ser -> FilePath -> [PlanarGraph (NLabel ser) (ELabel ser)] -> IO Int
- encodePlanarFileFrom :: PlanarEncoding ser => ser -> FilePath -> [(Maybe Edge, PlanarGraph (NLabel ser) (ELabel ser))] -> IO Int
- decodePlanarFile :: PlanarEncoding ser => ser -> FilePath -> IO [PlanarGraph (NLabel ser) (ELabel ser)]
Documentation
class PlanarEncoding ser whereSource
A class covering the different ways of encoding and decoding planar graphs from binary data.
putSG :: ser -> ((Int, Int), SerialisedGraph (NLabel ser) (ELabel ser)) -> BuilderSource
getSG :: ser -> Parser (SerialisedGraph (NLabel ser) (ELabel ser))Source
putName :: ser -> BuilderSource
Print the required header if appropriate; otherwise return an
empty Builder
. Should end in a newline if appropriate.
Attempt to parse a header; if none exists, this should return an appropriate default (if allowable). Should also parse trailing newlines if appropriate.
sepByNewline :: ser -> BoolSource
Is each graph on a new line?
encodePlanarFile :: PlanarEncoding ser => ser -> FilePath -> [PlanarGraph (NLabel ser) (ELabel ser)] -> IO IntSource
Encode a list of planar graphs to file using the specified encoding.
encodePlanarFileFrom :: PlanarEncoding ser => ser -> FilePath -> [(Maybe Edge, PlanarGraph (NLabel ser) (ELabel ser))] -> IO IntSource
Encode a list of planar graphs to file using the specified encoding, with the serialisation traversing from the an optionally specified edge.
decodePlanarFile :: PlanarEncoding ser => ser -> FilePath -> IO [PlanarGraph (NLabel ser) (ELabel ser)]Source
Read in a file containing encoded graphs. The PlanarEncoding
argument is only used for its type to determine which parser to
use.