inline-r 0.7.1.2 → 0.7.2.0
raw patch · 9 files changed
+11/−41 lines, 9 files
Files
- cbits/Hcompat.h +0/−26
- inline-r.cabal +3/−4
- src/Foreign/R.chs +0/−1
- src/Foreign/R/Embedded.chs +0/−1
- src/Foreign/R/Parse.chs +0/−2
- src/Language/R/HExp.chs +0/−1
- tests/Test/Vector.hs +1/−1
- tests/test-qq.hs +3/−2
- tests/tests.hs +4/−3
− cbits/Hcompat.h
@@ -1,26 +0,0 @@-/* Copyright (C) 2013-2014 Amgen, Inc.- *- * Compatibility macros and definitions required to build on some- * platforms.- */--#ifndef H_COMPAT__H-#define H_COMPAT__H--#ifdef H_ARCH_UNIX_DARWIN--/* NOTE: c2hs-0.17.2 and earlier choke on certain OS X system headers:- * https://github.com/haskell/c2hs/issues/85- *- * This file must be #included in every *.chs file which #includes any- * system header, before all other #includes.- */--#define __AVAILABILITY__-#define __OSX_AVAILABLE_STARTING(a,b)-#define __OSX_AVAILABLE_BUT_DEPRECATED(a,b,c,d)-#define __OSX_AVAILABLE_BUT_DEPRECATED_MSG(a,b,c,d,e)--#endif /* H_ARCH_UNIX_DARWIN */--#endif /* H_COMPAT__H */
inline-r.cabal view
@@ -1,5 +1,5 @@ name: inline-r-version: 0.7.1.2+version: 0.7.2.0 license: BSD3 copyright: Copyright (c) 2013-2015 Amgen, Inc. Copyright (c) 2015 Tweag I/O Limited.@@ -16,8 +16,7 @@ cabal-version: >=1.10 -extra-source-files: cbits/Hcompat.h- cbits/missing_r.h+extra-source-files: cbits/missing_r.h tests/shootout/binarytrees.R tests/shootout/fasta.R tests/shootout/knucleotide.R@@ -86,7 +85,7 @@ , transformers >= 0.3 , vector >= 0.10 && < 0.11 hs-source-dirs: src- includes: cbits/Hcompat.h cbits/missing_r.h+ includes: cbits/missing_r.h c-sources: cbits/missing_r.c include-dirs: cbits default-language: Haskell2010
src/Foreign/R.chs view
@@ -172,7 +172,6 @@ import Prelude hiding (asTypeOf, length) #define USE_RINTERNALS-#include "Hcompat.h" #include <R.h> #include <Rinternals.h> #include <R_ext/Memory.h>
src/Foreign/R/Embedded.chs view
@@ -16,7 +16,6 @@ import Foreign import Foreign.C -#include "Hcompat.h" #include <Rembedded.h> #include "missing_r.h"
src/Foreign/R/Parse.chs view
@@ -11,8 +11,6 @@ {-# OPTIONS_GHC -fno-warn-unticked-promoted-constructors #-} #endif -#include "Hcompat.h"- #include <Rinternals.h> #include <R_ext/Parse.h> module Foreign.R.Parse
src/Language/R/HExp.chs view
@@ -83,7 +83,6 @@ import Prelude #define USE_RINTERNALS-#include "Hcompat.h" #include <R.h> #include <Rinternals.h>
tests/Test/Vector.hs view
@@ -115,7 +115,7 @@ 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
tests/test-qq.hs view
@@ -20,14 +20,15 @@ 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 =
tests/tests.hs view
@@ -30,11 +30,12 @@ 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 @@ 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 @@ 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