Hi apfelmus,
Your code is fine, I like it. A minor hint is that mergeForest is a fold:
mergeForest = foldr merge []
Also, we have
prettyPrint = putStr . unlines . prettyPrint' $ forest
Nice help on the simple things.
I can't know, but it doesn't seem unreasonable that you intend to
John Ky wrote:
I can't know, but it doesn't seem unreasonable that you intend to use
the ArcForest as a trie, i.e. an efficient implementation of a set of
paths which allows to look up quickly whether a given path (here of type
[String]) is in the set or not. So, we have
For a while, I was
John Ky wrote:
I've written some code and was wondering if there was a better way to write
it in terms of readability, brevity and/or efficiency.
The function concerned is pathsToForest which takes a list of paths (ie.
[[String]]) and converts it into a tree structure where the individual