{-# LANGUAGE TemplateHaskell #-} {-# LANGUAGE StrictData #-} module Dodge.Tree.Compose.Data where import Data.Tree import Control.Lens data ComposingNode a = PassDown {_unCompose :: 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 SubCompTree a = Tree (ComposingNode a) type CompTree a = Tree (SubCompTree a) type LabSubCompTree a = (Tree (ComposingNode a),TreeSubLabelling) type LabCompTree a = Tree (LabSubCompTree a) data TreeSubLabelling = TreeSubLabelling { _topLabel :: String , _subLabels :: Maybe (Tree TreeSubLabelling) } makeLenses ''ComposingNode makeLenses ''TreeSubLabelling