packages feed

grab-form-0.0.0.7: grab-form.cabal

cabal-version: 3.0

name: grab-form
version: 0.0.0.7

synopsis: Applicative parsers for form parameter lists
category: Text

description:
    @Grab@ is an @Applicative@ 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"
    >       }
    >   ]
    > )

homepage:    https://github.com/typeclasses/grab
bug-reports: https://github.com/typeclasses/grab/issues

author:     Chris Martin
maintainer: Chris Martin, Julie Moronuki

copyright: 2021 Mission Valley Software LLC
license: MIT
license-file: license.txt

extra-source-files:
    changelog.md

common base
    default-language: Haskell2010
    build-depends:
        base ^>= 4.12 || ^>= 4.13 || ^>= 4.14 || ^>= 4.15 || ^>= 4.16

library
    import: base
    hs-source-dirs: src
    exposed-modules: Data.GrabForm

    build-depends:
        containers ^>= 0.6
      , grab
      , text ^>= 1.2

test-suite hedgehog
    import: base
    type: exitcode-stdio-1.0
    hs-source-dirs: test
    main-is: hedgehog.hs

    build-depends:
        containers ^>= 0.6
      , grab
      , grab-form
      , hedgehog ^>= 0.6 || ^>= 1.0 || ^>= 1.1
      , text ^>= 1.2

    other-modules:
        Test.Tutorial
      , Test.OrgRoster.Concepts
      , Test.OrgRoster.Grabs
      , Test.OrgRoster.Tests