summaryrefslogtreecommitdiff
blob: d168f032b92f6d1e30b89576267d61ce9e838c48 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
--- epic-0.9.3-orig/Epic/Language.lhs	2012-02-28 10:44:29.000000000 +1100
+++ epic-0.9.3/Epic/Language.lhs	2012-09-14 16:20:29.841939337 +1000
@@ -1,9 +1,14 @@
-> {-# LANGUAGE FlexibleInstances, MultiParamTypeClasses,
+> {-# LANGUAGE FlexibleInstances, MultiParamTypeClasses, CPP,
 > FunctionalDependencies #-}
 
 > module Epic.Language where
 
 > import Control.Monad
+#if MIN_VERSION_base(4,6,0)
+> import Control.Exception.Base
+#endif
+
+
 > import System.IO
 > import System.Directory
 > import System.Environment
@@ -379,7 +384,13 @@
 > environment :: String -> IO (Maybe String)
 > environment x = catch (do e <- getEnv x
 >                           return (Just e))
->                       (\_ -> return Nothing)
+#if MIN_VERSION_base(4,6,0)
+>                           (\y-> do return (y::SomeException);  return Nothing)  
+#endif
+> 
+#if !MIN_VERSION_base(4,6,0)
+>                           (\_->  return Nothing)  
+#endif  
 
 Some tests
 
--- epic-0.9.3-orig/Epic/CodegenC.lhs	2012-02-28 10:44:29.000000000 +1100
+++ epic-0.9.3/Epic/CodegenC.lhs	2012-09-14 16:13:48.061329048 +1000
@@ -1,3 +1,4 @@
+> {-#LANGUAGE FlexibleContexts#-}
 > module Epic.CodegenC where
 
 > import Control.Monad.State
@@ -98,10 +99,11 @@
 >       if (x>max) then put x else return ()
 
 >    cgs [] = return ""
+
 >    cgs (x:xs) = do xc <- cg x
 >                    xsc <- cgs xs
 >                    return $ xc ++ "\n" ++ xsc
-
+>    cg::  (MonadState Int m) => ByteOp -> m [Char]
 >    cg (CALL t fn args) = return $ tmp t ++ " = " ++ quickcall fn ++ 
 >                          targs "(" args ++ ");"
 >    cg (TAILCALL t fn args)