Template Haskell support for generating the constructor routers #2

Closed
MedeaMelana opened this Issue Nov 23, 2010 · 1 comment

Comments

Projects
None yet
1 participant
@MedeaMelana
Owner

MedeaMelana commented Nov 23, 2010

Currently the constructor routers need to be written by hand. For example:

data Sitemap
  = Home
  | 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:

$(routeConstructors ''Sitemap)
@MedeaMelana

This comment has been minimized.

Show comment
Hide comment
@MedeaMelana

MedeaMelana Dec 7, 2010

Owner

This has been fixed!

There is even a solution in terms of the generic programming package "regular".

Owner

MedeaMelana commented Dec 7, 2010

This has been fixed!

There is even a solution in terms of the generic programming package "regular".

This issue was closed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment