diff options
Diffstat (limited to '70b-73/71.hs')
-rw-r--r-- | 70b-73/71.hs | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/70b-73/71.hs b/70b-73/71.hs new file mode 100644 index 0000000..e99c3fe --- /dev/null +++ b/70b-73/71.hs @@ -0,0 +1,6 @@ +data Tree a = Node a [Tree a] deriving (Eq, Show) + +ipl :: Tree a -> Int + +ipl = ipl' 0 + where ipl' l (Node _ xs) = l + (sum $ map (ipl' (l + 1)) xs) |