From 8963681a3b821e85185877dd61b7804661fc5c24 Mon Sep 17 00:00:00 2001 From: aarne Date: Tue, 18 May 2004 20:57:13 +0000 Subject: peel head i ; gt nometas ; gf2hs --- src/GF/Data/Zipper.hs | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'src/GF/Data') diff --git a/src/GF/Data/Zipper.hs b/src/GF/Data/Zipper.hs index a696f1cae..e63743b06 100644 --- a/src/GF/Data/Zipper.hs +++ b/src/GF/Data/Zipper.hs @@ -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 \ No newline at end of file -- cgit v1.2.3