I'm excited about servant , and I'm fine with its internal text-level magic until it gets in the way, and the only thing that bothers me is the use of proxy type in a public API. Here is the code :
serve :: HasServer layout => Proxy layout -> Server layout -> Application serve p server = toApplication (runRouter (route p (return (RR (Right server)))))
As I understand it, proxy types are pretty simple things and are necessary for type transfer when you have no value with this type. So, why transfer a proxy medium that supports a layout type when there is already a layout type in the server type parameter? I tried cloning the repo service and changing the code:
{-
And unexpectedly for me, this will not compile (telling something about the mismatch of the layout type). But why, shouldn't my local p have the same layout type as the server (with ScopedTypeVariables enabled)?
source share