Skip to content

A Haskell library for mathematical graph parsing and writing.

License

Notifications You must be signed in to change notification settings

allegroCoder/pangraph

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

90 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

pangraph

Build Status

This is a Haskell Library for parsing graph formats such as GraphML and the XML files produced by Workcraft. The library currently implements parsing only the nodes and edges of undirected graphs.
See the User Guide for how to use this, with examples below. Information on current graph support can be found below that.

How to use Pangraph

Pangraph offers an api in the module Pangraph for accessing of graphs including constructors and getters.
You can construct entire graph or edit the results of parser. These are imported independently form their own modules:

import Pangraph.GraphML.Parser

All parsers currently export the following:

parse :: ByteString -> Maybe Pangraph
unsafeParse :: ByteString -> Pangraph

An example of reading code can be found in Examples below

Binary generation

One of the two commands below should be used for the compilation and the generation of a binary file:

ghc -isrc -ifantasi fantasi/Main.hs -o Fantasi
cabal install

Examples

See the Pangraph.Examples.* directory for further examples.

Parsing a Graph file

Repeated here the code from src/Pangraph/Examples:

module Pangraph.Examples.Reading where

import Prelude hiding (readFile)

import Data.ByteString (readFile)

import Pangraph
import qualified Pangraph.GraphML.Parser as GraphML_P

main :: IO ()
main = do
  fileName <- getLine
  file <- readFile fileName
  print (GraphML_P.parse file)

Graph File support

GraphML files are currently:

  • Parsing: Ok
  • Writing: Ok

Workcraft files are currently:

  • Parsing: Unimplemented
  • Writing: Unimplemented

Graph Library support

Currently implements:

  • FromPangraph: Implmented
  • ToPangraph: Unimplemented

About

A Haskell library for mathematical graph parsing and writing.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Haskell 100.0%