-- }}}


-- Remove, insert, replace, move etc. {{{

-- Replace

entrytree_replace_f :: Entry a => [EntryTree a] -> Loc -> (EntryTree a -> ([EntryTree a], b)) -> ([EntryTree a], b)
entrytree_replace_f (e:et) (Loc (0:[])) f = (\(fe, x) -> (fe ++ et, x)) $ f e
entrytree_replace_f :: Entry a => [EntryTree a] -> Loc -> (EntryTree a -> ([EntryTree a], b)) -> ([EntryTree a], b)
entrytree_replace_f (e:et) (Loc (0:[])) f = (\(fe, x) -> (fe ++ et, x)) $ f e
entrytree_replace_f (e:et) (Loc (0:[])) f = (\(fe, x) -> (fe ++ et, x)) $ f e