Yes, I can see that. What I was looking for is instead a function that says
"take the string you give me and give me a Json.Value."
It looks like my only alternative is instead to create the Json.Value out
of a complex nested structure of Json.Encode.object, and corresponding Elm
tuples,
Spoke too soon; that doesn't work. For example:
> foo = Json.Encode.string "[]"
"[]" : Json.Encode.Value
> bar = Json.Decode.decodeValue (Json.Decode.list Json.Decode.string) foo
Err "Expecting a List but instead got: \"[]\""
: Result.Result String (List String)
On Friday, July 29, 2016
To answer my own question -- it looks like Native.Json has an identity
function which does just what I want, but which I can't import. However, it
also looks like many of Json.Encode's functions just call
Native.Json.identity. So this works:
data = Encode.string complicatedNestedJson
On