haskell - Yesod - converting resources to Text urls to be put in a JSON API including query parameters -
the function geturlrender
used converting route (handlersite m)
text
, through use of monads
. instance:
routetotext :: monadhandler m => route (handlersite m) -> m text routetotext url = r <- geturlrender return $ r url gettestr :: text -> handler text gettestr = routetotext (testr something)
but if want pass in query parameter? without dealing directly text
s? question, simplify type declaration of function routetotext
?
i use these urls accomplish json api specification regarding pagination, i've created abstraction work don't know how implement way put link http://example.com/articles?page=2
in concise way. if there better way put link query parameter integrating beautifully aeson
library without converting text
first, please, let me know.
Comments
Post a Comment