mirror of
https://github.com/typeable/hjsonpointer.git
synced 2024-08-17 02:20:23 +03:00
JSON Pointer library for Haskell
Fix mistake in resolveRefTok. Split errors over two types. Switch the order of pointer and value arguments for functions that take both. The pointer now comes first. |
||
---|---|---|
src/Data | ||
tests | ||
changelog.txt | ||
hjsonpointer.cabal | ||
MIT-LICENSE.txt | ||
README.md | ||
Setup.hs |
Summary
JSON Pointer library for Haskell.
Example
{-# LANGUAGE OverloadedStrings #-}
module Main where
import Data.Aeson
import qualified Data.HashMap.Strict as H
import Data.JsonPointer
main :: IO ()
main =
case jsonPointer "/foo" of
Left e -> print e
Right pntr ->
case resolvePointer pntr (Object $ H.singleton "foo" $ String "bar") of
Left e2 -> print e2
Right v -> print v
Output:
String "bar"