Skip to content
loading...

re: Universally quantified types in C# VIEW POST

TOP OF THREAD FULL DISCUSSION
re: Aren't you contradicting yourself? Shouldn't pure function always return the same result with the same input? What exactly you mean by "multiple di...

I think you're making this more complex than it needs to be. I'm just trying to create a scenario where you're passing a generic function (getWeight) to a non-generic method (SumWeights).

Are you talking about IoC / DI? ;)

Edit: Now I remember! Your solution reminds me of Service locator pattern, which is BTW an anti-pattern. That's why I found it immediately wrong.

code of conduct - report abuse