The current internal representation is not very ergonomic at all. For example:
const endpoint: SafeAPI.Endpoint<{ id: string }, Foo> = new SafeAPI.Snoc({
previous: new SafeAPI.Snoc({
previous: new SafeAPI.Nil(),
middleware: new SafeAPI.Fragment("/getFoo")
}),
middleware: new SafeAPI.QueryParams({ id: new StringRep() })
});
Users should have a more ergonomic representation that fulfills the following requirements:
doesn't incur another level of indentation for each middleware in the stack
The current internal representation is not very ergonomic at all. For example:
Users should have a more ergonomic representation that fulfills the following requirements: