Skip to content

aivi.path ​

aivi.path provides synchronous, pure lexical operations on path text. These functions do not access the filesystem. Use FsSource for existence checks and I/O.

The module also exports the nominal Path vocabulary type, PathSource, and PathError with InvalidPath and PathNotFound. The MVP has no public conversion between Text and Path; the lexical functions operate on Text.

API ​

ExportTypeBehavior
parentText -> Option TextReturn the containing path, if any
filenameText -> Option TextReturn the final component
stemText -> Option TextReturn the filename without its final extension
extensionText -> Option TextReturn the final extension without the dot
joinText -> Text -> TextJoin a base path and segment
isAbsoluteText -> BoolTest whether a path is absolute
normalizeText -> TextResolve . and .. lexically
aivi
use aivi.path (
    join
    normalize
)

value configPath : Text = join "/etc/demo" "app.conf"
value backupPath : Text = normalize (join "/etc/demo" "../demo/app.conf.bak")

(c) 2026 by Andreas Herd