{-# LANGUAGE TemplateHaskell #-} {-# LANGUAGE StrictData #-} module Dodge.Tree.Compose.Data where import Data.Tree import Control.Lens data ComposingNode a = SplitDown {_unCompose :: a} -- | useAll {_unCompose :: a} | UseSome {_composeIndices :: [Int], _unCompose :: a} | UseNone {_unCompose :: a} -- | useLabel {_composeIndex :: Int, _unCompose :: a} -- defaults to using no children type CompTree a = Tree (Tree a) type LabTree a = (a -> Maybe ([String],a),Tree a) type LabCompTree a = Tree (LabTree a) data TreeSubLabelling = TreeSubLabelling { _topLabel :: String , _subLabels :: Maybe (Tree TreeSubLabelling) } makeLenses ''ComposingNode makeLenses ''TreeSubLabelling