@@ -0,0 +1,62 @@
1+diff -ruN orig/Control/Monad/Primitive.hs new/Control/Monad/Primitive.hs
2+--- orig/Control/Monad/Primitive.hs 2014-08-01 14:49:04.175318972 +0300
3++++ new/Control/Monad/Primitive.hs 2014-08-01 14:49:03.000000000 +0300
5+ primitive_ :: PrimMonad m
6+ => (State# (PrimState m) -> State# (PrimState m)) -> m ()
7+ {-# INLINE primitive_ #-}
8+-primitive_ f = primitive (\s# -> (# f s#, () #))
9++primitive_ f = primitive (\s# ->
11++ s'# -> (# s'#, () #))
13+ instance PrimMonad IO where
14+ type PrimState IO = RealWorld
15+diff -ruN orig/primitive.cabal new/primitive.cabal
16+--- orig/primitive.cabal 2014-08-01 14:49:04.175318972 +0300
17++++ new/primitive.cabal 2014-08-01 14:49:03.000000000 +0300
19+ if arch(i386) || arch(x86_64)
23++ Default-Language: Haskell2010
24++ hs-source-dirs: test
26++ type: exitcode-stdio-1.0
32+ source-repository head
34+ location: https://github.com/haskell/primitive
35+diff -ruN orig/test/main.hs new/test/main.hs
36+--- orig/test/main.hs 1970-01-01 02:00:00.000000000 +0200
37++++ new/test/main.hs 2014-08-01 14:49:03.000000000 +0300
39++{-# LANGUAGE MagicHash, UnboxedTuples #-}
40++import Control.Monad.Primitive
41++import Data.Primitive.Array
45++-- Since we only have a single test case right now, I'm going to avoid the
46++-- issue of choosing a test framework for the moment. This also keeps the
47++-- package as a whole light on dependencies.
51++ arr <- newArray 1 'A'
53++ case writeArray arr 0 'B' of
55++ case f realWorld# of
57++ c1 <- readArray arr 0
59++ c2 <- readArray arr 0
60++ if c1 == 'A' && c2 == 'B'
62++ else error $ "Expected AB, got: " ++ show (c1, c2)