I'm trying to write a wrapper around `ffprobe` that extracts `value` in JSON of the format `{"format": {"format_name": value}}`. The JSON is output by a created process. Here's what I've gotten to.

```
import System.Process
import System.Environment
import System.IO
import Text.JSON

main = do
    args <- getArgs
    (_, Just out, _, p) <- createProcess
        (proc "ffprobe" [args!!0, "-of", "json", "-show_format"])
        { std_out = CreatePipe }
    s <- hGetContents out
    --putStrLn $ show (decode s :: Result JSValue)
    --waitForProcess p
    --putStrLn $ valFromObj "format_name" format
    --    where format = valFromObj "format" rootObj
    --          (Ok rootObj) = decode s :: Result (JSObject (JSValue))
    let (Ok rootObj) = decode s :: Result (JSObject (JSValue))
    let (Ok format) = valFromObj "format" rootObj :: Result (JSObject (JSValue))
    putStrLn format_name
        where (Ok format_name) = valFromObj "format_name" format

```

It fails to compile with:

```
[1 of 1] Compiling Main             ( ffprobe.hs, ffprobe.o )

ffprobe.hs:20:59: error:
    Variable not in scope: format :: JSObject JSValue

```

I'm confused about several things, including why I can't get the last line to compile:

1. Why can't I assert for `Ok` in the `Result` after the `::`. Like `:: Result Ok JSObject JSValue`?
2. Why can't I extract the values in a where clause?
3. Why is it `Result (JSObject (JSValue))` and not `Result JSObject JSValue`?
4. Why is `format` out of scope?

I have a feeling I'm mixing the IO and Result monads together in the same `do` block or something. Is `Result` even a monad? Can I extract the value I want in a separate `do` without crapping all over the `IO` `do`?