cabal-version: 1.18
name: network-uri-template
version: 0.1.2.0
license: AGPL-3
license-file: COPYING
maintainer: Pat Brisbin
synopsis:
Library for parsing and expanding URI Templates, as per RFC 6570
description:
As per the RFC,
.
@
For example, the following URI Template includes a form-style
parameter expression, as indicated by the "?" operator appearing
before the variable names.
.
.
http://www.example.com/foo{?query,number}
.
.
The expansion process for expressions beginning with the question-
mark ("?") operator follows the same pattern as form-style interfaces
on the World Wide Web:
.
.
http://www.example.com/foo{?query,number}
\_____________/
|
|
For each defined variable in [ 'query', 'number' ],
substitute "?" if it is the first substitution or "&"
thereafter, followed by the variable name, '=', and the
variable's value.
.
.
If the variables have the values
.
.
query := "mycelium"
number := 100
.
.
then the expansion of the above URI Template is
.
.
http://www.example.com/foo?query=mycelium&number=100
.
.
Alternatively, if 'query' is undefined, then the expansion would be
.
.
http://www.example.com/foo?number=100
.
.
or if both variables are undefined, then it would be
.
.
http://www.example.com/foo
@
.
This library handles expanding such templates.
category: Web
build-type: Simple
extra-source-files: rfc/examples.txt
extra-doc-files:
README.md
CHANGELOG.md
library
exposed-modules:
Network.URI.Template
Network.URI.Template.Expand
Network.URI.Template.Internal
Network.URI.Template.Internal.Expression
Network.URI.Template.Internal.Modifier
Network.URI.Template.Internal.Operator
Network.URI.Template.Internal.Parse
Network.URI.Template.Internal.Pretty
Network.URI.Template.Internal.TemplatePart
Network.URI.Template.Internal.VarSpec
Network.URI.Template.Parse
Network.URI.Template.VarName
Network.URI.Template.VarValue
hs-source-dirs: src
other-modules: Paths_network_uri_template
default-language: GHC2021
default-extensions:
DataKinds DeriveAnyClass DerivingStrategies DerivingVia
DuplicateRecordFields GADTs LambdaCase NoFieldSelectors
NoImplicitPrelude NoMonomorphismRestriction OverloadedRecordDot
OverloadedStrings RecordWildCards TypeFamilies QuasiQuotes
ghc-options:
-fwrite-ide-info -Weverything -Wno-all-missed-specialisations
-Wno-missed-specialisations -Wno-missing-exported-signatures
-Wno-missing-import-lists -Wno-missing-local-signatures
-Wno-missing-safe-haskell-mode -Wno-monomorphism-restriction
-Wno-prepositive-qualified-module -Wno-safe -Wno-unsafe
-optP-Wno-nonportable-include-path
build-depends:
base >=4.16.4.0 && <5,
containers >=0.6.5.1,
megaparsec >=9.2.2,
network-uri >=2.6.4.2,
prettyprinter >=1.7.0,
text >=1.2.5.0
if impl(ghc >=9.8)
ghc-options: -Wno-missing-role-annotations
if impl(ghc >=9.2)
ghc-options: -Wno-missing-kind-signatures
executable network-uri-template
main-is: Main.hs
hs-source-dirs: app
other-modules: Paths_network_uri_template
default-language: GHC2021
default-extensions:
DataKinds DeriveAnyClass DerivingStrategies DerivingVia
DuplicateRecordFields GADTs LambdaCase NoFieldSelectors
NoImplicitPrelude NoMonomorphismRestriction OverloadedRecordDot
OverloadedStrings RecordWildCards TypeFamilies QuasiQuotes
ghc-options:
-fwrite-ide-info -Weverything -Wno-all-missed-specialisations
-Wno-missed-specialisations -Wno-missing-exported-signatures
-Wno-missing-import-lists -Wno-missing-local-signatures
-Wno-missing-safe-haskell-mode -Wno-monomorphism-restriction
-Wno-prepositive-qualified-module -Wno-safe -Wno-unsafe
-optP-Wno-nonportable-include-path -threaded -rtsopts
-with-rtsopts=-N
build-depends:
base >=4.16.4.0 && <5,
containers >=0.6.5.1,
network-uri-template,
optparse-applicative >=0.18.1.0,
prettyprinter >=1.7.1,
prettyprinter-ansi-terminal >=1.1.3,
text >=1.2.5.0
if impl(ghc >=9.8)
ghc-options: -Wno-missing-role-annotations
if impl(ghc >=9.2)
ghc-options: -Wno-missing-kind-signatures
test-suite readme
type: exitcode-stdio-1.0
main-is: README.lhs
build-tool-depends: markdown-unlit:markdown-unlit
other-modules: Paths_network_uri_template
default-language: GHC2021
default-extensions:
DataKinds DeriveAnyClass DerivingStrategies DerivingVia
DuplicateRecordFields GADTs LambdaCase NoFieldSelectors
NoImplicitPrelude NoMonomorphismRestriction OverloadedRecordDot
OverloadedStrings RecordWildCards TypeFamilies QuasiQuotes
ghc-options:
-fwrite-ide-info -Weverything -Wno-all-missed-specialisations
-Wno-missed-specialisations -Wno-missing-exported-signatures
-Wno-missing-import-lists -Wno-missing-local-signatures
-Wno-missing-safe-haskell-mode -Wno-monomorphism-restriction
-Wno-prepositive-qualified-module -Wno-safe -Wno-unsafe
-optP-Wno-nonportable-include-path -pgmL markdown-unlit
build-depends:
base >=4.16.4.0 && <5,
containers >=0.6.5.1,
network-uri-template,
text >=1.2.5.0
if impl(ghc >=9.8)
ghc-options: -Wno-missing-role-annotations
if impl(ghc >=9.2)
ghc-options: -Wno-missing-kind-signatures
test-suite spec
type: exitcode-stdio-1.0
main-is: Spec.hs
hs-source-dirs: test
other-modules:
Network.URI.Template.Internal.ExpressionSpec
Network.URI.Template.Internal.TemplatePartSpec
Network.URI.Template.Internal.VarSpecSpec
Network.URI.Template.Test
Network.URI.Template.Test.RFC
Network.URI.Template.VarNameSpec
Network.URI.TemplateSpec
Paths_network_uri_template
default-language: GHC2021
default-extensions:
DataKinds DeriveAnyClass DerivingStrategies DerivingVia
DuplicateRecordFields GADTs LambdaCase NoFieldSelectors
NoImplicitPrelude NoMonomorphismRestriction OverloadedRecordDot
OverloadedStrings RecordWildCards TypeFamilies QuasiQuotes
ghc-options:
-fwrite-ide-info -Weverything -Wno-all-missed-specialisations
-Wno-missed-specialisations -Wno-missing-exported-signatures
-Wno-missing-import-lists -Wno-missing-local-signatures
-Wno-missing-safe-haskell-mode -Wno-monomorphism-restriction
-Wno-prepositive-qualified-module -Wno-safe -Wno-unsafe
-optP-Wno-nonportable-include-path -threaded -rtsopts
-with-rtsopts=-N
build-depends:
base >=4.16.4.0 && <5,
conduit >=1.3.5,
containers >=0.6.5.1,
hspec >=2.9.7,
megaparsec >=9.2.2,
network-uri-template,
text >=1.2.5.0
if impl(ghc >=9.8)
ghc-options: -Wno-missing-role-annotations
if impl(ghc >=9.2)
ghc-options: -Wno-missing-kind-signatures