From 7db9ec2f24eddee0802a8f598e42bc8d5ff95c73 Mon Sep 17 00:00:00 2001 From: Mathieu Boespflug Date: Sun, 15 Nov 2015 19:58:48 +0100 Subject: [PATCH 1/2] Switch to LTS-3.13. --- etc/Dockerfile | 2 +- stack.yaml | 8 +------- 2 files changed, 2 insertions(+), 8 deletions(-) diff --git a/etc/Dockerfile b/etc/Dockerfile index ec7699a5..0adfaf82 100644 --- a/etc/Dockerfile +++ b/etc/Dockerfile @@ -1,4 +1,4 @@ -FROM fpco/stack-build:lts-2.14 +FROM fpco/stack-build:lts-3.13_20151112 MAINTAINER Mathieu Boespflug # Install system dependencies. diff --git a/stack.yaml b/stack.yaml index dbefdd8c..30b867f2 100644 --- a/stack.yaml +++ b/stack.yaml @@ -3,13 +3,7 @@ packages: - H - IHaskell - inline-r -resolver: lts-2.14 -extra-deps: -- ihaskell-0.6.4.0 -- ihaskell-blaze-0.3.0.0 -- ghc-parser-0.1.7.0 -- ipython-kernel-0.6.1.0 -- system-argv0-0.1.1 +resolver: lts-3.13 docker: # Disabled by default. Use --docker on command line to enable. From 681f8f7eecacec152a01a9d0dcbaa21ab223850f Mon Sep 17 00:00:00 2001 From: Mathieu Boespflug Date: Sun, 15 Nov 2015 21:58:55 +0100 Subject: [PATCH 2/2] Silence GHC 7.10 warnings. --- IHaskell/src/IHaskell/Display/InlineR.hs | 1 + examples/RelaxWithNM.hs | 1 + examples/fib/Fib.hs | 1 + inline-r/tests/Test/Vector.hs | 2 +- inline-r/tests/test-qq.hs | 5 +++-- inline-r/tests/tests.hs | 7 ++++--- 6 files changed, 11 insertions(+), 6 deletions(-) diff --git a/IHaskell/src/IHaskell/Display/InlineR.hs b/IHaskell/src/IHaskell/Display/InlineR.hs index becfe9b4..d22143e0 100644 --- a/IHaskell/src/IHaskell/Display/InlineR.hs +++ b/IHaskell/src/IHaskell/Display/InlineR.hs @@ -27,6 +27,7 @@ import System.IO (hClose) import System.IO.Temp (withSystemTempFile) import qualified Text.Blaze.Html5 as BH import qualified Text.Blaze.Html5.Attributes as BH +import Prelude -- Silence AMP warning rprint :: QuasiQuoter rprint = QuasiQuoter { quoteExp = \s -> [| do H.p $(quoteExp r s) |] } diff --git a/examples/RelaxWithNM.hs b/examples/RelaxWithNM.hs index 5c659306..8c6f66c1 100644 --- a/examples/RelaxWithNM.hs +++ b/examples/RelaxWithNM.hs @@ -15,6 +15,7 @@ import H.Prelude as H import Language.R.QQ import Numeric.Integration.TanhSinh import System.IO.Temp (withSystemTempDirectory) +import Prelude -- Silence AMP warning safeHead :: String -> [a] -> a safeHead msg [] = error $ "You have erred: " ++ msg diff --git a/examples/fib/Fib.hs b/examples/fib/Fib.hs index 3257e3e3..a29be1dc 100644 --- a/examples/fib/Fib.hs +++ b/examples/fib/Fib.hs @@ -17,6 +17,7 @@ import Foreign.R (SEXP) import Data.Int (Int32) import Language.R.QQ import Control.Applicative +import Prelude -- Silence AMP warning neg :: SEXP s 'R.Logical -> SEXP s 'R.Int diff --git a/inline-r/tests/Test/Vector.hs b/inline-r/tests/Test/Vector.hs index cd9d353c..6081f89d 100644 --- a/inline-r/tests/Test/Vector.hs +++ b/inline-r/tests/Test/Vector.hs @@ -115,7 +115,7 @@ fromListLength = testCase "fromList should have correct length" $ runRegion $ do vectorIsImmutable :: TestTree vectorIsImmutable = testCase "fromList should have correct length" $ do i <- runRegion $ do - s <- fmap (R.cast (sing :: R.SSEXPTYPE R.Real)) [r| c(1.0,2.0,3.0) |] + s <- fmap (R.cast (sing :: R.SSEXPTYPE 'R.Real)) [r| c(1.0,2.0,3.0) |] let mutV = VM.fromSEXP s immV <- V.fromSEXP s VM.unsafeWrite mutV 0 7 diff --git a/inline-r/tests/test-qq.hs b/inline-r/tests/test-qq.hs index 882dfb52..9b65b942 100644 --- a/inline-r/tests/test-qq.hs +++ b/inline-r/tests/test-qq.hs @@ -20,14 +20,15 @@ import qualified Data.Vector.SEXP as SVector import qualified Data.Vector.SEXP.Mutable as SMVector import Control.Memory.Region -import Control.Applicative ((<$>)) +import Control.Applicative import Control.Monad.Trans (liftIO) import Data.Int import Data.Singletons (sing) import qualified Data.Text.Lazy as Text import Test.Tasty.HUnit hiding ((@=?)) +import Prelude -- Silence AMP warning -hFib :: SEXP s R.Int -> R s (SEXP s R.Int) +hFib :: SEXP s 'R.Int -> R s (SEXP s 'R.Int) hFib n@(H.fromSEXP -> (0 :: Int32)) = fmap (flip R.asTypeOf n) [r| as.integer(0) |] hFib n@(H.fromSEXP -> (1 :: Int32)) = fmap (flip R.asTypeOf n) [r| as.integer(1) |] hFib n = diff --git a/inline-r/tests/tests.hs b/inline-r/tests/tests.hs index d675d231..e95cd4eb 100644 --- a/inline-r/tests/tests.hs +++ b/inline-r/tests/tests.hs @@ -30,11 +30,12 @@ import Language.R.QQ import Test.Tasty import Test.Tasty.HUnit -import Control.Applicative ((<$>)) +import Control.Applicative import qualified Data.ByteString.Char8 (pack) import Data.Vector.Generic (basicUnsafeIndexM) import Data.Singletons (sing) import Foreign +import Prelude -- Silence AMP warning tests :: TestTree tests = testGroup "Unit tests" @@ -67,7 +68,7 @@ tests = testGroup "Unit tests" R.withProtected (mkSEXPIO $ \x -> return $ x + 1 :: R s Double) $ \sf -> R.withProtected (mkSEXPIO (2::Double)) $ \d -> R.r2 (Data.ByteString.Char8.pack ".Call") sf d - >>= \(R.SomeSEXP s) -> R.cast (sing :: R.SSEXPTYPE R.Real) + >>= \(R.SomeSEXP s) -> R.cast (sing :: R.SSEXPTYPE 'R.Real) <$> R.tryEval s (R.release e) p , testCase "Weak Ptr test" $ runRegion $ do key <- mkSEXP (return 4 :: R s Int32) @@ -83,7 +84,7 @@ tests = testGroup "Unit tests" return () , testCase "Hexp works" $ (((42::Double) @=?) =<<) $ runRegion $ do - y <- R.cast (sing :: R.SSEXPTYPE R.Real) . R.SomeSEXP + y <- R.cast (sing :: R.SSEXPTYPE 'R.Real) . R.SomeSEXP <$> mkSEXP (42::Double) case hexp y of   Real s -> basicUnsafeIndexM s 0