Work on orienting positions for attachment items
This commit is contained in:
@@ -40,6 +40,34 @@ data LabelDoubleTree b a = LDT {_ldtValue :: a, _ldtLeft :: [(b,LabelDoubleTree
|
||||
,_ldtRight :: [(b,LabelDoubleTree b a)]}
|
||||
deriving (Eq,Ord,Show,Read)
|
||||
|
||||
-- I am not sure about the double use of records here
|
||||
data ContextLDT b a = TopLDT
|
||||
{ _cldtValue :: a}
|
||||
| LeftwardLDT
|
||||
{ _cldtUp :: ContextLDT b a
|
||||
, _cldtCloseLeft :: [LabelDoubleTree b a]
|
||||
, _cldtLink :: b
|
||||
, _cldtValue :: a
|
||||
, _cldtCloseRight :: [LabelDoubleTree b a]
|
||||
, _cldtFarRight :: [LabelDoubleTree b a]
|
||||
}
|
||||
| RightwardLDT
|
||||
{ _cldtUp :: ContextLDT b a
|
||||
, _cldtFarLeft :: [LabelDoubleTree b a]
|
||||
, _cldtCloseLeft :: [LabelDoubleTree b a]
|
||||
, _cldtLink :: b
|
||||
, _cldtValue :: a
|
||||
, _cldtCloseRight :: [LabelDoubleTree b a]
|
||||
}
|
||||
|
||||
-- this is not quite right, it duplicates the value when the context is at the
|
||||
-- top
|
||||
data LocationLDT b a = LocLDT
|
||||
{ _locLdtContext :: ContextLDT b a
|
||||
, _locLdtLeft :: [LabelDoubleTree b a]
|
||||
, _locLdtRight :: [LabelDoubleTree b a]
|
||||
}
|
||||
|
||||
instance Functor DoubleTree where
|
||||
fmap f (DT x l r) = DT (f x) (fmap (fmap f) l) (fmap (fmap f) r)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user