From 246ae29d6d8bcca40e94263220d6ae21214d30ea Mon Sep 17 00:00:00 2001 From: Jan Sucan Date: Wed, 20 Sep 2023 15:36:14 +0200 Subject: 9_b_1: Add solution --- ch09/9_b_1.hs | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100644 ch09/9_b_1.hs (limited to 'ch09/9_b_1.hs') diff --git a/ch09/9_b_1.hs b/ch09/9_b_1.hs new file mode 100644 index 0000000..165c609 --- /dev/null +++ b/ch09/9_b_1.hs @@ -0,0 +1,22 @@ +-- What you should pass to 'traverse' to traverse a directory tree in reverse +-- alphabetic order? + +-- ghci> :l ControlledVisit.hs +-- [1 of 1] Compiling ControlledVisit ( ControlledVisit.hs, interpreted ) +-- Ok, one module loaded. + +-- Import Data.List module for getting the 'sort' function +-- ghci> :m +Data.List + +-- Output of the following command is manually shortened and formatted for clarity +-- traverse' (reverse.sort) "test-9_b_1" +-- ghci> traverse' (reverse.sort) "test-9_b_1" +-- [Info {infoPath = "test-9_b_1/dirD/H", ...}, +-- Info {infoPath = "test-9_b_1/dirD/G", ...}, +-- Info {infoPath = "test-9_b_1/dirD", ...}, +-- Info {infoPath = "test-9_b_1/dirC/F", ...}, +-- Info {infoPath = "test-9_b_1/dirC/E", ...}, +-- Info {infoPath = "test-9_b_1/dirC", ...}, +-- Info {infoPath = "test-9_b_1/B", ...}, +-- Info {infoPath = "test-9_b_1/A", ...}, +-- Info {infoPath = "test-9_b_1", ...}] -- cgit v1.2.3