Safe Haskell | None |
---|---|
Language | Haskell2010 |
Synopsis
- type ZettelGraph = AdjacencyMap [Connection] ZettelID
- mkZettelGraph :: ZettelStore -> ZettelGraph
- backlinks :: ZettelID -> ZettelGraph -> [ZettelID]
- topSort :: ZettelGraph -> Either (NonEmpty ZettelID) [ZettelID]
- zettelClusters :: ZettelGraph -> [NonEmpty ZettelID]
- dfsForestFrom :: [ZettelID] -> ZettelGraph -> Forest ZettelID
- dfsForestBackwards :: ZettelID -> ZettelGraph -> Forest ZettelID
- obviateRootUnlessForest :: (Show a, Eq a) => a -> [Tree a] -> [Tree a]
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
zettelClusters :: ZettelGraph -> [NonEmpty ZettelID] Source #
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.