Move towards working implementation of attachment tree ammo

This commit is contained in:
2024-09-14 10:44:35 +01:00
parent 51e133ebc1
commit cde7bc9aef
13 changed files with 496 additions and 351 deletions
+3 -3
View File
@@ -31,12 +31,12 @@ dtToUpDownAdj f (DT x l r) = IM.insert (f x) (map g l , map g r)
where
g = f . _dtValue
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
ldtToIndentList :: LabelDoubleTree b a -> [(a,Int,LabelDoubleTreeNodeType b)]
ldtToIndentList = ldtIL LDTRootNode
ldtIL :: LabelDoubleTreeNodeType b -> LabelDoubleTree b a -> [(a,Int,LabelDoubleTreeNodeType b)]
ldtIL nt (LDT x l r) = map doindent
(concat