potoki-core 1.5 → 1.5.1
raw patch · 4 files changed
+14/−16 lines, 4 filesPVP: major bump suggested
API removals or changes: PVP suggests a major version bump
API changes (from Hackage documentation)
- Potoki.Core.Fetch: bothFetchingFirst :: IORef (Maybe b) -> Fetch a -> Fetch (a, b)
+ Potoki.Core.Fetch: bothFetchingFirst :: IORef b -> Fetch a -> Fetch (a, b)
- Potoki.Core.Fetch: firstCachingSecond :: IORef (Maybe b) -> Fetch (a, b) -> Fetch a
+ Potoki.Core.Fetch: firstCachingSecond :: IORef b -> Fetch (a, b) -> Fetch a
Files
- LICENSE +1/−1
- library/Potoki/Core/Fetch.hs +6/−8
- library/Potoki/Core/Transform.hs +1/−1
- potoki-core.cabal +6/−6
LICENSE view
@@ -1,4 +1,4 @@-Copyright (c) 2017, Nikita Volkov+Copyright (c) 2017, Metrix.AI Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation
library/Potoki/Core/Fetch.hs view
@@ -98,28 +98,26 @@ _ -> ([], nil) {-# INLINABLE firstCachingSecond #-}-firstCachingSecond :: IORef (Maybe b) -> Fetch (a, b) -> Fetch a+firstCachingSecond :: IORef b -> Fetch (a, b) -> Fetch a firstCachingSecond cacheRef (Fetch bothFetchIO) = Fetch $ \ nil just -> join $ bothFetchIO (return nil) (\ (!first, !second) -> do- writeIORef cacheRef (Just second)+ writeIORef cacheRef second return (just first)) {-# INLINABLE bothFetchingFirst #-}-bothFetchingFirst :: IORef (Maybe b) -> Fetch a -> Fetch (a, b)+bothFetchingFirst :: IORef b -> Fetch a -> Fetch (a, b) bothFetchingFirst cacheRef (Fetch firstFetchIO) = Fetch $ \ nil just -> join $ firstFetchIO (return nil)- (\ !firstFetched -> - atomicModifyIORef' cacheRef- (\ case- Just secondCached -> (Nothing, just (firstFetched, secondCached))- Nothing -> (Nothing, nil)))+ (\ !firstFetched -> do+ secondCached <- readIORef cacheRef+ return (just (firstFetched, secondCached))) {-# INLINABLE rightCachingLeft #-} rightCachingLeft :: IORef (Maybe left) -> Fetch (Either left right) -> Fetch right
library/Potoki/Core/Transform.hs view
@@ -54,7 +54,7 @@ instance Strong Transform where first' (Transform firstTransformIO) = Transform $ \ bothFetch -> do- cacheRef <- newIORef Nothing+ cacheRef <- newIORef undefined firstFetch <- firstTransformIO (A.firstCachingSecond cacheRef bothFetch) return $ A.bothFetchingFirst cacheRef firstFetch
potoki-core.cabal view
@@ -1,7 +1,7 @@ name: potoki-core version:- 1.5+ 1.5.1 synopsis: Low-level components of "potoki" description:@@ -11,15 +11,15 @@ category: Streaming homepage:- https://github.com/nikita-volkov/potoki-core + https://github.com/metrix-ai/potoki-core bug-reports:- https://github.com/nikita-volkov/potoki-core/issues + https://github.com/metrix-ai/potoki-core/issues author: Nikita Volkov <nikita.y.volkov@mail.ru> maintainer:- Nikita Volkov <nikita.y.volkov@mail.ru>+ Metrix.AI Tech Team <tech@metrix.ai> copyright:- (c) 2017, Nikita Volkov+ (c) 2017, Metrix.AI license: MIT license-file:@@ -33,7 +33,7 @@ type: git location:- git://github.com/nikita-volkov/potoki-core.git+ git://github.com/metrix-ai/potoki-core.git library hs-source-dirs: