Gabriella439 / Gabriella439/turtle

Feature proposal: gfind

Open
#298 2 comments 0 reactions 0 assignees View on GitHub
Dominant language
Haskell
Stars
978
Forks
94
PR merge metrics
No merged PRs in 30d

Description

I think having a more full featured find utility would be great.

I figured I'd post a plan to get ideas before I start trying to write it. In my head it's `gfind` because it's going to implement more of the features of gnu find.

## Desired Features (a start at)

- Non-recursive use
- Depth limitation like `-maxdepth` and `-mindepth`
- File status limitation like `-cmin` and `-amin`
- File type limitation like `-type`

## Implementation concerns

A feature rich find would have a huge number of parameters most of which wouldn't be necessary for every use. So optional arguments are almost definitely necessary. I think an approach inspired by: http://neilmitchell.blogspot.ca/2008/04/optional-parameters-in-haskell.html could be useful.

To avoid namespacing issues we could use [`vinyl`](https://hackage.haskell.org/package/vinyl) records, an example might look like:

```
gfind path (chars) ((MinDepth ==: 1) :& (MaxDepth == : 1))
```

A global set of defaults can be defined by the package and the users options can be integrated with the defaults via [`rreplace`](https://hackage.haskell.org/package/vinyl-0.8.1.1/docs/Data-Vinyl-Lens.html#v:rreplace)

Any thoughts and suggestions would be appreciated.

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.