dunai 0.13.2 → 0.14.0
raw patch · 3 files changed
+16/−70 lines, 3 filesdep ~filepathdep ~hlintdep ~tastyPVP ok
version bump matches the API change (PVP)
Dependency ranges changed: filepath, hlint, tasty, time, transformers
API changes (from Hackage documentation)
Files
- CHANGELOG +5/−0
- dunai.cabal +11/−24
- src/Control/Monad/Trans/MSF/List.hs +0/−46
CHANGELOG view
@@ -1,3 +1,8 @@+2024-12-21 Ivan Perez <ivan.perez@keera.co.uk>+ * Version bump (0.14.0) (#460).+ * Increase upper bounds on filepath, tasty, time, hlint (#448).+ * Remove deprecated functions related to list-t (#445).+ 2024-10-21 Ivan Perez <ivan.perez@keera.co.uk> * Version bump (0.13.2) (#442).
dunai.cabal view
@@ -30,7 +30,7 @@ build-type: Simple name: dunai-version: 0.13.2+version: 0.14.0 author: Ivan Perez, Manuel Bärenz maintainer: ivan.perez@keera.co.uk homepage: https://github.com/ivanperez-keera/dunai@@ -97,11 +97,7 @@ default: False manual: True -flag list-transformer- description: Use list-transformer instead of transformers to implement the ListT combinators- default: False - library exposed-modules: Control.Monad.Trans.MSF@@ -131,9 +127,11 @@ build-depends: base >= 4.6 && < 5- , MonadRandom >= 0.2 && < 0.7- , simple-affine-space >= 0.2 && < 0.3- , transformers-base >= 0.4 && < 0.5+ , MonadRandom >= 0.2 && < 0.7+ , list-transformer >= 1.1.1 && < 1.2+ , simple-affine-space >= 0.2 && < 0.3+ , transformers >= 0.3 && < 0.7+ , transformers-base >= 0.4 && < 0.5 default-language: Haskell2010@@ -150,17 +148,6 @@ , transformers-compat >= 0.3 && < 0.8 , void >= 0.1 && < 0.8 - -- The upper bound on transformers depends on whether this flag is set- if flag(list-transformer)- build-depends:- list-transformer >= 1.1.1 && < 1.2- , transformers >= 0.3 && < 0.7-- cpp-options: -DLIST_TRANSFORMER- else- build-depends:- transformers >= 0.3 && < 0.6- test-suite hlint type: exitcode-stdio-1.0@@ -180,7 +167,7 @@ else build-depends: base >= 4 && < 5- , hlint >= 1.7 && < 3.7+ , hlint >= 1.7 && < 3.8 -- Verify that the code is thoroughly documented test-suite haddock-coverage@@ -206,7 +193,7 @@ build-depends: base >= 4 && < 5 , directory >= 1.2 && < 1.4- , filepath >= 1.3.0.1 && < 1.5+ , filepath >= 1.3.0.1 && < 1.6 , process >= 1.1.0.2 && < 1.7 , regex-posix >= 0.95 && < 0.97 @@ -230,7 +217,7 @@ build-depends: base >= 4 && < 5 , transformers >= 0.3 && < 0.7- , tasty >= 0.1 && < 1.5+ , tasty >= 0.1 && < 1.6 , tasty-hunit >= 0.8 && < 0.11 , dunai@@ -246,8 +233,8 @@ build-depends: base >= 4 && < 5 , criterion >= 0.5.0.0 && < 1.7- , filepath >= 1.3.0.1 && < 1.5- , time >= 1.4 && < 1.13+ , filepath >= 1.3.0.1 && < 1.6+ , time >= 1.4 && < 1.16 , dunai default-language:
src/Control/Monad/Trans/MSF/List.hs view
@@ -1,11 +1,4 @@ {-# LANGUAGE CPP #-}--- The following warning id disabled so that we do not see warnings during--- compilation caused by the intentional use of ListT.-#if __GLASGOW_HASKELL__ < 800-{-# OPTIONS_GHC -fno-warn-warnings-deprecations #-}-#else-{-# OPTIONS_GHC -Wno-deprecations #-}-#endif -- | -- Copyright : (c) Ivan Perez and Manuel Baerenz, 2016 -- License : BSD3@@ -21,10 +14,6 @@ -- A common use case is to be able to dynamically spawn new interactive -- elements in applications (e.g., a game object that splits in two, or that -- fires to an enemy).------ WARNING: the ListT transformer is considered dangerous, and imposes--- additional constraints on the inner monad in order for the combination of--- the monad and the transformer to be a monad. Use at your own risk. module Control.Monad.Trans.MSF.List ( module Control.Monad.Trans.MSF.List , module List@@ -36,21 +25,15 @@ import Control.Applicative ((<$>)) #endif -#ifdef LIST_TRANSFORMER import Control.Monad (sequence) import List.Transformer (ListT (ListT, next), Step (..), fold, select) import qualified List.Transformer as List-#else-import Control.Monad.Trans.List as List hiding (liftCallCC, liftCatch)-#endif -- Internal imports import Data.MonadicStreamFunction.InternalCore (MSF (MSF, unMSF)) -- * List monad -#ifdef LIST_TRANSFORMER- -- | Run an 'MSF' in the 'ListT' transformer (i.e., multiple MSFs producing -- each producing one output), by applying the input stream to each MSF in the -- list transformer and concatenating the outputs of the MSFs together.@@ -80,35 +63,6 @@ apply a msf = do (b, msf') <- unMSF msf a return (b, sequenceS [msf'])--#else--{-# DEPRECATED widthFirst "This ListT definition is deprecated. Use the list-transformer variant of this function instead." #-}--- | Run an 'MSF' in the 'ListT' transformer (i.e., multiple MSFs producing--- each producing one output), by applying the input stream to each MSF in the--- list transformer and concatenating the outputs of the MSFs together.------ An MSF in the ListT transformer can spawn into more than one MSF, or none,--- so the outputs produced at each individual step are not guaranteed to all--- have the same length.-widthFirst :: (Functor m, Monad m) => MSF (ListT m) a b -> MSF m a [b]-widthFirst msf = widthFirst' [msf]- where- widthFirst' msfs = MSF $ \a -> do- (bs, msfs') <- unzip . concat <$> mapM (runListT . flip unMSF a) msfs- return (bs, widthFirst' msfs')--{-# DEPRECATED sequenceS "This ListT definition is deprecated. Use the list-transformer variant of this function instead." #-}--- | Build an 'MSF' in the 'ListT' transformer by broadcasting the input stream--- value to each MSF in a given list.-sequenceS :: Monad m => [MSF m a b] -> MSF (ListT m) a b-sequenceS msfs = MSF $ \a -> ListT $ sequence $ apply a <$> msfs- where- apply a msf = do- (b, msf') <- unMSF msf a- return (b, sequenceS [msf'])--#endif -- | Apply an 'MSF' to every input. mapMSF :: Monad m => MSF m a b -> MSF m [a] [b]