ninetynine-1.3.0: Ninety-Nine Haskell Problems
CopyrightCopyright (C) 2021 Yoo Chung
LicenseGPL-3.0-or-later
Maintainerdev@chungyc.org
Safe HaskellSafe-Inferred
LanguageGHC2021

Problems.P80

Description

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

Synopsis

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.

toLists :: ConvertibleGraph g => g -> Lists Source #

Convert graph to the Lists representation.

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

Convert graph to the Adjacency representation.

toPaths :: ConvertibleGraph g => g -> Paths Source #

Convert graph to the Paths representation.

toG :: ConvertibleGraph g => g -> G Source #

Convert graph to the G representation.