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 texts? 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

Popular posts from this blog

ios - Memory not freeing up after popping viewcontroller using ARC -

Django REST Framework perform_create: You cannot call `.save()` after accessing `serializer.data` -

Why does Go error when trying to marshal this JSON? -