type Msg = Foo Int (Result Http.Error ValidResponse)
Now I noticed that you already solved your problem. This is a nice way, but if I would need this information later, I would store in the model instead of passing in the first parameter. But you did right for your case
The problem is that this does not work: http requests are asynchronous, so you cannot control when a response is received, so you cannot match a state in your model against a randomly incoming response. It might be a delayed and stale response.