neuron-0.2.0.0: Haskell meets Zettelkasten, for your plain-text delight.
Safe HaskellNone
LanguageHaskell2010

Neuron.Zettelkasten.Graph

Synopsis

Graph type

type ZettelGraph = AdjacencyMap [Connection] ZettelID Source #

The Zettelkasten graph

Construction

mkZettelGraph :: ZettelStore -> ZettelGraph Source #

Build the Zettelkasten graph from the given list of note files.

Algorithms

backlinks :: ZettelID -> ZettelGraph -> [ZettelID] Source #

Return the backlinks to the given zettel

dfsForestFrom :: [ZettelID] -> ZettelGraph -> Forest ZettelID Source #

Compute the dfsForest from the given zettels.

dfsForestBackwards :: ZettelID -> ZettelGraph -> Forest ZettelID Source #

Compute the dfsForest ending in the given zettel.

Return the forest flipped, such that the given zettel is the root.

obviateRootUnlessForest :: (Show a, Eq a) => a -> [Tree a] -> [Tree a] Source #

If the input is a tree with the given root node, return its children (as forest). Otherwise return the input as is.