Skip to content

Commit

Permalink
Fix Array module
Browse files Browse the repository at this point in the history
  • Loading branch information
harendra-kumar committed Oct 31, 2023
1 parent f984cbc commit 4984b11
Showing 1 changed file with 33 additions and 0 deletions.
33 changes: 33 additions & 0 deletions benchmark/Streamly/Benchmark/Data/Array/Stream.hs
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ import Streamly.Benchmark.Common.Handle
import Control.Monad.IO.Class (MonadIO)

#ifdef INSPECTION
import Control.Monad.IO.Class (MonadIO)
import Streamly.Internal.Data.Unbox (Unbox)
import Streamly.Internal.Data.Stream (Step(..))
import Test.Inspection
Expand Down Expand Up @@ -94,7 +95,11 @@ toChunksLast inh = do
Just arr -> Array.getIndex (Array.length arr - 1) arr

#ifdef INSPECTION
#if __GLASGOW_HASKELL__ >= 906
inspect $ hasNoTypeClassesExcept 'toChunksLast [''MonadIO]
#else
inspect $ hasNoTypeClasses 'toChunksLast
#endif
inspect $ 'toChunksLast `hasNoType` ''Step
#endif

Expand All @@ -105,7 +110,11 @@ toChunksSumLengths inh =
in Stream.fold Fold.sum (Stream.map Array.length s)

#ifdef INSPECTION
#if __GLASGOW_HASKELL__ >= 906
inspect $ hasNoTypeClassesExcept 'toChunksSumLengths [''MonadIO]
#else
inspect $ hasNoTypeClasses 'toChunksSumLengths
#endif
inspect $ 'toChunksSumLengths `hasNoType` ''Step
#endif

Expand All @@ -117,7 +126,11 @@ toChunksCountBytes inh = do
Stream.foldl' (\acc arr -> acc + foldlArr' (+) 0 arr) 0 s

#ifdef INSPECTION
#if __GLASGOW_HASKELL__ >= 906
inspect $ hasNoTypeClassesExcept 'toChunksCountBytes [''MonadIO]
#else
inspect $ hasNoTypeClasses 'toChunksCountBytes
#endif
inspect $ 'toChunksCountBytes `hasNoType` ''Step
#endif

Expand All @@ -126,7 +139,11 @@ toChunksDecodeUtf8Arrays =
Stream.drain . Unicode.decodeUtf8Chunks . Handle.readChunks

#ifdef INSPECTION
#if __GLASGOW_HASKELL__ >= 906
inspect $ hasNoTypeClassesExcept 'toChunksDecodeUtf8Arrays [''MonadIO]
#else
inspect $ hasNoTypeClasses 'toChunksDecodeUtf8Arrays
#endif
-- inspect $ 'toChunksDecodeUtf8ArraysLenient `hasNoType` ''Step
#endif

Expand All @@ -142,7 +159,11 @@ toChunksSplitOnSuffix =
. Handle.readChunks

#ifdef INSPECTION
#if __GLASGOW_HASKELL__ >= 906
inspect $ hasNoTypeClassesExcept 'toChunksSplitOnSuffix [''MonadIO]
#else
inspect $ hasNoTypeClasses 'toChunksSplitOnSuffix
#endif
inspect $ 'toChunksSplitOnSuffix `hasNoType` ''Step
#endif

Expand All @@ -155,7 +176,11 @@ toChunksSplitOn =
. Handle.readChunks

#ifdef INSPECTION
#if __GLASGOW_HASKELL__ >= 906
inspect $ hasNoTypeClassesExcept 'toChunksSplitOn [''MonadIO]
#else
inspect $ hasNoTypeClasses 'toChunksSplitOn
#endif
inspect $ 'toChunksSplitOn `hasNoType` ''Step
#endif

Expand Down Expand Up @@ -194,7 +219,11 @@ copyChunksSplitInterposeSuffix inh outh =
$ Handle.readChunks inh

#ifdef INSPECTION
#if __GLASGOW_HASKELL__ >= 906
inspect $ hasNoTypeClassesExcept 'copyChunksSplitInterposeSuffix [''Unbox, ''MonadIO]
#else
inspect $ hasNoTypeClassesExcept 'copyChunksSplitInterposeSuffix [''Unbox]
#endif
inspect $ 'copyChunksSplitInterposeSuffix `hasNoType` ''Step
#endif

Expand All @@ -208,7 +237,11 @@ copyChunksSplitInterpose inh outh =
$ Handle.readChunks inh

#ifdef INSPECTION
#if __GLASGOW_HASKELL__ >= 906
inspect $ hasNoTypeClassesExcept 'copyChunksSplitInterpose [''Unbox, ''MonadIO]
#else
inspect $ hasNoTypeClassesExcept 'copyChunksSplitInterpose [''Unbox]
#endif
inspect $ 'copyChunksSplitInterpose `hasNoType` ''Step
#endif

Expand Down

0 comments on commit 4984b11

Please sign in to comment.