This function is very useful in nixpkgs, but its implementation in Nix itself is rather slow due to it requiring a lot of attribute set and list appends.
enum struct
nix-shell
settings.keepFailed