diff options
author | Determinant <ted.sybil@gmail.com> | 2017-05-31 00:32:37 -0400 |
---|---|---|
committer | Determinant <ted.sybil@gmail.com> | 2017-05-31 00:32:37 -0400 |
commit | 34d130005be780756b9c6915a7c188a756e03882 (patch) | |
tree | 4a5b1ca11e87086adc081e428561b3230abb38cb /70b-73/71.hs | |
parent | e0fff7c4014512bf88b23136dbbb426d9d9b7511 (diff) |
finish vol 8
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) |