network-uri-json 0.3.1.1 → 0.4.0.0
raw patch · 4 files changed
+110/−63 lines, 4 filesdep ~basedep ~network-arbitrarydep ~network-uri
Dependency ranges changed: base, network-arbitrary, network-uri
Files
- ChangeLog.md +9/−0
- network-uri-json.cabal +66/−47
- src/Network/URI/JSON.hs +14/−4
- test/Network/URI/JSONSpec.hs +21/−12
ChangeLog.md view
@@ -1,5 +1,14 @@ # Revision history for network-uri-json +## 0.4.0.0++* Update project structure.+* Fixing cabal outdated+* Exclude GHC 7.8.1+* Revert tested-with. Regenerate travis.yaml+* Update network-arbitraty version. Update tested-with+* Make compatible with GHC 8.8+ ## 0.3.1.1 -- 2019-02-21 * Update cabal.config for cloudbuild.
network-uri-json.cabal view
@@ -1,21 +1,28 @@ name: network-uri-json-version: 0.3.1.1-synopsis: FromJSON and ToJSON Instances for Network.URI--description:- FromJSON and ToJSON instances for Network.URI.+version: 0.4.0.0 -homepage: https://github.com/alunduil/network-uri-json-bug-reports: https://github.com/alunduil/network-uri-json/issues license: MIT license-file: LICENSE-author: Alex Brandt-maintainer: alunduil@alunduil.com+ copyright: (c) 2017 Alex Brandt++author: Alex Brandt+maintainer: alunduil@gmail.com++stability: stable++homepage: https://github.com/alunduil/network-uri-json+bug-reports: https://github.com/alunduil/network-uri-json/issues++synopsis: FromJSON and ToJSON Instances for Network.URI+description:+ FromJSON and ToJSON instances for Network.URI.+ category: Network-build-type: Simple+ cabal-version: >=1.10-tested-with: GHC >= 7.6 && < 8.2.1 || > 8.2.1 && < 9.0+build-type: Simple+tested-with: GHC >= 7.6 && < 7.8.1 || > 7.8.1 && < 8.2.1 || > 8.2.1 && < 9.0 extra-source-files: ChangeLog.md@@ -24,62 +31,74 @@ , README.md , Setup.hs -source-repository head- type: git- location: https://github.com/alunduil/network-uri-json- branch: develop- library- default-language: Haskell2010+ ghc-options:+ -Wall+ if impl(ghc >= 8) {+ ghc-options:+ -Wcompat+ } else {+ ghc-options:+ -fwarn-monomorphism-restriction+ -fwarn-tabs+ -fwarn-unused-do-bind+ } - ghc-options: -Wall -fwarn-tabs -fwarn-monomorphism-restriction- -fwarn-unused-do-bind+ default-language: Haskell2010 - hs-source-dirs:- src+ build-depends:+ aeson >= 0.8 && < 1.5+ , base >= 4.6 && < 4.14+ , network-uri >= 2.6 && < 2.8+ , text == 1.2.* exposed-modules: Network.URI.JSON other-modules: - build-depends:- aeson >= 0.8 && < 1.5- , base >= 4.6 && < 4.13- , network-uri == 2.6.*- , text == 1.2.*-- other-extensions:- OverloadedStrings+ hs-source-dirs:+ src test-suite network-uri-json-tests- default-language: Haskell2010 type: exitcode-stdio-1.0 main-is: Spec.hs - ghc-options: -Wall -fwarn-tabs -fwarn-monomorphism-restriction- -fwarn-unused-do-bind+ ghc-options:+ -Wall+ if impl(ghc >= 8) {+ ghc-options:+ -Wcompat+ } else {+ ghc-options:+ -fwarn-monomorphism-restriction+ -fwarn-tabs+ -fwarn-unused-do-bind+ } - hs-source-dirs:- src- , test+ default-language: Haskell2010 + build-depends:+ aeson >= 0.8 && < 1.5+ , base >= 4.6 && < 4.14+ , hspec >= 2.4 && < 2.8+ , network-arbitrary >= 0.3 && < 0.7+ , network-uri >= 2.6 && < 2.8+ , test-invariant == 0.4.*+ , text == 1.2.*+ other-modules: Network.URI.JSON , Network.URI.JSONSpec + hs-source-dirs:+ src+ , test+ build-tool-depends: hspec-discover:hspec-discover >= 2.4 && < 2.8 - build-depends:- aeson >= 0.8 && < 1.5- , base >= 4.6 && < 4.13- , hspec >= 2.4 && < 2.8- , network-arbitrary >= 0.3 && < 0.5- , network-uri == 2.6.*- , test-invariant == 0.4.*- , text == 1.2.*-- other-extensions:- OverloadedStrings- , RecordWildCards+source-repository head+ type: git+ location: https://github.com/alunduil/network-uri-json+ branch: develop
src/Network/URI/JSON.hs view
@@ -12,12 +12,22 @@ -} module Network.URI.JSON where -import Data.Aeson (FromJSON (parseJSON), ToJSON (toJSON), withText)-import Data.Text (unpack)-import Network.URI (parseURIReference, URI, uriToString)+import Data.Aeson ( FromJSON(parseJSON)+ , ToJSON(toJSON)+ , withText+ )+import Data.Text ( unpack )+import Network.URI ( parseURIReference+ , URI+ , uriToString+ ) instance FromJSON URI where- parseJSON = withText "URI" $ maybe (fail "invalid URI") return . parseURIReference . unpack+ parseJSON =+ withText "URI"+ $ maybe (fail "invalid URI") return+ . parseURIReference+ . unpack instance ToJSON URI where toJSON u = toJSON $ uriToString id u ""
test/Network/URI/JSONSpec.hs view
@@ -6,22 +6,31 @@ Tests for "Network.URI.JSON". -}-module Network.URI.JSONSpec (main, spec) where+module Network.URI.JSONSpec+ ( main+ , spec+ )+where -import Data.Aeson (decode, encode)-import Data.Maybe (fromJust)-import Network.URI.Arbitrary ()-import Network.URI (URI)-import Test.Hspec (describe, hspec, Spec)-import Test.Hspec.QuickCheck (prop)-import Test.Invariant ((<=>))+import Data.Aeson ( decode+ , encode+ )+import Data.Maybe ( fromJust )+import Network.URI.Arbitrary ( )+import Network.URI ( URI )+import Test.Hspec ( describe+ , hspec+ , Spec+ )+import Test.Hspec.QuickCheck ( prop )+import Test.Invariant ( (<=>) ) -import Network.URI.JSON ()+import Network.URI.JSON ( ) main :: IO () main = hspec spec spec :: Spec-spec =- describe "properties" $- prop "fromJust . decode . encode == id" (fromJust . decode . encode <=> id :: URI -> Bool)+spec = describe "properties" $ prop+ "fromJust . decode . encode == id"+ (fromJust . decode . encode <=> id :: URI -> Bool)