Deriving PathInfo class in web routes?

Posted by drozzy on Stack Overflow See other posts from Stack Overflow or by drozzy
Published on 2012-06-24T15:11:54Z Indexed on 2012/06/24 15:15 UTC
Read the original article Hit count: 238

Filed under:
|

I am reading the web-routes tutorial in Happstack, and I have no idea what this is doing:

$(derivePathInfo ''Sitemap)

class PathInfo a where
  toPathSegments :: a -> [String]
  fromPathSegments :: URLParser a

The doc simply says:

we use template-haskell to derive an instance of PathInfo for the Sitemap type.

but where does it "store" it? I thought haskell had no state, and is PathInfo our own thing, or is it part of happstack?

If someone could explain this, for dummies? Thanks.

© Stack Overflow or respective owner

Related posts about haskell

Related posts about happstack