1import System.IO (stdout, hSetBuffering, BufferMode(LineBuffering))
2import Streamly (aheadly, ahead, AheadT)
3import Data.Function ((&))
5import qualified Streamly.Prelude as S
6import qualified Streamly.Internal.FileSystem.Dir as Dir
8-- | List the current directory recursively using concurrent processing
12 hSetBuffering stdout LineBuffering
13 S.mapM_ print $ aheadly $ recursePath (Left ".")
17 -- XXX Fix bug in enqueueAhead when mixing serial with ahead:
18 -- (\x -> S.yield dir <> S.concatMapWith ahead recursePath x)
19 -- :: SerialT IO String
20 -- or S.cons dir . S.concatMapWith ahead recursePath
21 recursePath :: Either String String -> AheadT IO String
22 recursePath (Left dir) =
23 Dir.toEither dir -- SerialT IO (Either String String)
24 & S.map (prefixDir dir) -- SerialT IO (Either String String)
25 & S.consM (return dir)
26 . S.concatMapWith ahead recursePath -- SerialT IO String
27 recursePath (Right file) = S.yield file -- SerialT IO String
29 prefixDir :: String -> Either String String -> Either String String
30 prefixDir dir (Right x) = Right $ dir ++ "/" ++ x
31 prefixDir dir (Left x) = Left $ dir ++ "/" ++ x
keysesc to close
- j k
- move down, up
- enter
- open
- esc
- back, or up a level
- 1 2 3 4
- readme, files, commits, refs
- /
- filter
- y
- copy the clone command
- c
- compare the chosen commit with another (or shift-click both)
- ?
- show or hide this list