Laziness as how it is implemented by this package is just a lazy construction of lists. Tree is still defined as type Tree a = Tree a (Forest a). The thing which is different is Forest which is defined as type alias Forest a = Lazy (List (Tree a)) instead of type alias Forest = List (Tree a) and as such sub-trees aren’t evaluated if they aren’t needed.
Not sure how much I understand your use-case but I believe it is almost like the example in README - just includes animation which should be simple to add imho.
In example sub-trees are evaluated only in cases here parent is opened (Tuple.first --> True). This part is just updating item in zipper and view is calling evaluation of forest only for open items.
One problem with strict evaluation is that it’s danger (can go to too much recursion) and slow (exponential). Defining RoseTree in Haskell is easier due to the laziness of the language.
Of course, this all depends on the amount of data you’re dealing with. In our case, we have 4192 items in the tree and those items might have more than one parent so the tree has over 4192 nodes.
I’ve just tested tomjkidd/elm-multiway-tree-zipper within our app quickly to get the feel of its API. It takes over 3s to construct the tree. For different data it fails because construction I’ve hacked together isn’t tail recursive optimized. In comparison with Lazy I got 50ms.
strict:
lazy:
Strict version still makes quite some sense in situations where there are not that much data but for building big Trees is quite slow.
(Tested on Arch Linux, AMD Ryzen 1800x (16 thread 3.6GHz), 32GB RAM, Chromium)