diff options
author | Robert Hensing | 2024-08-28 11:26:32 +0200 |
---|---|---|
committer | Yueh-Shun Li | 2024-09-14 20:56:49 +0800 |
commit | 2937899befc968859611cb721c8fd958b65ee18f (patch) | |
tree | 9c269c1e61870edf7470fc55a69f82f81b81e12e /lib | |
parent | 30809ccecd64b3274e029af552a6f89512c9f624 (diff) |
lib.fixedPoints.toExtension: Improve type
This makes the type more informative and general - closer to how the function behaves, particularly in isolation. Co-authored-by: Yueh-Shun Li <shamrocklee@posteo.net>
Diffstat (limited to 'lib')
-rw-r--r-- | lib/fixed-points.nix | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/lib/fixed-points.nix b/lib/fixed-points.nix index ecacddadb94b..13a4e8d2b118 100644 --- a/lib/fixed-points.nix +++ b/lib/fixed-points.nix @@ -463,8 +463,17 @@ rec { # Type ``` - toExtension ::: (a | a -> a | a -> a -> a) -> a -> a -> a - a = AttrSet & !Function + toExtension :: + b' -> Any -> Any -> b' + or + toExtension :: + (a -> b') -> Any -> a -> b' + or + toExtension :: + (a -> a -> b) -> a -> a -> b + where b' = ! Callable + + Set a = b = b' = AttrSet & ! Callable to make toExtension return an extending function. ``` # Examples |