mirror of
https://github.com/typeable/hjsonpointer.git
synced 2024-09-11 14:45:30 +03:00
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.
520 B
520 B
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"