From 2937899befc968859611cb721c8fd958b65ee18f Mon Sep 17 00:00:00 2001 From: Robert Hensing Date: Wed, 28 Aug 2024 11:26:32 +0200 Subject: [PATCH] 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 --- lib/fixed-points.nix | 13 +++++++++++-- 1 file 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