Allow for indentation of individual selection items
This commit is contained in:
@@ -10,6 +10,12 @@ import Data.Aeson
|
||||
import Data.Aeson.TH
|
||||
import Data.Bifunctor
|
||||
|
||||
data DoubleTreeNodeType
|
||||
= DTRootNode
|
||||
| DTTopNode
|
||||
| DTMidAboveNode
|
||||
| DTMidBelowNode
|
||||
| DTBottomNode
|
||||
|
||||
data DoubleTree a = DT {_dtValue :: a,_dtLeft :: [DoubleTree a],_dtRight :: [DoubleTree a]}
|
||||
deriving (Eq,Ord,Show,Read)
|
||||
@@ -21,6 +27,9 @@ data LabelDoubleTree b a = LDT {_ldtValue :: a, _ldtLeft :: [(b,LabelDoubleTree
|
||||
instance Functor DoubleTree where
|
||||
fmap f (DT x l r) = DT (f x) (fmap (fmap f) l) (fmap (fmap f) r)
|
||||
|
||||
instance Foldable DoubleTree where
|
||||
foldMap f (DT x l r) = foldMap (foldMap f) l <> f x <> foldMap (foldMap f) r
|
||||
|
||||
instance Functor (LabelDoubleTree b) where
|
||||
fmap f (LDT x l r) = LDT (f x) (fmap (second $ fmap f) l) (fmap (second $ fmap f) r)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user