Ready for replacement of Either with bespoke data type for compo trees

This commit is contained in:
2021-11-22 12:29:22 +00:00
parent dd97ba8e5e
commit e185caf157
6 changed files with 386 additions and 0 deletions
+14
View File
@@ -0,0 +1,14 @@
{-# 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}
type SubCompTree a = Tree (ComposingNode a)
type CompTree a = Tree (Tree (ComposingNode a))
makeLenses ''ComposingNode