readDagFromFile :: FilePath -> IO (Either String T.TADag)
readDagFromFile filename = case takeExtension filename of
    ".plan" -> do
        -- FIXME This function is a mess, does an unchecked fromJust, which
        -- easily fails.
        Just dag <- decode <$> BL.readFile filename

        return $ return dag

    format ->
        return $ throwError $ "unkown file format '" ++ format ++ "'"
readDagFromFile :: FilePath -> IO (Either String T.TADag)
readDagFromFile filename = case takeExtension filename of
    ".plan" -> do
        -- FIXME This function is a mess, does an unchecked fromJust, which
        -- easily fails.
        Just dag <- decode <$> BL.readFile filename

        return $ return dag

    format ->
        return $ throwError $ "unkown file format '" ++ format ++ "'"
readDagFromFile filename = case takeExtension filename of
    ".plan" -> do
        -- FIXME This function is a mess, does an unchecked fromJust, which
        -- easily fails.
        Just dag <- decode <$> BL.readFile filename

        return $ return dag

    format ->
        return $ throwError $ "unkown file format '" ++ format ++ "'"