From 1ac6c89b645e09d545cfbd76dc2bbae91184df40 Mon Sep 17 00:00:00 2001 From: "carpentry-heartbeat[bot]" Date: Mon, 29 Jun 2026 09:17:26 +0200 Subject: [PATCH] Fix filename doc: empty path returns Just "", not Nothing MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The docstring claimed filename returns Nothing for an empty path, but it returns (Just "") — split always yields at least one component, so the result is never Nothing. The existing test already asserts this behaviour. --- path.carp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/path.carp b/path.carp index b44bfaf..ff57372 100644 --- a/path.carp +++ b/path.carp @@ -78,7 +78,7 @@ As such, it is the inverse to [split](#split).") (doc filename "gets the filename of the path `p` as a `(Maybe String)`. -It will return `Nothing` if an empty string is passed.") +For an empty path, the result is `Just` of an empty string, never `Nothing`.") (defn filename [p] (Array.last &(split p))) (doc basename "gets the basename of the path `p`.") (defn basename [p]