git.iko.soy/typeable/hjsonpointer
on 4cf8c6f help sign in
9 files changed+141−253
since splitsnapshots
unifiedsplit
.travis.yml+59−79 Example.hs+8−7 README.md+9−7 changelog.md−40 hjsonpointer.cabal+18−13 shell.nix−9 src/JSONPointer.hs → src/Data/Aeson/Pointer.hs+31−76 stack.yaml−2 test/Unit.hs+16−20
.travis.yml+59−79
@@ -1,104 +1,84 @@
1−# This Travis job script has been generated by a script via
1+# This file has been generated -- see https://github.com/hvr/multi-ghc-travis
22#
3−# runghc make_travis_yml_2.hs 'hjsonpointer.cabal'
4−#
5−# For more information, see https://github.com/hvr/multi-ghc-travis
6−
7−# NOTE: After generating comment out `cabal check`, it requires a description field.
3+# Manually modified to remove cabal check. I don't want a description field.
84
95language: c
106sudo: false
117
12−git:
13− submodules: false # whether to recursively clone submodules
14−
158cache:
169 directories:
10+ - $HOME/.cabsnap
1711 - $HOME/.cabal/packages
18− - $HOME/.cabal/store
1912
2013before_cache:
2114 - rm -fv $HOME/.cabal/packages/hackage.haskell.org/build-reports.log
22− # remove files that are regenerated by 'cabal update'
23− - rm -fv $HOME/.cabal/packages/hackage.haskell.org/00-index.*
24− - rm -fv $HOME/.cabal/packages/hackage.haskell.org/*.json
25− - rm -fv $HOME/.cabal/packages/hackage.haskell.org/01-index.cache
26− - rm -fv $HOME/.cabal/packages/hackage.haskell.org/01-index.tar
27− - rm -fv $HOME/.cabal/packages/hackage.haskell.org/01-index.tar.idx
28−
29− - rm -rfv $HOME/.cabal/packages/head.hackage
15+ - rm -fv $HOME/.cabal/packages/hackage.haskell.org/00-index.tar
3016
3117matrix:
3218 include:
33− - compiler: "ghc-8.0.2"
34− # env: TEST=--disable-tests BENCH=--disable-benchmarks
35− addons: {apt: {packages: [ghc-ppa-tools,cabal-install-head,ghc-8.0.2], sources: [hvr-ghc]}}
36− - compiler: "ghc-8.2.2"
37− # env: TEST=--disable-tests BENCH=--disable-benchmarks
38− addons: {apt: {packages: [ghc-ppa-tools,cabal-install-head,ghc-8.2.2], sources: [hvr-ghc]}}
39− - compiler: "ghc-8.4.1"
40− # env: TEST=--disable-tests BENCH=--disable-benchmarks
41− addons: {apt: {packages: [ghc-ppa-tools,cabal-install-head,ghc-8.4.1], sources: [hvr-ghc]}}
19+ - env: CABALVER=1.18 GHCVER=7.8.4
20+ compiler: ": #GHC 7.8.4"
21+ addons: {apt: {packages: [cabal-install-1.18,ghc-7.8.4], sources: [hvr-ghc]}}
22+ - env: CABALVER=1.22 GHCVER=7.10.2
23+ compiler: ": #GHC 7.10.2"
24+ addons: {apt: {packages: [cabal-install-1.22,ghc-7.10.2], sources: [hvr-ghc]}}
25+ - env: CABALVER=1.24 GHCVER=8.0.1
26+ compiler: ": #GHC 8.0.1"
27+ addons: {apt: {packages: [cabal-install-1.24,ghc-8.0.1], sources: [hvr-ghc]}}
4228
4329before_install:
44− - HC=${CC}
45− - HCPKG=${HC/ghc/ghc-pkg}
46− - unset CC
47− - ROOTDIR=$(pwd)
48− - mkdir -p $HOME/.local/bin
49− - "PATH=/opt/ghc/bin:/opt/ghc-ppa-tools/bin:$HOME/local/bin:$PATH"
50− - HCNUMVER=$(( $(${HC} --numeric-version|sed -E 's/([0-9]+)\.([0-9]+)\.([0-9]+).*/\1 * 10000 + \2 * 100 + \3/') ))
51− - echo $HCNUMVER
30+ - unset CC
31+ - export PATH=/opt/ghc/$GHCVER/bin:/opt/cabal/$CABALVER/bin:$PATH
5232
5333install:
54− - cabal --version
55− - echo "$(${HC} --version) [$(${HC} --print-project-git-commit-id 2> /dev/null || echo '?')]"
56− - BENCH=${BENCH---enable-benchmarks}
57− - TEST=${TEST---enable-tests}
58− - HADDOCK=${HADDOCK-true}
59− - INSTALLED=${INSTALLED-true}
60− - GHCHEAD=${GHCHEAD-false}
61− - travis_retry cabal update -v
62− - "sed -i.bak 's/^jobs:/-- jobs:/' ${HOME}/.cabal/config"
63− - rm -fv cabal.project cabal.project.local
64− - grep -Ev -- '^\s*--' ${HOME}/.cabal/config | grep -Ev '^\s*$'
65− - "printf 'packages: \".\"\\n' > cabal.project"
66− - cat cabal.project
67− - if [ -f "./configure.ac" ]; then
68− (cd "." && autoreconf -i);
69− fi
70− - rm -f cabal.project.freeze
71− - cabal new-build -w ${HC} ${TEST} ${BENCH} --project-file="cabal.project" --dep -j2 all
72− - cabal new-build -w ${HC} --disable-tests --disable-benchmarks --project-file="cabal.project" --dep -j2 all
73− - rm -rf .ghc.environment.* "."/dist
74− - DISTDIR=$(mktemp -d /tmp/dist-test.XXXX)
34+ - cabal --version
35+ - echo "$(ghc --version) [$(ghc --print-project-git-commit-id 2> /dev/null || echo '?')]"
36+ - if [ -f $HOME/.cabal/packages/hackage.haskell.org/00-index.tar.gz ];
37+ then
38+ zcat $HOME/.cabal/packages/hackage.haskell.org/00-index.tar.gz >
39+ $HOME/.cabal/packages/hackage.haskell.org/00-index.tar;
40+ fi
41+ - travis_retry cabal update -v
42+ - sed -i 's/^jobs:/-- jobs:/' ${HOME}/.cabal/config
43+ - cabal install --only-dependencies --enable-tests --enable-benchmarks --dry -v > installplan.txt
44+ - sed -i -e '1,/^Resolving /d' installplan.txt; cat installplan.txt
45+
46+# check whether current requested install-plan matches cached package-db snapshot
47+ - if diff -u installplan.txt $HOME/.cabsnap/installplan.txt;
48+ then
49+ echo "cabal build-cache HIT";
50+ rm -rfv .ghc;
51+ cp -a $HOME/.cabsnap/ghc $HOME/.ghc;
52+ cp -a $HOME/.cabsnap/lib $HOME/.cabsnap/share $HOME/.cabsnap/bin $HOME/.cabal/;
53+ else
54+ echo "cabal build-cache MISS";
55+ rm -rf $HOME/.cabsnap;
56+ mkdir -p $HOME/.ghc $HOME/.cabal/lib $HOME/.cabal/share $HOME/.cabal/bin;
57+ cabal install --only-dependencies --enable-tests --enable-benchmarks;
58+ fi
59+
60+# snapshot package-db on cache miss
61+ - if [ ! -d $HOME/.cabsnap ];
62+ then
63+ echo "snapshotting package-db to build-cache";
64+ mkdir $HOME/.cabsnap;
65+ cp -a $HOME/.ghc $HOME/.cabsnap/ghc;
66+ cp -a $HOME/.cabal/lib $HOME/.cabal/share $HOME/.cabal/bin installplan.txt $HOME/.cabsnap/;
67+ fi
7568
7669# Here starts the actual work to be performed for the package under test;
7770# any command which exits with a non-zero exit code causes the build to fail.
7871script:
79− # test that source-distributions can be generated
80− - (cd "." && cabal sdist)
81− - mv "."/dist/hjsonpointer-*.tar.gz ${DISTDIR}/
82− - cd ${DISTDIR} || false
83− - find . -maxdepth 1 -name '*.tar.gz' -exec tar -xvf '{}' \;
84− - "printf 'packages: hjsonpointer-*/*.cabal\\n' > cabal.project"
85− - cat cabal.project
86− # this builds all libraries and executables (without tests/benchmarks)
87− - cabal new-build -w ${HC} --disable-tests --disable-benchmarks all
88−
89− # Build with installed constraints for packages in global-db
90− - if $INSTALLED; then echo cabal new-build -w ${HC} --disable-tests --disable-benchmarks $(${HCPKG} list --global --simple-output --names-only | sed 's/\([a-zA-Z0-9-]\{1,\}\) */--constraint="\1 installed" /g') all | sh; else echo "Not building with installed constraints"; fi
91−
92− # build & run tests, build benchmarks
93− - cabal new-build -w ${HC} ${TEST} ${BENCH} all
94− - if [ "x$TEST" = "x--enable-tests" ]; then cabal new-test -w ${HC} ${TEST} ${BENCH} all; fi
95−
96− # cabal check
97− # - (cd hjsonpointer-* && cabal check)
72+ - if [ -f configure.ac ]; then autoreconf -i; fi
73+ - cabal configure --enable-tests --enable-benchmarks -v2 # -v2 provides useful information for debugging
74+ - cabal build # this builds all libraries and executables (including tests/benchmarks)
75+ - cabal test
76+ - cabal sdist # tests that a source-distribution can be generated
9877
99− # haddock
100− - rm -rf ./dist-newstyle
101− - if $HADDOCK; then cabal new-haddock -w ${HC} ${TEST} ${BENCH} all; else echo "Skipping haddock generation";fi
78+# Check that the resulting source distribution can be built & installed.
79+# If there are no other `.tar.gz` files in `dist`, this can be even simpler:
80+# `cabal install --force-reinstalls dist/*-*.tar.gz`
81+ - SRC_TGZ=$(cabal info . | awk '{print $2;exit}').tar.gz &&
82+ (cd dist && cabal install --force-reinstalls "$SRC_TGZ")
10283
103−# REGENDATA ["hjsonpointer.cabal"]
10484# EOF
Example.hs+8−7
@@ -1,26 +1,27 @@
1+{-# LANGUAGE OverloadedStrings #-}
12
23module Example where
34
4−import Control.Monad (unless)
5+import Control.Monad (unless)
56import Data.Aeson
6−import qualified JSONPointer as JP
7+import qualified Data.Aeson.Pointer as P
78
89main :: IO ()
910main = do
1011 -- JSON Pointers must either be empty or start with a /.
11− pntr1 <- case JP.unescape "/foo/0" of
12+ pntr1 <- case P.unescape "/foo/0" of
1213 Left _ -> error "Failed to construct JSON Pointer."
1314 Right pntr -> return pntr
1415
1516 -- We can also write JSON Pointers in Haskell.
16− let pntr2 = JP.Pointer [JP.Token "/"]
17+ let pntr2 = P.Pointer [P.Token "/"]
1718 -- When we do this we don't have to escape / or ~ characters
1819 -- (as ~1 and ~0 respectively) like we do in an escaped JSON
1920 -- Pointer string.
20− unless (JP.unescape "/~1" == Right pntr2) (error "ohno!")
21+ unless (P.unescape "/~1" == Right pntr2) (error "ohno!")
2122
22− print (JP.resolve pntr1 document)
23− print (JP.resolve pntr2 document)
23+ print (P.resolve pntr1 document)
24+ print (P.resolve pntr2 document)
2425
2526 where
2627 document :: Value
README.md+9−7
@@ -7,28 +7,30 @@
77# Example
88
99```haskell
10+{-# LANGUAGE OverloadedStrings #-}
11+
1012module Example where
1113
12−import Control.Monad (unless)
14+import Control.Monad (unless)
1315import Data.Aeson
14−import qualified JSONPointer as JP
16+import qualified Data.Aeson.Pointer as P
1517
1618main :: IO ()
1719main = do
1820 -- JSON Pointers must either be empty or start with a /.
19− pntr1 <- case JP.unescape "/foo/0" of
21+ pntr1 <- case P.unescape "/foo/0" of
2022 Left _ -> error "Failed to construct JSON Pointer."
2123 Right pntr -> return pntr
2224
2325 -- We can also write JSON Pointers in Haskell.
24− let pntr2 = JP.Pointer [JP.Token "/"]
26+ let pntr2 = P.Pointer [P.Token "/"]
2527 -- When we do this we don't have to escape / or ~ characters
2628 -- (as ~1 and ~0 respectively) like we do in an escaped JSON
2729 -- Pointer string.
28− unless (JP.unescape "/~1" == Right pntr2) (error "ohno!")
30+ unless (P.unescape "/~1" == Right pntr2) (error "ohno!")
2931
30− print (JP.resolve pntr1 document)
31− print (JP.resolve pntr2 document)
32+ print (P.resolve pntr1 document)
33+ print (P.resolve pntr2 document)
3234
3335 where
3436 document :: Value
changelog.md−40
@@ -1,43 +1,3 @@
1−# 1.5.0
2−
3−+ Drop QuickCheck dependency (thanks @mmhat !).
4−
5−# 1.4.0
6−
7−+ Enable GHC 8.4 (thanks @4e6 !).
8−+ Drop GHC 7.10.
9−
10−# 1.3.0
11−
12−+ Test with GHC 8.2. Drop GHC 7.8.
13−
14−# 1.2.0
15−
16−+ Track upper bounds in a Hackage revision instead of source code.
17−
18−# 1.1.1
19−
20−+ Bump aeson.
21−
22−# 1.1.0.2
23−
24−+ Raise test dep upper bounds.
25−
26−# 1.1.0.1
27−
28−+ Bump `vector`.
29−
30−# 1.1.0.0
31−
32−+ Rename the module to `JSONPointer`.
33−+ Bump aeson.
34−+ Derive `Semigroup` for `Pointer`.
35−+ Reorganize code.
36−
37−# 1.0.0.2
38−
39−+ Bump hspec.
40−
411# 1.0.0.1
422
433+ Remove HUnit dep.
hjsonpointer.cabal+18−13
@@ -1,5 +1,5 @@
11name: hjsonpointer
2−version: 1.5.0
2+version: 1.0.0.1
33synopsis: JSON Pointer library
44homepage: https://github.com/seagreen/hjsonpointer
55license: MIT
@@ -9,8 +9,6 @@ maintainer: ian@housejeffries.com
99category: Data
1010build-type: Simple
1111cabal-version: >=1.10
12−-- Rerun multi-ghc-travis (executable make-travis-yml-2) after changing:
13−Tested-With: GHC == 8.0.2, GHC == 8.2.2, GHC == 8.4.1
1412extra-source-files:
1513 changelog.md
1614 README.md
@@ -19,17 +17,21 @@ library
1917 hs-source-dirs:
2018 src
2119 default-language: Haskell2010
20+ default-extensions:
21+ OverloadedStrings
22+ other-extensions:
23+ GeneralizedNewtypeDeriving
2224 ghc-options:
2325 -Wall
2426 exposed-modules:
25− JSONPointer
27+ Data.Aeson.Pointer
2628 build-depends:
27− base >= 4.9 && < 5
28− , aeson >= 0.7
29− , hashable >= 1.2
30− , unordered-containers >= 0.2
31− , text >= 1.2
32− , vector >= 0.10
29+ aeson >= 0.7 && < 1.1
30+ , base >= 4.6 && < 4.10
31+ , QuickCheck >= 2.8 && < 2.10
32+ , unordered-containers >= 0.2 && < 0.3
33+ , text >= 1.2 && < 1.3
34+ , vector >= 0.10 && < 0.12
3335
3436test-suite unit
3537 hs-source-dirs:
@@ -42,15 +44,18 @@ test-suite unit
4244 OverloadedStrings
4345 ghc-options:
4446 -Wall
45− -fno-warn-orphans
4647 other-modules: Example
4748 build-depends:
4849 aeson
4950 , base
5051 , hjsonpointer
51− , hspec >= 2.2
52− , http-types >= 0.8
5352 , QuickCheck
5453 , unordered-containers
5554 , text
5655 , vector
56+ , hspec >= 2.2 && < 2.3
57+ , http-types >= 0.8 && < 0.10
58+
59+source-repository head
60+ type: git
61+ location: git://github.com/seagreen/hjsonpointer.git
shell.nixdeleted−9
@@ -1,9 +0,0 @@
1−{ghc}:
2−with (import <nixpkgs> {});
3−
4−haskell.lib.buildStackProject {
5− name = "none";
6− inherit ghc;
7− buildInputs = [
8− ];
9−}
src/JSONPointer.hs → src/Data/Aeson/Pointer.hsrenamed+31−76
@@ -1,44 +1,24 @@
1−{-# LANGUAGE DeriveGeneric #-}
21{-# LANGUAGE GeneralizedNewtypeDeriving #-}
3−{-# LANGUAGE OverloadedStrings #-}
42
5−module JSONPointer where
3+module Data.Aeson.Pointer where
64
75import Control.Monad (when)
86import Data.Aeson
9−import qualified Data.Hashable as HA
10−import qualified Data.HashMap.Strict as HM
11−import Data.Semigroup (Semigroup)
7+import qualified Data.HashMap.Strict as H
128import Data.Text (Text)
139import qualified Data.Text as T
1410import qualified Data.Vector as V
15−import GHC.Generics (Generic)
11+import Test.QuickCheck
1612import Text.Read (readMaybe)
1713
18−--------------------------------------------------
19−-- * Resolution
20−--------------------------------------------------
21−
22−data ResolutionError
23− = ObjectLookupFailed
24− | ArrayIndexInvalid
25− | ArrayElemNotFound
26− | ExpectedObjectOrArray
27− deriving (Eq, Show)
28−
29−resolve :: Pointer -> Value -> Either ResolutionError Value
30−resolve (Pointer []) v = Right v
31−resolve (Pointer (t:ts)) v = resolveToken t v >>= resolve (Pointer ts)
32−
33−--------------------------------------------------
34−-- * Main types and escaping
35−--------------------------------------------------
14+-- For GHCs before 7.10:
15+import Control.Applicative
16+import Data.Monoid
17+import Data.Traversable
3618
3719newtype Pointer
3820 = Pointer { _unPointer :: [Token] }
39− deriving (Eq, Show, Semigroup, Monoid, Generic)
40−
41−instance HA.Hashable Pointer
21+ deriving (Eq, Show, Monoid, Arbitrary)
4222
4323instance FromJSON Pointer where
4424 parseJSON = withText "JSON Pointer" $ \t ->
@@ -52,19 +32,13 @@ instance ToJSON Pointer where
5232-- | We don't try to distinguish between integer tokens and string
5333-- tokens since all tokens start as strings, and all tokens can
5434-- be used to resolve JSON objects.
55−--
56−-- Since these are unescaped you can write @"/"@ and @"~"@ normally.
57−-- (e.g. if you're referencing a key such as @"abc/123"@, go ahead
58−-- and write that exactly.
5935newtype Token
6036 = Token { _unToken :: Text }
61− deriving (Eq, Show, Generic)
37+ deriving (Eq, Show)
6238
63−instance HA.Hashable Token
39+instance Arbitrary Token where
40+ arbitrary = Token . T.pack <$> arbitrary
6441
65−-- | This escapes @"/"@ (because it's the token separator character).
66−--
67−-- It also escapes @"~"@ (because it's the escape character).
6842escape :: Pointer -> Text
6943escape (Pointer []) = ""
7044escape (Pointer ts) =
@@ -73,12 +47,15 @@ escape (Pointer ts) =
7347 . fmap (T.replace "/" "~1" . T.replace "~" "~0" . _unToken)
7448 $ ts
7549
50+-- * Unescaping
51+
7652data FormatError
7753 = InvalidFirstChar
7854 -- ^ JSON Pointers must either be empty or start with a @/@.
7955 | UnescapedTilde
8056 deriving (Eq, Show)
8157
58+
8259-- | JSON Pointers must either be empty or start with a @/@. This means
8360-- that if you're turning a URI Fragment into a JSON Pointer you must
8461-- drop the initial @#@.
@@ -100,40 +77,7 @@ unescape txt =
10077 Nothing -> Left UnescapedTilde
10178 Just tok -> Right tok
10279
103−--------------------------------------------------
104−-- * Wrapper Types
105−--
106−-- $ These aren't used by the rest of the library
107−-- (as explained in the docs for 'Token').
108−--
109−-- However, they might be useful if you need to distinguish JSON Pointer
110−-- tokens from plain 'Text' or 'Int' without losing information by
111−-- converting to 'Token'.
112−--------------------------------------------------
113−
114−-- | A glorified @type@ alias. If you need to do JSON Pointer operations
115−-- you're looking for 'Token' instead.
116−--
117−-- NOTE: Unlike 'Token' this is escaped.
118−newtype Key
119− = Key { _unKey :: Text }
120− deriving (Eq, Show, Generic)
121−
122−instance HA.Hashable Key
123−
124−-- | A glorified @type@ alias. If you need to do JSON Pointer operations
125−-- you're looking for 'Token' instead.
126−newtype Index
127− = Index { _unIndex :: Int }
128− deriving (Eq, Show, Generic)
129−
130−instance HA.Hashable Index
131−
132−--------------------------------------------------
133−-- * Internals
134−--------------------------------------------------
135−
136−-- | For internal use (by 'unescape').
80+-- | For internal use by 'unescape'.
13781unescapeToken :: Text -> Maybe Token
13882unescapeToken t
13983 | not (isValid t) = Nothing
@@ -149,10 +93,21 @@ unescapeToken t
14993 replace :: Text -> Text
15094 replace = T.replace "~0" "~" . T.replace "~1" "/"
15195
152−-- | For internal use (by 'resolve').
153−--
154−-- Might also be useful for specialized applications that don't
155−-- want to resolve an entire pointer at once.
96+-- * Resolution
97+
98+data ResolutionError
99+ = ObjectLookupFailed
100+ | ArrayIndexInvalid
101+ | ArrayElemNotFound
102+ | ExpectedObjectOrArray
103+ deriving (Eq, Show)
104+
105+resolve :: Pointer -> Value -> Either ResolutionError Value
106+resolve (Pointer []) v = Right v
107+resolve (Pointer (t:ts)) v = resolveToken t v >>= resolve (Pointer ts)
108+
109+-- | For internal use (or specialized applications that don't want to
110+-- resolve an entire pointer at once).
156111resolveToken :: Token -> Value -> Either ResolutionError Value
157112resolveToken tok (Array vs) =
158113 case readMaybe . T.unpack . _unToken $ tok of
@@ -163,7 +118,7 @@ resolveToken tok (Array vs) =
163118 Nothing -> Left ArrayElemNotFound
164119 Just res -> Right res
165120resolveToken tok (Object h) =
166− case HM.lookup (_unToken tok) h of
121+ case H.lookup (_unToken tok) h of
167122 Nothing -> Left ObjectLookupFailed
168123 Just res -> Right res
169124resolveToken _ _ = Left ExpectedObjectOrArray
stack.yamldeleted−2
@@ -1,2 +0,0 @@
1−resolver: lts-12.10
2−pvp-bounds: upper-revision
test/Unit.hs+16−20
@@ -1,28 +1,24 @@
1−{-# LANGUAGE GeneralizedNewtypeDeriving #-}
2−{-# LANGUAGE StandaloneDeriving #-}
31
42module Main where
53
4+import Control.Arrow
65import Data.Aeson
7−import Data.Bifunctor (first)
8−import Data.Foldable
9−import Data.Monoid
10−import Data.Text (Text)
11−import qualified Data.Text as T
12−import Data.Text.Encoding (decodeUtf8, encodeUtf8)
13−import qualified Data.Vector as V
14−import qualified JSONPointer as JP
15−import Network.HTTP.Types.URI (urlDecode)
6+import qualified Data.Aeson.Pointer as P
7+import Data.Text (Text)
8+import qualified Data.Text as T
9+import Data.Text.Encoding
10+import qualified Data.Vector as V
11+import Network.HTTP.Types.URI (urlDecode)
1612
1713import Test.Hspec
18−import Test.QuickCheck (Arbitrary(..), property)
19−
20−import qualified Example
14+import Test.QuickCheck (property)
2115
22−deriving instance Arbitrary JP.Pointer
16+-- For GHCs before 7.10:
17+import Control.Applicative
18+import Data.Foldable
19+import Data.Monoid
2320
24−instance Arbitrary JP.Token where
25− arbitrary = JP.Token . T.pack <$> arbitrary
21+import qualified Example
2622
2723main :: IO ()
2824main = hspec $ do
@@ -33,7 +29,7 @@ main = hspec $ do
3329 it "can be represented in a JSON string value" jsonString
3430 it "can be represented in a URI fragment identifier" uriFragment
3531
36−roundtrip :: JP.Pointer -> Bool
32+roundtrip :: P.Pointer -> Bool
3733roundtrip a = Just a == decode (encode a)
3834
3935jsonString :: Expectation
@@ -73,9 +69,9 @@ uriFragment = traverse_ resolvesTo . fmap (first decodeFragment) $
7369
7470resolvesTo :: (Text, Value) -> Expectation
7571resolvesTo (t, expected) =
76− case JP.unescape t of
72+ case P.unescape t of
7773 Left e -> expectationFailure (show e <> " error for pointer: " <> show t)
78− Right p -> JP.resolve p specExample `shouldBe` Right expected
74+ Right p -> P.resolve p specExample `shouldBe` Right expected
7975
8076specExample :: Value
8177specExample = object