New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Newbie questions #10
Comments
pokeForm :: Monad m => Form Text m Pokemon
pokeForm = liftA2 (\name number -> Pokemon { pokemonName = name, pokemonNumber = number})
("name" .: nonEmptyText)
("number" .: parseInteger)
where
nonEmptyText = check "Name cannot be empty" (not . T.null) $ text Nothing |
Something like that. What's an easier way to write it?
|
You can do exactly that if you enable |
Does that mean I can't do a monadic operation like uniqueness checks against a DB in this validation layer? |
There is no |
So, would it be this:
|
No, because |
I actually want to raise a PR to make the docs better with examples of common use-cases. |
Ok, then it probably wants to be for digestive-functors itself, but I'll
happily take docs patches here too!
…On Wed, 8 Feb 2017, 4:48 pm Saurabh Nanda, ***@***.***> wrote:
I actually want to raise a PR to make the docs better with examples of
common use-cases.
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#10 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AABRjrRdY8eqRW3lvjN5HseYOwTr_e3Nks5rafHvgaJpZM4LZu-X>
.
|
I'm struggling with validating an incoming JSON (newbie alert!).
""
as the first argument todigestJSON
Form v m a
is being constructed using the record constructor and not the tuple constructor?The text was updated successfully, but these errors were encountered: