lib.isFunction: save an attribute lookup

This commit is contained in:
Eman Resu
2026-05-14 19:28:43 -04:00
parent ec879e646e
commit 77334757d7
+5 -1
View File
@@ -1123,7 +1123,11 @@ in
isFunction : Any -> Bool
```
*/
isFunction = f: builtins.isFunction f || (f ? __functor && isFunction (f.__functor f));
isFunction =
let
isFunction = builtins.isFunction;
in
f: isFunction f || (f ? __functor && isFunction (f.__functor f));
/**
`mirrorFunctionArgs f g` creates a new function `g'` with the same behavior as `g` (`g' x == g x`)