potoki-core 2.2.13.1 → 2.2.14
raw patch · 3 files changed
+14/−14 lines, 3 filesPVP: major bump suggested
API removals or changes: PVP suggests a major version bump
API changes (from Hackage documentation)
- Potoki.Core.Transform: batch :: Int -> Transform a (Vector a)
+ Potoki.Core.Transform: batch :: Vector vector a => Int -> Transform a (vector a)
- Potoki.Core.Transform: chunk :: Int -> Transform a (Vector a)
+ Potoki.Core.Transform: chunk :: Vector vector a => Int -> Transform a (vector a)
- Potoki.Core.Transform: vector :: Transform (Vector a) a
+ Potoki.Core.Transform: vector :: Vector vector a => Transform (vector a) a
Files
- library/Potoki/Core/Transform/Basic.hs +8/−8
- library/Potoki/Core/Transform/Concurrency.hs +2/−2
- potoki-core.cabal +4/−4
library/Potoki/Core/Transform/Basic.hs view
@@ -71,19 +71,19 @@ in fetchElementIO {-# INLINABLE vector #-}-vector :: Transform (Vector a) a+vector :: GenericVector.Vector vector a => Transform (vector a) a vector =- Transform $ \ (A.Fetch fetchVectorIO) -> M.Acquire $ do+ Transform $ \ (Fetch fetchVectorIO) -> liftIO $ do indexRef <- newIORef 0- vectorRef <- newIORef mempty- return $ (, return ()) $ A.Fetch $ let+ vectorRef <- newIORef GenericVector.empty+ return $ Fetch $ let loop = do vectorVal <- readIORef vectorRef indexVal <- readIORef indexRef- if indexVal < P.length vectorVal+ if indexVal < GenericVector.length vectorVal then do writeIORef indexRef (succ indexVal)- return (Just (P.unsafeIndex vectorVal indexVal))+ return (Just (GenericVector.unsafeIndex vectorVal indexVal)) else fetchVectorIO >>= \case Just vectorVal' -> do writeIORef vectorRef vectorVal'@@ -96,7 +96,7 @@ Alias to "batch". -} {-# DEPRECATED chunk "Use 'batch' instead" #-}-chunk :: Int -> Transform a (Vector a)+chunk :: GenericVector.Vector vector a => Int -> Transform a (vector a) chunk = batch {-|@@ -106,7 +106,7 @@ Actually, there is a composed variation of 'concurrently', which utilizes it: 'concurrentlyWithBatching'. -} {-# INLINABLE batch #-}-batch :: Int -> Transform a (Vector a)+batch :: GenericVector.Vector vector a => Int -> Transform a (vector a) batch size = if size < 1 then Transform $ const $ liftIO $ return $ empty else Transform $ \ (Fetch fetch) -> liftIO $ do
library/Potoki/Core/Transform/Concurrency.hs view
@@ -154,6 +154,6 @@ concurrentlyWithBatching :: Int -> Int -> Transform a b -> Transform a b concurrentlyWithBatching batching concurrency transform =- batch batching >>> bufferize concurrency >>>- unsafeConcurrently concurrency (vector >>> transform >>> batch batching) >>>+ batch @Vector batching >>> bufferize concurrency >>>+ unsafeConcurrently concurrency (vector >>> transform >>> batch @Vector batching) >>> vector
potoki-core.cabal view
@@ -1,5 +1,5 @@ name: potoki-core-version: 2.2.13.1+version: 2.2.14 synopsis: Low-level components of "potoki" description: Provides everything required for building custom instances of@@ -24,7 +24,7 @@ library hs-source-dirs: library- default-extensions: Arrows, BangPatterns, ConstraintKinds, DataKinds, DefaultSignatures, DeriveDataTypeable, DeriveFoldable, DeriveFunctor, DeriveGeneric, DeriveTraversable, EmptyDataDecls, FlexibleContexts, FlexibleInstances, FunctionalDependencies, GADTs, GeneralizedNewtypeDeriving, InstanceSigs, LambdaCase, LiberalTypeSynonyms, MagicHash, MultiParamTypeClasses, MultiWayIf, NoImplicitPrelude, NoMonomorphismRestriction, OverloadedStrings, PatternGuards, ParallelListComp, QuasiQuotes, RankNTypes, RecordWildCards, ScopedTypeVariables, StandaloneDeriving, TemplateHaskell, TupleSections, TypeFamilies, TypeOperators, UnboxedTuples+ default-extensions: Arrows, BangPatterns, ConstraintKinds, DataKinds, DefaultSignatures, DeriveDataTypeable, DeriveFoldable, DeriveFunctor, DeriveGeneric, DeriveTraversable, EmptyDataDecls, FlexibleContexts, FlexibleInstances, FunctionalDependencies, GADTs, GeneralizedNewtypeDeriving, InstanceSigs, LambdaCase, LiberalTypeSynonyms, MagicHash, MultiParamTypeClasses, MultiWayIf, NoImplicitPrelude, NoMonomorphismRestriction, OverloadedStrings, PatternGuards, ParallelListComp, QuasiQuotes, RankNTypes, RecordWildCards, ScopedTypeVariables, StandaloneDeriving, TemplateHaskell, TupleSections, TypeApplications, TypeFamilies, TypeOperators, UnboxedTuples default-language: Haskell2010 exposed-modules: Potoki.Core.Produce@@ -67,7 +67,7 @@ type: exitcode-stdio-1.0 hs-source-dirs: test main-is: Main.hs- default-extensions: Arrows, BangPatterns, ConstraintKinds, DataKinds, DefaultSignatures, DeriveDataTypeable, DeriveFoldable, DeriveFunctor, DeriveGeneric, DeriveTraversable, EmptyDataDecls, FlexibleContexts, FlexibleInstances, FunctionalDependencies, GADTs, GeneralizedNewtypeDeriving, InstanceSigs, LambdaCase, LiberalTypeSynonyms, MagicHash, MultiParamTypeClasses, MultiWayIf, NoImplicitPrelude, NoMonomorphismRestriction, OverloadedStrings, PatternGuards, ParallelListComp, QuasiQuotes, RankNTypes, RecordWildCards, ScopedTypeVariables, StandaloneDeriving, TemplateHaskell, TupleSections, TypeFamilies, TypeOperators, UnboxedTuples+ default-extensions: Arrows, BangPatterns, ConstraintKinds, DataKinds, DefaultSignatures, DeriveDataTypeable, DeriveFoldable, DeriveFunctor, DeriveGeneric, DeriveTraversable, EmptyDataDecls, FlexibleContexts, FlexibleInstances, FunctionalDependencies, GADTs, GeneralizedNewtypeDeriving, InstanceSigs, LambdaCase, LiberalTypeSynonyms, MagicHash, MultiParamTypeClasses, MultiWayIf, NoImplicitPrelude, NoMonomorphismRestriction, OverloadedStrings, PatternGuards, ParallelListComp, QuasiQuotes, RankNTypes, RecordWildCards, ScopedTypeVariables, StandaloneDeriving, TemplateHaskell, TupleSections, TypeApplications, TypeFamilies, TypeOperators, UnboxedTuples default-language: Haskell2010 other-modules: Potoki@@ -90,7 +90,7 @@ benchmark benchmark type: exitcode-stdio-1.0 hs-source-dirs: benchmark- default-extensions: Arrows, BangPatterns, ConstraintKinds, DataKinds, DefaultSignatures, DeriveDataTypeable, DeriveFoldable, DeriveFunctor, DeriveGeneric, DeriveTraversable, EmptyDataDecls, FlexibleContexts, FlexibleInstances, FunctionalDependencies, GADTs, GeneralizedNewtypeDeriving, InstanceSigs, LambdaCase, LiberalTypeSynonyms, MagicHash, MultiParamTypeClasses, MultiWayIf, NoImplicitPrelude, NoMonomorphismRestriction, OverloadedStrings, PatternGuards, ParallelListComp, QuasiQuotes, RankNTypes, RecordWildCards, ScopedTypeVariables, StandaloneDeriving, TemplateHaskell, TupleSections, TypeFamilies, TypeOperators, UnboxedTuples+ default-extensions: Arrows, BangPatterns, ConstraintKinds, DataKinds, DefaultSignatures, DeriveDataTypeable, DeriveFoldable, DeriveFunctor, DeriveGeneric, DeriveTraversable, EmptyDataDecls, FlexibleContexts, FlexibleInstances, FunctionalDependencies, GADTs, GeneralizedNewtypeDeriving, InstanceSigs, LambdaCase, LiberalTypeSynonyms, MagicHash, MultiParamTypeClasses, MultiWayIf, NoImplicitPrelude, NoMonomorphismRestriction, OverloadedStrings, PatternGuards, ParallelListComp, QuasiQuotes, RankNTypes, RecordWildCards, ScopedTypeVariables, StandaloneDeriving, TemplateHaskell, TupleSections, TypeApplications, TypeFamilies, TypeOperators, UnboxedTuples default-language: Haskell2010 ghc-options: -O2 -threaded "-with-rtsopts=-N -A64M" main-is: Main.hs