Commit before changes to item usage using attachment tree

This commit is contained in:
2024-09-13 22:50:00 +01:00
parent 338d9e8422
commit 51e133ebc1
3 changed files with 49 additions and 46 deletions
+3
View File
@@ -34,6 +34,9 @@ dtToUpDownAdj f (DT x l r) = IM.insert (f x) (map g l , map g r)
ldtToIndentList :: LabelDoubleTree b a -> [(a,Int,LabelDoubleTreeNodeType b)]
ldtToIndentList = ldtIL LDTRootNode
ldtToIM :: (a -> Int) -> LabelDoubleTree b a -> IM.IntMap (LabelDoubleTree b a)
ldtToIM f t@(LDT x l r) = IM.insert (f x) t $ IM.unions $ map (ldtToIM f . snd) $ l <> r
ldtIL :: LabelDoubleTreeNodeType b -> LabelDoubleTree b a -> [(a,Int,LabelDoubleTreeNodeType b)]
ldtIL nt (LDT x l r) = map doindent
(concat