Extend err_if_nil#1
Conversation
|
Hey James, thanks for the contribution! You’ve run into an issue with this function that was on my radar, but I’m going to try to convince you that this is the wrong way to think about it. I can see the path that led here - some component considers Firstly I would say that there are some smells here - we’ve ended up with a lot of function heads, and more importantly, we’ve ended up with a lack of type clarity. Before, we had a function which, to cobble syntax from other languages, looked like
But now it’s that and
Really it’s two different functions in a trenchcoat, choosing different behaviour depending on the input. A core design goal of this library is to automatically improve type clarity in the vicinity of its use. By typically only acting on certain types (and raising The real issue here is that it’s badly named. Most functions in the Meanwhile, the behaviour sought by this PR can already be obtained by |
|
Renaming |
Found myself wanting to use this just now.