1
0
forked from GitHub/gf-core

peel head i ; gt nometas ; gf2hs

This commit is contained in:
aarne
2004-05-18 20:57:13 +00:00
parent 086733a6fe
commit 8963681a3b
14 changed files with 208 additions and 35 deletions

View File

@@ -180,3 +180,9 @@ changeRoot f loc = case loc of
chPath pv = case pv of
(Top,a) -> (Top, f a)
(Node (left,pv,right),v) -> (Node (left, chPath pv,right),v)
nthSubtree :: Int -> Tr a -> Err (Tr a)
nthSubtree n (Tr (a,ts)) = ts !? n
arityTree :: Tr a -> Int
arityTree (Tr (_,ts)) = length ts