Skip to content

Commit 2937899

Browse files
roberthShamrockLee
andcommitted
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>
1 parent 30809cc commit 2937899

1 file changed

Lines changed: 11 additions & 2 deletions

File tree

lib/fixed-points.nix

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -463,8 +463,17 @@ rec {
463463
# Type
464464
465465
```
466-
toExtension ::: (a | a -> a | a -> a -> a) -> a -> a -> a
467-
a = AttrSet & !Function
466+
toExtension ::
467+
b' -> Any -> Any -> b'
468+
or
469+
toExtension ::
470+
(a -> b') -> Any -> a -> b'
471+
or
472+
toExtension ::
473+
(a -> a -> b) -> a -> a -> b
474+
where b' = ! Callable
475+
476+
Set a = b = b' = AttrSet & ! Callable to make toExtension return an extending function.
468477
```
469478
470479
# Examples

0 commit comments

Comments
 (0)