Show
Ignore:
Timestamp:
04/20/05 18:08:24 (4 years ago)
Author:
theorbtwo
svk:copy_cache_prev:
3669
Message:

Return useful error message.

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • src/Pugs/Embed/Haskell.hs

    r2158 r2159  
    1313import qualified Eval 
    1414 
     15{- Return is either (left) an error message, or (right) the return of the 
     16eval) -} 
    1517evalHaskell :: String -> IO (Either String String) 
    1618evalHaskell code = do 
     
    1820    -- eval_ code [import] [flags] [package.confs] [load paths] 
    1921    --   -> IO (Either [error-strings] (Maybe a)) 
    20     ret <- Eval.eval code imports 
     22    ret <- Eval.eval_ code imports [] [] [] 
    2123    case ret of 
    22         Just x  -> return $ Right x 
    23         Nothing -> return $ Left "Couldn't eval haskell code" 
     24        Right (Just x) -> return $ Right x 
     25        Right Nothing  -> return $ Left "Something strange happened" 
     26        Left x         -> return $ Left $ unlines x 
    2427 
    2528#endif