Allow for more complex placement positioning
This commit is contained in:
@@ -8,11 +8,13 @@ module Dodge.Tree.Compose
|
||||
, useAllAtEnd
|
||||
, changeToPassDown
|
||||
, overwriteLabel
|
||||
, applyToCompRoot
|
||||
) where
|
||||
import Dodge.Tree.Compose.Data
|
||||
import Dodge.Tree.Polymorphic
|
||||
import Dodge.Base
|
||||
import Data.Tree
|
||||
import Control.Lens
|
||||
|
||||
expandTree :: CompTree a -> Tree a
|
||||
expandTree (Node root extChildren) = case root of
|
||||
@@ -24,6 +26,9 @@ expandTree (Node root extChildren) = case root of
|
||||
Node (SplitDown x) xs -> Node x $ map expandTree $ zipWith Node xs
|
||||
$ map (:[]) extChildren ++ repeat []
|
||||
|
||||
applyToCompRoot :: (a -> a) -> SubCompTree a -> SubCompTree a
|
||||
applyToCompRoot f = applyToRoot (unCompose %~ f)
|
||||
|
||||
overwriteLabel :: Int -> (a -> ComposingNode a) -> SubCompTree a -> [SubCompTree a] -> SubCompTree a
|
||||
overwriteLabel i f t ts = errorHead ("tried to overwriteLabel " ++ show i)
|
||||
$ updateSingleNode islabel update t
|
||||
|
||||
Reference in New Issue
Block a user