[web-devel] A few questions about Yesod
Iustin Pop
iustin at google.com
Thu Dec 30 12:01:24 CET 2010
Hi all,
I just started looking at Yesod and its associated libs (hamlet, etc.)
and it is very interesting, thanks.
However, I'm confused by a few things and the docs are not helping, so
please bear my beginner questions.
First: hamlet uses '.' as function application, instead of the usual
space. How can I then use a qualified name (e.g. Data.List.nub)? If I
use it normally, it errors out on me. Must be something very trivial but
I cannot find a way.
Second: Yesod.Json says “Due to the limited nature of the JSON format,
you can create any valid JSON document you wish using only jsonScalar,
jsonList and jsonMap”. This seems false to me, as jsonScalar only deals
with JSON strins, and not JSON numbers or the constants (true, false,
null). In the meantime I'm using a hack for numbers using jsonRaw, but I
think some more functionality needs to be added to it for non-trivial
usage.
And last: I don't understand how runDB and the persistent framework is
supposed to do error handling. Case in point: let's say one tries to
insert a duplicate unique key in a table, which fails as expected "user
error (SQLite3 returned ErrorConstraint while attempting to perform
step.)". The problem is any other use of that particular REST resource,
even with different parameters, results in "user error (SQLite3 returned
ErrorMisuse while attempting to perform bind text.)", and I don't know
if this is due to my usage of the framework or due to something else.
The interesting part is that other resources are working fine.
Thanks again,
iustin
More information about the web-devel
mailing list