Copyright | Copyright (C) 2021 Yoo Chung |
---|---|

License | GPL-3.0-or-later |

Maintainer | dev@chungyc.org |

Safe Haskell | Safe-Inferred |

Language | GHC2021 |

Part of Ninety-Nine Haskell Problems. Some solutions are in Solutions.P80.

## Synopsis

- class (Graph g, ConvertibleGraph g) => ConvertibleGraph g
- toLists :: ConvertibleGraph g => g -> Lists
- toAdjacency :: ConvertibleGraph g => g -> Adjacency
- toPaths :: ConvertibleGraph g => g -> Paths
- toG :: ConvertibleGraph g => g -> G

# Documentation

class (Graph g, ConvertibleGraph g) => ConvertibleGraph g Source #

Write functions to convert between the different graph representations
`Lists`

, `Adjacency`

, `Paths`

, and `G`

.

The types can already be easily converted between each other using
the `sets`

and `toGraph`

functions available to the `Graph`

type class.
Unlike the other graph problems, this problem should be solved without using
the functions available to the `Graph`

type class for it to not be trivial.

toAdjacency :: ConvertibleGraph g => g -> Adjacency Source #

Convert graph to the `Adjacency`

representation.