Simplify MetaTrees
This commit is contained in:
@@ -8,13 +8,9 @@ data MetaBranch a
|
||||
= MBranch {_mbLabel :: String, _mbAttach :: a -> Maybe a, _mbTree :: MetaTree a}
|
||||
|
||||
data MetaTree a
|
||||
= MTree {_mtLabel :: String , _mtTree :: MetaTree a , _mtBranches :: [MetaBranch a] }
|
||||
| BTree {_btLabel :: String , _btValue :: a , _btBranches :: [MetaTree a] }
|
||||
|
||||
mRootLabel :: MetaTree a -> String
|
||||
mRootLabel mt = case mt of
|
||||
MTree {} -> _mtLabel mt
|
||||
BTree {} -> _btLabel mt
|
||||
= MTree {_mtLabel :: String , _mtTree :: MetaNode a , _mtBranches :: [MetaBranch a] }
|
||||
-- | BTree {_btLabel :: String , _btValue :: a , _btBranches :: [MetaTree a] }
|
||||
data MetaNode a = NodeTree {_nodeTree :: Tree a} | NodeMTree {_nodeMetaTree :: MetaTree a}
|
||||
|
||||
--type CompTree a = Tree (Tree a)
|
||||
type LabTree a = (a -> Maybe ([String],a),Tree a)
|
||||
@@ -26,4 +22,5 @@ data TreeSubLabelling = TreeSubLabelling
|
||||
makeLenses ''TreeSubLabelling
|
||||
makeLenses ''MetaTree
|
||||
makeLenses ''MetaBranch
|
||||
makeLenses ''MetaNode
|
||||
|
||||
|
||||
Reference in New Issue
Block a user