fswalk

Types

pub type Entry {
  Entry(filename: String, stat: Stat)
}

Constructors

  • Entry(filename: String, stat: Stat)
pub type EntryFilter =
  fn(Entry) -> Bool

Weak stat implementation.

pub type Stat {
  Stat(is_directory: Bool)
}

Constructors

  • Stat(is_directory: Bool)

See builder.

pub opaque type WalkBuilder(entry_filter, traversal_filter, path)

Functions

pub fn builder() -> WalkBuilder(Non, Non, Non)

Create a new WalkBuilder

pub fn each(it: Iterator(a), fun: fn(a) -> b) -> Nil

Sugar method for consuming the walk iterator instance

pub fn fold(it: Iterator(a), init: b, fun: fn(b, a) -> b) -> b

Sugar method for consuming the walk iterator instance

pub fn map(it: Iterator(a), fun: fn(a) -> b) -> Iterator(b)

Sugar method for consuming the walk iterator instance

pub fn only_dirs(ent: Entry) -> Bool

Handy EntryFilter

pub fn only_files(ent: Entry) -> Bool

Handy EntryFilter

pub fn walk(
  builder: WalkBuilder(a, b, Som),
) -> Iterator(Result(Entry, FileError))

Walks the filesystem lazily.

pub fn with_entry_filter(
  builder: WalkBuilder(a, b, c),
  entry_filter: fn(Entry) -> Bool,
) -> WalkBuilder(Som, b, c)

Create a new WalkBuilder adding an additional entry filter function.

pub fn with_path(
  builder: WalkBuilder(a, b, c),
  path: String,
) -> WalkBuilder(a, b, Som)

Create a new WalkBuilder bound to a directory path to walk

pub fn with_traversal_filter(
  builder: WalkBuilder(a, b, c),
  traversal_filter: fn(Entry) -> Bool,
) -> WalkBuilder(a, Som, c)

Create a new WalkBuilder adding an additional entry filter function.

Search Document