runPropFile :: [(ObjKey, Expr)] -> IO ()
runPropFile props = do
    -- set up the environment
    let env = foldr
                 (\(key,expr) acc -> PropList.insert key expr acc) 
                 DS.defaultEnv props

    let mMain = PropList.lookup "main" env
    case mMain of
      Just expr -> do
        let eResult = doEM (makeEvalState env) (eval expr)
        case eResult of
          Left err     -> print err
          Right (_,st) -> do
            let mOut = doEM st getStdOut
            case mOut of
              Right (out, _) -> print $ fromMaybe "" out
              Left err       -> print $ show err

      Nothing -> print "No main"
runPropFile :: [(ObjKey, Expr)] -> IO ()
runPropFile props = do
    -- set up the environment
    let env = foldr
                 (\(key,expr) acc -> PropList.insert key expr acc) 
                 DS.defaultEnv props

    let mMain = PropList.lookup "main" env
    case mMain of
      Just expr -> do
        let eResult = doEM (makeEvalState env) (eval expr)
        case eResult of
          Left err     -> print err
          Right (_,st) -> do
            let mOut = doEM st getStdOut
            case mOut of
              Right (out, _) -> print $ fromMaybe "" out
              Left err       -> print $ show err

      Nothing -> print "No main"
runPropFile props = do
    -- set up the environment
    let env = foldr
                 (\(key,expr) acc -> PropList.insert key expr acc) 
                 DS.defaultEnv props

    let mMain = PropList.lookup "main" env
    case mMain of
      Just expr -> do
        let eResult = doEM (makeEvalState env) (eval expr)
        case eResult of
          Left err     -> print err
          Right (_,st) -> do
            let mOut = doEM st getStdOut
            case mOut of
              Right (out, _) -> print $ fromMaybe "" out
              Left err       -> print $ show err

      Nothing -> print "No main"