grab-form: Applicative parsers for form parameter lists

[ library, mit, text ] [ Propose Tags ]

Grab is an Applicative for consuming lists of (name, value) parameters.



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 =
        <$> at "Q" (only text)
        <*> at "A" (only text)


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


( "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"
Versions [faq],, (info)
Change log
Dependencies base (>=4.12 && <4.14), containers (==0.6.*), grab, text (==1.2.*) [details]
License MIT
Copyright 2019 Typeclass Consulting, LLC
Author Chris Martin
Maintainer Chris Martin, Julie Moronuki
Category Text
Home page
Bug tracker
Uploaded by chris_martin at 2020-03-15T06:36:35Z
Distributions NixOS:
Downloads 473 total (3 in the last 30 days)
Rating 2.0 (votes: 1) [estimated by Bayesian average]
Your Rating
  • λ
  • λ
  • λ
Status Hackage Matrix CI
Docs available [build log]
Last success reported on 2020-03-15 [all 1 reports]


[Index] [Quick Jump]


Maintainer's Corner

For package maintainers and hackage trustees