|
Revision 22990, 0.7 kB
(checked in by audreyt, 9 days ago)
|
|
* GHC 6.10 support, part 3 of 3: Adjust for GADT's "rigid types" restriction.
|
-
Property svn:mime-type set to
text/plain; charset=UTF-8
-
Property svn:eol-style set to
native
|
| Line | |
|---|
| 1 | {-# OPTIONS_GHC -fglasgow-exts -cpp #-} |
|---|
| 2 | |
|---|
| 3 | module Pugs.Embed.Haskell where |
|---|
| 4 | |
|---|
| 5 | -- #include "../pugs_config.h" |
|---|
| 6 | #if !defined(PUGS_HAVE_HSPLUGINS) |
|---|
| 7 | |
|---|
| 8 | import Pugs.AST |
|---|
| 9 | |
|---|
| 10 | evalHaskell :: String -> Eval Val |
|---|
| 11 | evalHaskell _ = fail "need hs-plugins for eval_haskell" |
|---|
| 12 | |
|---|
| 13 | #else |
|---|
| 14 | |
|---|
| 15 | import qualified System.Eval |
|---|
| 16 | import Pugs.AST |
|---|
| 17 | |
|---|
| 18 | evalHaskell :: String -> Eval Val |
|---|
| 19 | evalHaskell code = do |
|---|
| 20 | let imports = [] |
|---|
| 21 | -- eval_ code [import] [flags] [package.confs] [load paths] |
|---|
| 22 | -- -> IO (Either [error-strings] (Maybe a)) |
|---|
| 23 | ret <- io $ System.Eval.eval_ code imports [] [] [] |
|---|
| 24 | case ret of |
|---|
| 25 | Right (Just x) -> return $ VStr x |
|---|
| 26 | Right Nothing -> fail "Something strange happened" |
|---|
| 27 | Left x -> fail $ unlines x |
|---|
| 28 | |
|---|
| 29 | #endif |
|---|