summaryrefslogtreecommitdiff
path: root/70b-73/71.hs
diff options
context:
space:
mode:
authorDeterminant <ted.sybil@gmail.com>2017-05-31 00:32:37 -0400
committerDeterminant <ted.sybil@gmail.com>2017-05-31 00:32:37 -0400
commit34d130005be780756b9c6915a7c188a756e03882 (patch)
tree4a5b1ca11e87086adc081e428561b3230abb38cb /70b-73/71.hs
parente0fff7c4014512bf88b23136dbbb426d9d9b7511 (diff)
finish vol 8
Diffstat (limited to '70b-73/71.hs')
-rw-r--r--70b-73/71.hs6
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)