In Servant, we don't have to do manual registering of third-party libraries because type-class instance resolution is done automatically at compile time. Since we don't have an automatically maintained registry of terms, we have to register extensions manually.
Right now every piece of middleware sugar of
Endpoint
has to be hardcoded, i.e..fragment
is hardcoded to use thefragment
middleware.If we want to build an ecosystem, then we need to be able to have users easily extend the DSL with third-party middleware.
One solution is to have users be able to customize their "distribution" of safe-api. i.e. something like
In Servant, we don't have to do manual registering of third-party libraries because type-class instance resolution is done automatically at compile time. Since we don't have an automatically maintained registry of terms, we have to register extensions manually.