Files
loop/src/Dodge/Tree/Compose/Data.hs
T
2022-05-20 21:15:44 +01:00

23 lines
815 B
Haskell

{-# 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