mirror of
https://github.com/typeable/hjsonpointer.git
synced 2024-10-26 16:08:30 +03:00
907156bdaf
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"