| CARVIEW |
Select Language
HTTP/1.1 200 OK
Connection: keep-alive
Server: nginx/1.24.0 (Ubuntu)
Content-Type: text/html; charset=utf-8
Cache-Control: public, max-age=300
Content-Encoding: gzip
Via: 1.1 varnish, 1.1 varnish
Accept-Ranges: bytes
Age: 0
Date: Mon, 19 Jan 2026 02:35:21 GMT
X-Served-By: cache-dfw-ktki8620054-DFW, cache-bom-vanm7210054-BOM
X-Cache: MISS, MISS
X-Cache-Hits: 0, 0
X-Timer: S1768790122.570128,VS0,VE395
Vary: Accept, Accept-Encoding
transfer-encoding: chunked
lens-filesystem: Lens interface for your filesystem; still a bit experimental
lens-filesystem: Lens interface for your filesystem; still a bit experimental
Downloads
- lens-filesystem-0.1.0.1.tar.gz [browse] (Cabal source package)
- Package description (as included in the package)
Maintainer's Corner
For package maintainers and hackage trustees
Candidates
- No Candidates
| Versions [RSS] | 0.0.0.0, 0.1.0.0, 0.1.0.1 |
|---|---|
| Change log | ChangeLog.md |
| Dependencies | base (>=4.7 && <5), directory, filepath, lens, lens-action [details] |
| License | BSD-3-Clause |
| Copyright | 2019 Chris Penner |
| Author | Chris Penner |
| Maintainer | christopher.penner@gmail.com |
| Uploaded | by ChrisPenner at 2020-10-21T04:00:50Z |
| Category | Control |
| Home page | https://github.com/ChrisPenner/lens-filesystem |
| Bug tracker | https://github.com/ChrisPenner/lens-filesystem/issues |
| Source repo | head: git clone https://github.com/ChrisPenner/lens-filesystem |
| Distributions | |
| Downloads | 814 total (11 in the last 30 days) |
| Rating | (no votes yet) [estimated by Bayesian average] |
| Your Rating |
|
| Status | Docs uploaded by user Build status unknown [no reports yet] |
Readme for lens-filesystem-0.1.0.1
[back to package description]lens-filesystem
A lensy style interface to your filesystem.
This is pretty experimental; I wouldn't recommend using it in production code at the moment;
Using the read-only operations should be fine, but I'd strongly recommend doing lots of testing
with print before you run destructive filesystem operations.
This library is meant to be used in conjunction with the lens-action library.
The interface to this package could change at any time.
Examples:
Many of the combinators you see here come from `lens-action`.
-- Find all files in ~ or ~/config with a .vim or .conf extension
>>> "/Users/chris" ^!! including (path "config") . ls . traversed . exts ["vim", "conf"]
["/Users/chris/.vim","/Users/chris/tmux.conf","/Users/chris/config/plugins.vim"]
-- Check whether a filename is a dotfile
>>> let isDotfile = has (filename . _head . only '.')
-- Crawl a filetree according to a given fold,
-- e.g. crawl all dirs that aren't dotfiles (a.k.a. .git, .stack-work)
>>> "." ^!! crawling (ls'ed . dirs . filtered (not . isDotfile))
[ "." , "./app" , "./test" , "./src" , "./src/Control"
, "./src/Control/Lens", "./src/Control/Lens/FileSystem"]
-- Crawl ALL files in "src" collecting "*.hs" files, then make file paths absolute
>>> "src" ^!! crawled . exts ["hs"] . absolute
[ "/Users/chris/dev/lens-fs/src/Control/Lens/FileSystem/Combinators.hs"
, "/Users/chris/dev/lens-fs/src/Control/Lens/FileSystem.hs" ]
-- Find all executables in the 'scripts' directory and copy them to bin
>>> "scripts" ^! crawled . withPerms [executable] . act (`copyFile` "/Users/chris/bin")
-- Read all markdown files and get their contents with filename
>>> "./test" ^!! crawled . exts ["md"] . contents . withIndex
[("./test/data/flat/file.md","markdown\n")]
See more examples in the tests