lazy-async 1.0.0.3 → 1.1.0.0
raw patch · 7 files changed
+11/−73 lines, 7 filesdep −rank2classesdep ~basedep ~hedgehogdep ~transformersPVP ok
version bump matches the API change (PVP)
Dependencies removed: rank2classes
Dependency ranges changed: base, hedgehog, transformers
API changes (from Hackage documentation)
- LazyAsync: memoizeRank2 :: (MonadBaseControl IO m, Traversable t) => t m -> ContT r m (t m)
- LazyAsync: newtype () => ContT (r :: k) (m :: k -> Type) a
+ LazyAsync: newtype ContT (r :: k) (m :: k -> Type) a
Files
- changelog.md +4/−2
- lazy-async.cabal +4/−7
- src/LazyAsync.hs +2/−4
- src/LazyAsync/Actions/Memoize.hs +0/−6
- src/LazyAsync/Libraries/Rank2.hs +0/−5
- test/Test/Person.hs +0/−28
- test/test.hs +1/−21
changelog.md view
@@ -1,6 +1,8 @@-### 1.0.0.3 (2025-01-21)+### 1.1.0.0 (2023-06-23) -Version bumps+Support GHC 9.6++Remove `rank2classes` dependency and the `memoizeRank2` function ### 1.0.0.2 (2023-01-10)
lazy-async.cabal view
@@ -1,7 +1,7 @@ cabal-version: 3.0 name: lazy-async-version: 1.0.0.3+version: 1.1.0.0 synopsis: Asynchronous actions that don't start right away category: Concurrency @@ -42,13 +42,12 @@ common dependencies build-depends:- , base ^>= 4.18 || ^>= 4.19+ , base ^>= 4.15 || ^>= 4.16 || ^>= 4.17 || ^>= 4.18 , exceptions ^>= 0.10.4 , lifted-async ^>= 0.10.2 , monad-control ^>= 1.0.3- , rank2classes ^>= 1.5 , stm ^>= 2.5- , transformers ^>= 0.6+ , transformers ^>= 0.5.6 || ^>= 0.6 , transformers-base ^>= 0.4.6 library@@ -68,7 +67,6 @@ LazyAsync.Actions.StartWait LazyAsync.Actions.Wait LazyAsync.Libraries.Async- LazyAsync.Libraries.Rank2 LazyAsync.Orphans LazyAsync.Prelude LazyAsync.Types@@ -90,7 +88,7 @@ OverloadedStrings TemplateHaskell build-depends:- , hedgehog ^>= 1.3 || ^>= 1.4 || ^>= 1.5+ , hedgehog ^>= 1.0.5 || ^>= 1.1 || ^>= 1.2 , lazy-async , optics-core ^>= 0.4.1 , optics-th ^>= 0.4.1@@ -99,4 +97,3 @@ Test.Exceptions Test.General Test.Optics- Test.Person
src/LazyAsync.hs view
@@ -34,7 +34,7 @@ {- * Transactions -} pollSTM, startSTM, waitCatchSTM, {- * Memoization -} memoize, {- * Bulk operations -} {- $bulk -}- manyLazyAsyncs, memoizeMany, memoizeRank2,+ manyLazyAsyncs, memoizeMany, {- * Notes on monads -} {- $monads -} {- * Unlifted variants -} {- $unlifted -} withLazyAsyncIO, startWaitIO, startWaitCatchIO,@@ -60,9 +60,7 @@ list. If you have a big recordful of actions and feel like getting real fancy, try-making your datatype "higher-kinded" and using 'memoizeRank2' to automatically-create a bunch of threads at once. You'll need the @rank2classes@ package; see-"Rank2" and "Rank2.TH".+making your datatype "higher-kinded" and using the @rank2classes@ package. -}
src/LazyAsync/Actions/Memoize.hs view
@@ -8,8 +8,6 @@ import LazyAsync.Prelude (ContT, IO, MonadBaseControl, Traversable, fmap, runContT, traverse) -import qualified LazyAsync.Libraries.Rank2 as Rank2- {- | Creates a situation wherein: * The action shall begin running only once the memoized action runs@@ -28,10 +26,6 @@ -- | 🌈 'memoizeMany' is equivalent to @('traverse' 'memoize')@ memoizeMany :: (MonadBaseControl IO m, Traversable t) => t (m a) -> ContT r m (t (m a)) memoizeMany = traverse memoize---- | 🌈 'memoizeRank2' is equivalent to @('Rank2.traverse' 'memoize')@-memoizeRank2 :: (MonadBaseControl IO m, Rank2.Traversable t) => t m -> ContT r m (t m)-memoizeRank2 = Rank2.traverse memoize -- | Akin to 'memoizeMany' withMemoizedListIO :: [IO a] -> ([IO a] -> IO b) -> IO b
− src/LazyAsync/Libraries/Rank2.hs
@@ -1,5 +0,0 @@-{-# language Trustworthy #-}--module LazyAsync.Libraries.Rank2 (Traversable (traverse)) where--import Rank2
− test/Test/Person.hs
@@ -1,28 +0,0 @@-{- |--"Higher-kinded datatypes", for tests-involving functions like 'memoizeRank2'---}--module Test.Person where--import Data.String (String)-import Numeric.Natural (Natural)-import Rank2.TH (deriveAll)--data Person f =- Person- { name :: f String- , age :: f Natural- , location :: Location f- }--data Location f =- Location- { city :: f String- , state :: f String- }--$(deriveAll ''Location)-$(deriveAll ''Person)
test/test.hs view
@@ -6,7 +6,6 @@ import Test.Exceptions import Test.General import Test.Optics-import Test.Person import Data.Foldable (traverse_) import Data.Function (($), (.))@@ -65,7 +64,7 @@ prop_startWait_idempotent :: Property prop_startWait_idempotent = contExample do- annotate "'startWait' is idemponent"+ annotate "'startWait' is idempotent" tick <- expectTicks 1 la <- lazyAsync tick lift (replicateM_ 2 (startWait la >>= (=== 1)))@@ -132,22 +131,3 @@ lift do startWait complex1 >>= (=== 5) startWait complex2 >>= (=== 5)--prop_rank2 :: Property-prop_rank2 = contExample do- annotate "memoizeRank2 separately memoizes each field of a higher-kinded datatype"- tick <- expectTicks 2-- person <- memoizeRank2- Person- { name = tick $> "Chris"- , age = tick $> 34- , location =- Location- { city = tick $> "Ronan"- , state = tick $> "Montana"- }- }-- lift $ name person >>= (=== "Chris")- lift $ (state . location) person >>= (=== "Montana")