Currency exchange example
From Reddit:
Does this support finding all possible paths between two specific nodes, where each edge is represented by a Money.ExchangeRate src dst? I.e. can I use arbitrary types for defining edges and nodes?
I want to use an ExchangeRate src dst to represent a path from src to dst, but fgl forces me to reduce all nodes to an Int, which means I lose a lot of information, and it becomes non-obvious to me how to restore this if I use pathTree for finding paths (which returns just [Int]).
It's not really about type-level vs. value-level, though. So if it works for SomeExchangeRate that's more than fine, too.
This example is precisely the kind of thing that should benefit from hashing for information preservation.
Consider arbitrary edge types.
Thanks for picking this up! Below is the above description with formatting (and links) intact. I will create a separate issue for adding a pathTree-variant to Data.HashGraph.Algorithms.
Does this support finding all possible paths between two specific nodes, where each edge is represented by a
Money.ExchangeRate src dst? I.e. can I use arbitrary types for defining edges and nodes?I want to use an
ExchangeRate src dstto represent a path fromsrctodst, butfglforces me to reduce all nodes to anInt, which means I lose a lot of information, and it becomes non-obvious to me how to restore this if I usepathTreefor finding paths (which returns just[Int]).It's not really about type-level vs. value-level, though. So if it works for
SomeExchangeRatethat's more than fine, too.