This has been bugging me for a while, but I’ve never gotten around to writing something coherent about it. So I’ll just put the idea here since I’m curious if the community agrees.
I don’t like
lib.optional. I think its highly counterintuitive that it wraps the result in a list. Here’s an example of an abuse: https://github.com/NixOS/nixpkgs/commit/bbb813279055ee2563054d839ff7a2ee696a9ce7
Can’t we just use
lib.optionals instead? Yes, it requires two additional characters (
) but I think that is well worth the clarity.