Yeah, as Greg said, one reason for this is that the functions to do this in a different way weren't exposed.
But, I think for testing, we actually want to do more than just get
out the routes, we want to be able to modify the handler where requests
are running. For example, you may want to log a user in (however that
can be simulated to happen), and then run tests against that
environment. So while I agree that the current system seems not ideal, I
don't think just providing that function will be enough to replicate
the current functionality. Probably producing a lens into some state
would do it though.
(As a side note; I'm the author of the library, but I haven't used
it, or Snap, in about ~2.5 years; I'm still doing baseline maintenance,
i.e., merging pull requests and putting out Hackage releases, but if
someone wants to take over maintenance, especially if there are going to
be some redesigns to fix some of this stuff, that would be amazing...)