Currently the constructor routers need to be written by hand. For example:
| Echo String
home :: Router r (Sitemap :- r)
home = constr0 Home (\m -> do Home <- m; return ())
echo :: Router (String :- r) (Sitemap :- r)
echo = constr1 Echo (\m -> do Echo s <- m; return s)
This needs to be generated by Template Haskell so that for users this is replaced by:
This has been fixed!
There is even a solution in terms of the generic programming package "regular".