Lean 4 (Meta)programming Cookbook

Normalizing a file path🔗

To normalize a file path, which means to resolve any . or .. components and remove redundant separators and make it OS-compatible, you can use the System.FilePath.normalize method.

def normalizePath (path: System.FilePath) : IO Unit := do IO.println s!"Normalized path: {path.normalize}"