Version 0.0.0.1-0 of grab-form is deprecated.
The latest version of grab-form is 0.0.0.8-1.
grab-form
Version 0.0.0.1 revision 0 uploaded by chris_martin.
Package meta
- Synopsis
- Applicative parsers for form parameter lists
- Description
Grab
is anApplicative
for consuming lists of (name, value) parameters.Example
Parser:
nameStateAndQAs :: Grab EnglishSentence (Text, Text, [QA]) nameStateAndQAs = (,,) <$> at "name" (only text) <*> at "state" (only text) <*> at "security" (only (natList (only qa))) qa :: Grab EnglishSentence QA qa = QA <$> at "Q" (only text) <*> at "A" (only text)
Input:
name: Alonzo state: Montana security[1].Q: What is your favorite hobby? security[1].A: watching cars security[2].Q: What is your oldest sibling's name? security[2].A: melman security[3].Q: What was the make and model of your first car? security[3].A: bmw x5
Output:
( "Alonzo" , "Montana" , [ QA { qa_question = "What is your favorite hobby?" , qa_answer = "watching cars" } , QA { qa_question = "What is your oldest sibling's name?" , qa_answer = "melman" } , QA { qa_question = "What was the make and model of your first car?" , qa_answer = "bmw x5" } ] )
- Author
- Chris Martin
- Bug reports
- https://github.com/typeclasses/grab/issues
- Category
- Text
- Copyright
- 2019 Typeclass Consulting, LLC
- Homepage
- https://github.com/typeclasses/grab
- Maintainer
- Chris Martin, Julie Moronuki
- Package URL
- n/a
- Stability
- n/a