Question: How can I express the following without the nested case statements? Specifically, I would like to do the steps in order, and call fail if any of the steps hit the "bad" branch. 

```
loadData :: IO [Market]
loadData = do
  filedata <- B.readFile "markets.json"
  case parseData filedata of
    Left err -> fail err
    Right v -> do
      case fromJSON v of
        Error err -> fail err
        Success a -> return a

```

Answer: 
You probably want the exception monad transformer here. Something like this (utterly untested):

```
import Control.Monad.Trans
import Control.Monad.Except

type MyMonadStack a = ExceptT String IO a

loadData :: MyMonadStack [Market]
loadData = do filedata <- lift $ B.readFile "markets.json"
              v <- ExceptT $ parseData filedata
              a <- ExceptT $ toEither $ fromJSON v
              return a

toEither :: WhateverTypeFromJSONReturns a b -> Either a b
toEither (Error a) = Left a
toEither (Success b) = Right b

```
If `parseData` and `fromJSON` both have `Either Err a` as their codomain, where `Err` is a fixed type (maybe defined by you), then you can use the `Either e` monad instance like so:

```
loadData :: IO (Either Err [Market])
loadData = do
  filedata <- B.readFile "markets.json"
  return $ parseData filedata >>= fromJSON

```

Or, if you want to be extra slick, you can use a particular [monad transformer](http://hackage.haskell.org/package/either-3.0.2) to do the same thing.