Skip to content

Instantly share code, notes, and snippets.

@Hodapp87
Last active August 29, 2015 14:19
Show Gist options
  • Save Hodapp87/ae6b61c75001c68f90c8 to your computer and use it in GitHub Desktop.
Save Hodapp87/ae6b61c75001c68f90c8 to your computer and use it in GitHub Desktop.
Patch for Ivory (GHC 7.10)
diff --git a/Makefile b/Makefile
index db883e9..2d0807d 100644
--- a/Makefile
+++ b/Makefile
@@ -9,7 +9,6 @@ PACKAGE= \
ivory-backend-acl2 \
ivory-backend-c \
ivory-eval \
- ivory-examples \
ivory-hw \
ivory-model-check \
ivory-opts \
diff --git a/ivory-model-check/src/Ivory/ModelCheck/CVC4.hs b/ivory-model-check/src/Ivory/ModelCheck/CVC4.hs
index fa46f5c..327f011 100644
--- a/ivory-model-check/src/Ivory/ModelCheck/CVC4.hs
+++ b/ivory-model-check/src/Ivory/ModelCheck/CVC4.hs
@@ -218,7 +218,7 @@ instance Concrete Expr where
args' = B.unwords $ intersperse "," (map concrete args)
concrete (Store s e) = v <> " WITH " <> f <> " := " <> concrete e
where
- (v,f) = B.break (`elem` ".[") (concrete s)
+ (v,f) = B.break (`elem` (".[" :: String)) (concrete s)
-- concrete (Store a i e) = concrete a <> " WITH "
-- <> B.concat (map concrete i)
-- <> " := " <> concrete e
@@ -226,7 +226,8 @@ instance Concrete Expr where
= concrete a <> " WITH " <>
B.intercalate ", " [ f <> " := " <> concrete e
| (i,e) <- ies
- , let f = B.dropWhile (not . (`elem` ".[")) (concrete i)
+ , let f = B.dropWhile (not . (`elem` (".[" :: String)))
+ (concrete i)
]
concrete (Field f e) = concrete e <> "." <> concrete f
concrete (Index i e) = concrete e <> "[" <> concrete i <> "]"
diff --git a/ivory-opts/src/Ivory/Opts/CSE.hs b/ivory-opts/src/Ivory/Opts/CSE.hs
index 7b4e4de..9050ea7 100644
--- a/ivory-opts/src/Ivory/Opts/CSE.hs
+++ b/ivory-opts/src/Ivory/Opts/CSE.hs
@@ -1,4 +1,5 @@
{-# OPTIONS_GHC -fno-warn-orphans #-}
+{-# LANGUAGE FlexibleContexts #-}
{-# LANGUAGE DeriveFoldable #-}
{-# LANGUAGE DeriveFunctor #-}
{-# LANGUAGE DeriveTraversable #-}
diff --git a/ivory/src/Ivory/Language/Coroutine.hs b/ivory/src/Ivory/Language/Coroutine.hs
index e89299f..8637b8c 100644
--- a/ivory/src/Ivory/Language/Coroutine.hs
+++ b/ivory/src/Ivory/Language/Coroutine.hs
@@ -1,4 +1,6 @@
{-# LANGUAGE DataKinds #-}
+{-# LANGUAGE FlexibleContexts #-}
+{-# LANGUAGE AllowAmbiguousTypes #-}
{-# LANGUAGE RankNTypes #-}
{-# LANGUAGE RecordWildCards #-}
{-# LANGUAGE ScopedTypeVariables #-}
diff --git a/ivory/src/Ivory/Language/Syntax/AST.hs b/ivory/src/Ivory/Language/Syntax/AST.hs
index c46727c..9f67515 100644
--- a/ivory/src/Ivory/Language/Syntax/AST.hs
+++ b/ivory/src/Ivory/Language/Syntax/AST.hs
@@ -1,4 +1,5 @@
{-# LANGUAGE TemplateHaskell #-}
+{-# LANGUAGE CPP #-}
{-# OPTIONS_GHC -fno-warn-orphans #-}
module Ivory.Language.Syntax.AST where
@@ -440,8 +441,10 @@ deriveLiftMany
, ''Expr, ''ExpOp, ''Literal, ''Init
]
+#if __GLASGOW_HASKELL__ < 709
instance Lift Double where
lift = lift . toRational
instance Lift Float where
lift = lift . toRational
+#endif
diff --git a/ivory/src/Ivory/Language/Syntax/Concrete/QQ/ProcQQ.hs b/ivory/src/Ivory/Language/Syntax/Concrete/QQ/ProcQQ.hs
index 43c46fa..feaf654 100644
--- a/ivory/src/Ivory/Language/Syntax/Concrete/QQ/ProcQQ.hs
+++ b/ivory/src/Ivory/Language/Syntax/Concrete/QQ/ProcQQ.hs
@@ -20,6 +20,7 @@ import qualified Ivory.Language.Proc as I
import Ivory.Language.Syntax.Concrete.ParseAST
+import Ivory.Language.Syntax.Concrete.QQ.Common
import Ivory.Language.Syntax.Concrete.QQ.CondQQ
import Ivory.Language.Syntax.Concrete.QQ.StmtQQ
import Ivory.Language.Syntax.Concrete.QQ.TypeQQ
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment