Skip to content

Commit

Permalink
Update Repa to GHC 8
Browse files Browse the repository at this point in the history
  • Loading branch information
benl23x5 committed Jun 18, 2016
1 parent e3568d7 commit 0eb7373
Show file tree
Hide file tree
Showing 40 changed files with 106 additions and 128 deletions.
4 changes: 2 additions & 2 deletions repa-algorithms/repa-algorithms.cabal
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
Name: repa-algorithms
Version: 3.4.0.2
Version: 3.4.1.1
License: BSD3
License-file: LICENSE
Author: The DPH Team
Expand All @@ -20,7 +20,7 @@ Library
Build-Depends:
base >= 4.8 && < 4.10
, vector == 0.11.*
, repa == 3.4.0.*
, repa == 3.4.1.*

ghc-options:
-Wall
Expand Down
2 changes: 1 addition & 1 deletion repa-array/Data/Repa/Array/Auto.hs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@

module Data.Repa.Array.Auto
( Array
( Data.Repa.Array.Auto.Operator.Array
, Elem, Build

-- * Basics
Expand Down
7 changes: 3 additions & 4 deletions repa-array/Data/Repa/Array/Auto/Operator.hs
Original file line number Diff line number Diff line change
Expand Up @@ -642,8 +642,7 @@ compactIn = G.compactIn A


-- | Apply a generic stream process to an array.
process :: ( Build a, Build b, Elem b
, G.Target A.A b)
process :: ( Build a, Build b, Elem b)
=> (s -> a -> (s, Array b)) -- ^ Worker function
-> s -- ^ Initial state.
-> Array a -- ^ Input array.
Expand Down Expand Up @@ -686,7 +685,7 @@ segment pStart pEnd elems
--
-- The result segments do not include the terminator.
segmentOn
:: (Elem a, Eq a, U.Unbox a)
:: (Elem a, U.Unbox a)
=> (a -> Bool) -- ^ Detect the end of a segment.
-> Array a -- ^ Array to segment.
-> Array (Array a)
Expand Down Expand Up @@ -719,7 +718,7 @@ dice pStart1 pEnd1 pStart2 pEnd2 arr
-- | O(len src). Given field and row terminating values,
-- split an array into rows and fields.
--
diceSep :: (Elem a, Eq a, U.Unbox a)
diceSep :: (Elem a, Eq a)
=> a -- ^ Terminating element for inner segments.
-> a -- ^ Terminating element for outer segments.
-> Array a -- ^ Vector to dice.
Expand Down
1 change: 0 additions & 1 deletion repa-array/Data/Repa/Array/Internals/Operator/Process.hs
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,6 @@ process nDst f s0 arr
-- | Apply a generic stream process to an array.
--
unfolds :: ( BulkI lSrc a
, BulkI lDst b
, TargetI lDst b)
=> Name lDst -- ^ Name of destination layout.
-> (a -> s -> (StepUnfold s b)) -- ^ Worker function.
Expand Down
1 change: 0 additions & 1 deletion repa-array/Data/Repa/Array/Material/Auto.hs
Original file line number Diff line number Diff line change
Expand Up @@ -22,4 +22,3 @@ import Data.Repa.Array.Material.Auto.InstTuple
import Data.Repa.Array.Material.Auto.InstText
import Data.Repa.Array.Material.Auto.InstUnit
import Data.Repa.Array.Material.Auto.InstWord
import Data.Repa.Array.Internals.Target
1 change: 0 additions & 1 deletion repa-array/Data/Repa/Array/Material/Auto/InstProduct.hs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ module Data.Repa.Array.Material.Auto.InstProduct
where
import Data.Repa.Array.Material.Auto.Base as A
import Data.Repa.Array.Material.Auto.InstUnit as A
import Data.Repa.Array.Meta.Tuple as A
import Data.Repa.Array.Meta.Window as A
import Data.Repa.Array.Internals.Bulk as A
import Data.Repa.Array.Internals.Target as A
Expand Down
4 changes: 2 additions & 2 deletions repa-array/Data/Repa/Array/Material/Nested.hs
Original file line number Diff line number Diff line change
Expand Up @@ -354,7 +354,7 @@ segment pStart pEnd !elems
-- @
--
segmentOn
:: (BulkI l a, Eq a, U.Unbox a)
:: (BulkI l a, U.Unbox a)
=> (a -> Bool) -- ^ Detect the end of a segment.
-> Array l a -- ^ Vector to segment.
-> Array N (Array l a)
Expand Down Expand Up @@ -403,7 +403,7 @@ dice pStart1 pEnd1 pStart2 pEnd2 !arr
-- | O(len src). Given field and row terminating values,
-- split an array into rows and fields.
--
diceSep :: (BulkI l a, Windowable l a, U.Unbox a, Eq a)
diceSep :: (BulkI l a, Eq a)
=> a -- ^ Terminating element for inner segments.
-> a -- ^ Terminating element for outer segments.
-> Array l a -- ^ Vector to dice.
Expand Down
6 changes: 2 additions & 4 deletions repa-array/Data/Repa/Array/Material/Unboxed.hs
Original file line number Diff line number Diff line change
Expand Up @@ -154,15 +154,13 @@ instance U.Unbox a => Target U a where

---------------------------------------------------------------------------------------------------
-- | O(1). Wrap an unboxed vector as an array.
fromUnboxed :: U.Unbox a
=> U.Vector a -> Array U a
fromUnboxed :: U.Vector a -> Array U a
fromUnboxed vec = UArray vec
{-# INLINE_ARRAY fromUnboxed #-}


-- | O(1). Unwrap an unboxed vector from an array.
toUnboxed :: U.Unbox a
=> Array U a -> U.Vector a
toUnboxed :: Array U a -> U.Vector a
toUnboxed (UArray vec) = vec
{-# INLINE_ARRAY toUnboxed #-}

3 changes: 1 addition & 2 deletions repa-array/Data/Repa/Array/Meta/Delayed.hs
Original file line number Diff line number Diff line change
Expand Up @@ -108,8 +108,7 @@ fromFunction l f

-- | Produce the extent of an array, and a function to retrieve an
-- arbitrary element.
toFunction :: Bulk l a
=> Array (D l) a -> (l, Index l -> a)
toFunction :: Array (D l) a -> (l, Index l -> a)
toFunction (ADelayed l f) = (l, f)
{-# INLINE_ARRAY toFunction #-}

Expand Down
3 changes: 1 addition & 2 deletions repa-array/Data/Repa/Array/Meta/Tuple.hs
Original file line number Diff line number Diff line change
Expand Up @@ -147,8 +147,7 @@ instance ( Target l1 a, Target l2 b
-- different extents. The extent of the result is the intersection
-- of the extents of the two argument arrays.
--
tup2 :: (Bulk l1 a, Bulk l2 b, Index l1 ~ Index l2)
=> Array l1 a -> Array l2 b
tup2 :: Array l1 a -> Array l2 b
-> Array (T2 l1 l2) (a, b)
tup2 arr1 arr2
= T2Array arr1 arr2
Expand Down
16 changes: 9 additions & 7 deletions repa-array/repa-array.cabal
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
Name: repa-array
Version: 4.2.2.1
Version: 4.2.3.1
License: BSD3
License-file: LICENSE
Author: The Repa Development Team
Expand All @@ -24,17 +24,17 @@ source-repository head

Library
build-Depends:
base == 4.8.*,
base == 4.9.*,
primitive == 0.6.*,
vector == 0.10.*,
bytestring == 0.10.*,
mtl == 2.2.*,
double-conversion == 2.0.*,
text == 1.2.*,
repa-eval == 4.0.0.*,
repa-stream == 4.2.2.*,
repa-scalar == 4.2.2.*,
repa-convert == 4.2.2.*,
repa-eval == 4.2.3.*,
repa-stream == 4.2.3.*,
repa-scalar == 4.2.3.*,
repa-convert == 4.2.3.*,
filelock >= 0.1.0 && < 0.2


Expand Down Expand Up @@ -131,7 +131,9 @@ Library
repa-array.h

ghc-options:
-Wall -fno-warn-missing-signatures
-Wall
-fno-warn-missing-signatures
-fno-warn-missing-pattern-synonym-signatures
-O2

extensions:
Expand Down
2 changes: 1 addition & 1 deletion repa-convert/Data/Repa/Convert/Format/App.hs
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,6 @@ instance ( Unpackable f1, Unpackable (App fs)
= unpacker f1 start end stop fail $ \start_x1 x1
-> unpacker (App fs) start_x1 end stop fail $ \start_xs xs
-> eat start_xs (x1 :*: xs)
{-# INLINE unpack #-}
{-# INLINE unpacker #-}


6 changes: 3 additions & 3 deletions repa-convert/Data/Repa/Convert/Format/Binary.hs
Original file line number Diff line number Diff line change
Expand Up @@ -45,14 +45,14 @@ instance Packable Word8be where
= do S.poke (Ptr dst) (fromIntegral x :: Word8)
let !(Ptr dst') = S.plusPtr (Ptr dst) 1
k dst'
{-# INLINE pack #-}
{-# INLINE packer #-}


instance Unpackable Word8be where
unpacker _ start _end _stop _fail eat
= do x <- S.peek (pw8 start)
eat (plusAddr# start 1#) (fromIntegral x)
{-# INLINE unpack #-}
{-# INLINE unpacker #-}


w8 :: Integral a => a -> Word8
Expand Down Expand Up @@ -201,7 +201,7 @@ instance Unpackable Word32be where
.|. (w32 x1 `shiftL` 16)
.|. (w32 x2 `shiftL` 8)
.|. (w32 x3)))
{-# INLINE unpack #-}
{-# INLINE unpacker #-}


w32 :: Integral a => a -> Word32
Expand Down
4 changes: 2 additions & 2 deletions repa-convert/Data/Repa/Convert/Format/Date32.hs
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ instance Unpackable YYYYsMMsDD where
case r of
Just (d, I# o) -> eat (plusAddr# start o) d
Nothing -> fail
{-# INLINE unpack #-}
{-# INLINE unpacker #-}


---------------------------------------------------------------------------------------- DDsMMsYYYY
Expand Down Expand Up @@ -107,7 +107,7 @@ instance Unpackable DDsMMsYYYY where
case r of
Just (d, I# o) -> eat (plusAddr# start o) d
Nothing -> fail
{-# INLINE unpack #-}
{-# INLINE unpacker #-}


---------------------------------------------------------------------------------------------------
Expand Down
2 changes: 1 addition & 1 deletion repa-convert/Data/Repa/Convert/Format/Fields.hs
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ instance Unpackable () where

unpacker _f start _end _stop _fail eat
= eat start ()
{-# INLINE unpack #-}
{-# INLINE unpacker #-}


---------------------------------------------------------------------------------------------------
Expand Down
2 changes: 1 addition & 1 deletion repa-convert/Data/Repa/Convert/Format/Maybe.hs
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ instance Packable f
= case mv of
Nothing -> packer VarBytes str start k
Just v -> packer f v start k
{-# NOINLINE pack #-}
{-# NOINLINE packer #-}
-- We're NOINLINEing this so we don't duplicate the code for the continuation.
-- It would be better to use an Either format and use that to express the branch.

Expand Down
2 changes: 1 addition & 1 deletion repa-convert/Data/Repa/Convert/Format/Sep.hs
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,7 @@ instance ( Packable f1

packer (SepCons _ f1 _ ) (x1 :*: _) start k
= packer f1 x1 start k
{-# INLINE pack #-}
{-# INLINE packer #-}


instance ( Unpackable f1
Expand Down
8 changes: 4 additions & 4 deletions repa-convert/Data/Repa/Convert/Format/String.hs
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ instance Unpackable VarChars where
unpacker VarChars start end stop _fail eat
= do (Ptr ptr, str) <- unpackCharList (pw8 start) (pw8 end) stop
eat ptr str
{-# INLINE unpack #-}
{-# INLINE unpacker #-}


-- | Unpack a ascii text from the given buffer.
Expand Down Expand Up @@ -169,7 +169,7 @@ instance Packable VarCharString where
-- ISSUE #43: Avoid intermediate lists when packing Ints and Strings.
packer VarCharString xx start k
= packer VarChars (show xx) start k
{-# INLINE pack #-}
{-# INLINE packer #-}


instance Unpackable VarCharString where
Expand Down Expand Up @@ -270,7 +270,7 @@ instance Packable ExactChars where
$ zip [0 .. len - 1] str
let !(Ptr dst') = S.plusPtr (Ptr dst) len
k dst'
{-# NOINLINE pack #-}
{-# NOINLINE packer #-}


instance Unpackable ExactChars where
Expand All @@ -289,7 +289,7 @@ instance Unpackable ExactChars where
if (xs == str)
then eat (plusAddr# start len') ()
else fails
{-# NOINLINE unpack #-}
{-# NOINLINE unpacker #-}


---------------------------------------------------------------------------------------------------
Expand Down
4 changes: 2 additions & 2 deletions repa-convert/Data/Repa/Convert/Format/Unit.hs
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ instance Format UnitAsc where
instance Packable UnitAsc where
packer (UnitAsc s) () start k
= packer (FixChars (length s)) s start k
{-# INLINE pack #-}
{-# INLINE packer #-}


instance Unpackable UnitAsc where
Expand All @@ -39,7 +39,7 @@ instance Unpackable UnitAsc where
if str == str'
then eat ptr ()
else fail
{-# NOINLINE unpack #-}
{-# NOINLINE unpacker #-}



Expand Down
6 changes: 3 additions & 3 deletions repa-convert/repa-convert.cabal
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
Name: repa-convert
Version: 4.2.2.1
Version: 4.2.3.1
License: BSD3
License-file: LICENSE
Author: The Repa Development Team
Expand All @@ -19,13 +19,13 @@ source-repository head

Library
build-Depends:
base == 4.8.*,
base == 4.9.*,
primitive == 0.6.*,
vector == 0.10.*,
bytestring == 0.10.*,
text == 1.2.*,
double-conversion == 2.0.*,
repa-scalar == 4.2.2.*
repa-scalar == 4.2.3.*

exposed-modules:
Data.Repa.Convert.Format
Expand Down
6 changes: 3 additions & 3 deletions repa-eval/repa-eval.cabal
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
Name: repa-eval
Version: 4.0.0.2
Version: 4.2.3.1
License: BSD3
License-file: LICENSE
Author: The Repa Development Team
Expand All @@ -19,8 +19,8 @@ source-repository head

Library
Build-Depends:
base == 4.8.*,
ghc-prim == 0.4.*
base == 4.9.*,
ghc-prim == 0.5.*

Exposed-modules:
Data.Repa.Eval.Elt
Expand Down
3 changes: 1 addition & 2 deletions repa-examples/examples/Canny/src-repa/Main.hs
Original file line number Diff line number Diff line change
Expand Up @@ -109,8 +109,7 @@ process loops threshLow threshHigh arrInput

-- | Wrapper to time each stage of the algorithm.
timeStage
:: (Shape sh, Unbox a)
=> Int
:: Int
-> String
-> IO (Array U sh a)
-> IO (Array U sh a)
Expand Down
Loading

0 comments on commit 0eb7373

Please sign in to comment.