Changeset 2159 for src/Pugs/Embed/Haskell.hs
- Timestamp:
- 04/20/05 18:08:24 (4 years ago)
- svk:copy_cache_prev:
- 3669
- Files:
-
- 1 modified
-
src/Pugs/Embed/Haskell.hs (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
src/Pugs/Embed/Haskell.hs
r2158 r2159 13 13 import qualified Eval 14 14 15 {- Return is either (left) an error message, or (right) the return of the 16 eval) -} 15 17 evalHaskell :: String -> IO (Either String String) 16 18 evalHaskell code = do … … 18 20 -- eval_ code [import] [flags] [package.confs] [load paths] 19 21 -- -> IO (Either [error-strings] (Maybe a)) 20 ret <- Eval.eval code imports22 ret <- Eval.eval_ code imports [] [] [] 21 23 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 24 27 25 28 #endif
