| CARVIEW |
Select Language
HTTP/1.1 200 OK
Connection: keep-alive
Server: nginx/1.24.0 (Ubuntu)
Content-Type: text/html; charset=utf-8
Cache-Control: public, max-age=300
Content-Encoding: gzip
Via: 1.1 varnish, 1.1 varnish
Accept-Ranges: bytes
Age: 0
Date: Sat, 17 Jan 2026 01:08:37 GMT
X-Served-By: cache-dfw-kdfw8210147-DFW, cache-bom-vanm7210045-BOM
X-Cache: MISS, MISS
X-Cache-Hits: 0, 0
X-Timer: S1768612116.261939,VS0,VE775
Vary: Accept, Accept-Encoding
transfer-encoding: chunked
hjsonpointer: JSON Pointer library
hjsonpointer: JSON Pointer library
Deprecated
Downloads
- hjsonpointer-1.5.0.tar.gz [browse] (Cabal source package)
- Package description (revised from the package)
Note: This package has metadata revisions in the cabal description newer than included in the tarball. To unpack the package including the revisions, use 'cabal get'.
Maintainer's Corner
For package maintainers and hackage trustees
Candidates
- No Candidates
| Versions [RSS] | 0.1.0.0, 0.1.0.1, 0.2.0.0, 0.2.0.1, 0.2.0.2, 0.2.0.3, 0.2.0.4, 0.3.0.0, 0.3.0.1, 0.3.0.2, 1.0.0.0, 1.0.0.1, 1.0.0.2, 1.1.0.0, 1.1.0.1, 1.1.0.2, 1.1.1, 1.2.0, 1.3.0, 1.4.0, 1.5.0 |
|---|---|
| Change log | changelog.md |
| Dependencies | aeson (>=0.7 && <1.4), base (>=4.9 && <5), hashable (>=1.2 && <1.3), text (>=1.2 && <1.3), unordered-containers (>=0.2 && <0.3), vector (>=0.10 && <0.13) [details] |
| Tested with | ghc ==8.0.2, ghc ==8.2.2, ghc ==8.4.1 |
| License | MIT |
| Author | Ian Grant Jeffries |
| Maintainer | ian@housejeffries.com |
| Uploaded | by seagreen at 2018-09-30T18:32:26Z |
| Revised | Revision 3 made by seagreen at 2019-09-03T02:13:26Z |
| Category | Data |
| Home page | https://github.com/seagreen/hjsonpointer |
| Distributions | |
| Reverse Dependencies | 2 direct, 6 indirect [details] |
| Downloads | 16933 total (114 in the last 30 days) |
| Rating | 1.75 (votes: 1) [estimated by Bayesian average] |
| Your Rating |
|
| Status | Docs available [build log] Last success reported on 2018-09-30 [all 1 reports] |
Readme for hjsonpointer-1.5.0
[back to package description]Summary
JSON Pointer library for Haskell.
Example
module Example where
import Control.Monad (unless)
import Data.Aeson
import qualified JSONPointer as JP
main :: IO ()
main = do
-- JSON Pointers must either be empty or start with a /.
pntr1 <- case JP.unescape "/foo/0" of
Left _ -> error "Failed to construct JSON Pointer."
Right pntr -> return pntr
-- We can also write JSON Pointers in Haskell.
let pntr2 = JP.Pointer [JP.Token "/"]
-- When we do this we don't have to escape / or ~ characters
-- (as ~1 and ~0 respectively) like we do in an escaped JSON
-- Pointer string.
unless (JP.unescape "/~1" == Right pntr2) (error "ohno!")
print (JP.resolve pntr1 document)
print (JP.resolve pntr2 document)
where
document :: Value
document = object [ "foo" .= [String "bar", String "baz"]
, "/" .= String "quux"
]
Output:
Right (String "bar")
Right (String "quux")