|
15 | 15 | -- Examples: |
16 | 16 | -- List the current directory recursively using the internal traversal variants. |
17 | 17 | -- |
18 | | --- >>> :{ |
19 | | --- main :: IO () |
20 | | --- main = do |
21 | | --- hSetBuffering stdout LineBuffering |
22 | | --- let path = fromJust $ Path.fromString "." |
23 | | --- #if !defined(mingw32_HOST_OS) && !defined(__MINGW32__) |
24 | | --- Stream.fold (Handle.writeChunks stdout) |
25 | | --- $ findByteChunked id path |
26 | | --- #else |
27 | | --- Stream.fold (Handle.writeWith 32000 stdout) |
28 | | --- $ reEncode |
29 | | --- $ Stream.unfoldEachEndBy 10 Array.reader |
30 | | --- $ fmap Path.toArray |
31 | | --- $ Stream.unfoldEach Unfold.fromList |
32 | | --- $ findChunked id path |
33 | | --- #endif |
34 | | --- :} |
| 18 | +-- > main :: IO () |
| 19 | +-- > main = do |
| 20 | +-- > hSetBuffering stdout LineBuffering |
| 21 | +-- > let path = fromJust $ Path.fromString "." |
| 22 | +-- > #if !defined(mingw32_HOST_OS) && !defined(__MINGW32__) |
| 23 | +-- > Stream.fold (Handle.writeChunks stdout) |
| 24 | +-- > $ findByteChunked id path |
| 25 | +-- > #else |
| 26 | +-- > Stream.fold (Handle.writeWith 32000 stdout) |
| 27 | +-- > $ reEncode |
| 28 | +-- > $ Stream.unfoldEachEndBy 10 Array.reader |
| 29 | +-- > $ fmap Path.toArray |
| 30 | +-- > $ Stream.unfoldEach Unfold.fromList |
| 31 | +-- > $ findChunked id path |
| 32 | +-- > #endif |
35 | 33 | -- |
36 | | --- >>> :{ |
37 | | --- main :: IO () |
38 | | --- main = do |
39 | | --- hSetBuffering stdout LineBuffering |
40 | | --- let path = fromJust $ Path.fromString "." |
41 | | --- Stream.fold (Handle.writeWith 32000 stdout) |
42 | | --- $ reEncode |
43 | | --- $ Stream.unfoldEachEndBy 10 Array.reader |
44 | | --- $ fmap Path.toArray |
45 | | --- $ Stream.unfoldEach Unfold.fromList |
46 | | --- $ findChunked id path |
47 | | --- :} |
| 34 | +-- > main :: IO () |
| 35 | +-- > main = do |
| 36 | +-- > hSetBuffering stdout LineBuffering |
| 37 | +-- > let path = fromJust $ Path.fromString "." |
| 38 | +-- > Stream.fold (Handle.writeWith 32000 stdout) |
| 39 | +-- > $ reEncode |
| 40 | +-- > $ Stream.unfoldEachEndBy 10 Array.reader |
| 41 | +-- > $ fmap Path.toArray |
| 42 | +-- > $ Stream.unfoldEach Unfold.fromList |
| 43 | +-- > $ findChunked id path |
48 | 44 | -- |
49 | | --- >>> :{ |
50 | | --- main :: IO () |
51 | | --- main = do |
52 | | --- hSetBuffering stdout LineBuffering |
53 | | --- let path = fromJust $ Path.fromString "." |
54 | | --- Stream.fold (Handle.writeWith 32000 stdout) |
55 | | --- $ reEncode |
56 | | --- $ Stream.unfoldEachEndBy 10 Array.reader |
57 | | --- $ fmap Path.toArray |
58 | | --- $ find id path |
59 | | --- :} |
| 45 | +-- > main :: IO () |
| 46 | +-- > main = do |
| 47 | +-- > hSetBuffering stdout LineBuffering |
| 48 | +-- > let path = fromJust $ Path.fromString "." |
| 49 | +-- > Stream.fold (Handle.writeWith 32000 stdout) |
| 50 | +-- > $ reEncode |
| 51 | +-- > $ Stream.unfoldEachEndBy 10 Array.reader |
| 52 | +-- > $ fmap Path.toArray |
| 53 | +-- > $ find id path |
60 | 54 | -- |
61 | 55 | -- Compare the above example with GNU @find@ or rust @fd@. To compare listing |
62 | 56 | -- the current directory recursively, use the following commands: |
|
0 commit comments