Open roberth opened 7 months ago
https://github.com/anna328p/nix-prelude/blob/main/introspection.nix
Most of this is already possible in a hacky way using toXML
. I use it in my Nix code.
@infinisil has also written something like that in https://github.com/NixOS/nixpkgs/pull/194992
I suppose it's an extra argument for making this info available: it already is available. Of course it shouldn't have to be hacky or slow.
Is your feature request related to a problem? Please describe.
Function reflection is an important part of everyday use of the Nix language, in
callPackage
and the module system, to improve syntax and to make strict functions lazy.However, the information is too limited, creating pitfalls that "library" code such as
callPackage
can not currently compensate.Furthermore, it prevents improvements to be made without breaking compatibility:
8908
Describe the solution you'd like
Two solutions have been already been proposed:
8908
They could hardly be more different. Open design questions:
arg
,args
,ellipsis
,hasArgs
bindsAllAttrs
,args
,isOpen
,strict
Currently implemented by neither:
__functor
.Describe alternatives you've considered
functionArgs
throughcallPackage
and the module system.Additional context
Priorities
Add :+1: to issues you find important.