diff options
Diffstat (limited to 'src/GF/Data')
| -rw-r--r-- | src/GF/Data/Zipper.hs | 6 |
1 files changed, 6 insertions, 0 deletions
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 |
