mirror of
https://github.com/mjallen18/snowfall-lib.git
synced 2026-04-18 09:05:58 -05:00
refactor: use point-free style for path utilities
Use fp.compose for get-output-name and get-directory-name to leverage existing composition utilities and adopt more idiomatic functional style. Changes: - path/default.nix: Convert to point-free using snowfall-lib.fp.compose Impact: Improved code style, more functional approach Testing: nix flake check ✓
This commit is contained in:
@@ -131,8 +131,9 @@ in
|
||||
## "bar"
|
||||
## ```
|
||||
#@ Path -> String
|
||||
get-output-name = path:
|
||||
builtins.unsafeDiscardStringContext (get-parent-directory path);
|
||||
get-output-name = snowfall-lib.fp.compose
|
||||
builtins.unsafeDiscardStringContext
|
||||
get-parent-directory;
|
||||
|
||||
## Get the directory name for flake outputs.
|
||||
## Example Usage:
|
||||
@@ -144,8 +145,9 @@ in
|
||||
## "foo"
|
||||
## ```
|
||||
#@ Path -> String
|
||||
get-directory-name = path:
|
||||
builtins.unsafeDiscardStringContext (baseNameOf path);
|
||||
get-directory-name = snowfall-lib.fp.compose
|
||||
builtins.unsafeDiscardStringContext
|
||||
baseNameOf;
|
||||
|
||||
## Get relative module path from source directory.
|
||||
## Example Usage:
|
||||
|
||||
Reference in New Issue
Block a user