-
Notifications
You must be signed in to change notification settings - Fork 328
Open
Description
I'd like to propose adding pattern matching to some of the core classes of http, primarily deconstruct_keys, to allow for matching against things like Responses and Requests.
Consider:
response in {
status: 200..299,
body: /Header I want/
}
case response
in { status: 200..299, body: } then Success(body)
in { status: 300.., body: } then Failure(body)
else Failure('unknown')
endThis is just a theoretical example and may not be 100% accurate to the API, but I wanted to run things by the core team before implementing this as it ends up being a decent amount of additional code.
It should be noted that adding the interfaces (deconstruct and deconstruct_keys) will be backward compatible, but testing it with pattern matching will not be.
havenwood
Metadata
Metadata
Assignees
Labels
No labels