base-compat 0.9.0 → 0.9.1
raw patch · 5 files changed
+25/−9 lines, 5 filesPVP: major bump suggested
API removals or changes: PVP suggests a major version bump
API changes (from Hackage documentation)
- Control.Monad.Compat: filterM :: (Applicative m) => (a -> m Bool) -> [a] -> m [a]
- Control.Monad.Compat: forever :: (Applicative f) => f a -> f b
- Control.Monad.Compat: mapAndUnzipM :: (Applicative m) => (a -> m (b, c)) -> [a] -> m ([b], [c])
- Control.Monad.Compat: replicateM :: (Applicative m) => Int -> m a -> m [a]
- Control.Monad.Compat: replicateM_ :: (Applicative m) => Int -> m a -> m ()
- Control.Monad.Compat: zipWithM :: (Applicative m) => (a -> b -> m c) -> [a] -> [b] -> m [c]
- Control.Monad.Compat: zipWithM_ :: (Applicative m) => (a -> b -> m c) -> [a] -> [b] -> m ()
- Data.Ratio.Compat: denominator :: Ratio a -> a
- Data.Ratio.Compat: numerator :: Ratio a -> a
- Prelude.Compat: (!!) :: [a] -> Int -> a
- Prelude.Compat: ($!) :: (a -> b) -> a -> b
- Prelude.Compat: ($) :: (a -> b) -> a -> b
- Prelude.Compat: (&&) :: Bool -> Bool -> Bool
- Prelude.Compat: (*) :: Num a => a -> a -> a
- Prelude.Compat: (**) :: Floating a => a -> a -> a
- Prelude.Compat: (*>) :: Applicative f => f a -> f b -> f b
- Prelude.Compat: (+) :: Num a => a -> a -> a
- Prelude.Compat: (++) :: [a] -> [a] -> [a]
- Prelude.Compat: (-) :: Num a => a -> a -> a
- Prelude.Compat: (.) :: (b -> c) -> (a -> b) -> a -> c
- Prelude.Compat: (/) :: Fractional a => a -> a -> a
- Prelude.Compat: (/=) :: Eq a => a -> a -> Bool
- Prelude.Compat: (<$) :: Functor f => a -> f b -> f a
- Prelude.Compat: (<$>) :: Functor f => (a -> b) -> f a -> f b
- Prelude.Compat: (<) :: Ord a => a -> a -> Bool
- Prelude.Compat: (<*) :: Applicative f => f a -> f b -> f a
- Prelude.Compat: (<*>) :: Applicative f => f (a -> b) -> f a -> f b
- Prelude.Compat: (<=) :: Ord a => a -> a -> Bool
- Prelude.Compat: (=<<) :: Monad m => (a -> m b) -> m a -> m b
- Prelude.Compat: (==) :: Eq a => a -> a -> Bool
- Prelude.Compat: (>) :: Ord a => a -> a -> Bool
- Prelude.Compat: (>=) :: Ord a => a -> a -> Bool
- Prelude.Compat: (>>) :: Monad m => m a -> m b -> m b
- Prelude.Compat: (>>=) :: Monad m => m a -> (a -> m b) -> m b
- Prelude.Compat: (^) :: (Num a, Integral b) => a -> b -> a
- Prelude.Compat: (^^) :: (Fractional a, Integral b) => a -> b -> a
- Prelude.Compat: (||) :: Bool -> Bool -> Bool
- Prelude.Compat: EQ :: Ordering
- Prelude.Compat: False :: Bool
- Prelude.Compat: GT :: Ordering
- Prelude.Compat: Just :: a -> Maybe a
- Prelude.Compat: LT :: Ordering
- Prelude.Compat: Left :: a -> Either a b
- Prelude.Compat: Nothing :: Maybe a
- Prelude.Compat: Right :: b -> Either a b
- Prelude.Compat: True :: Bool
- Prelude.Compat: abs :: Num a => a -> a
- Prelude.Compat: acos :: Floating a => a -> a
- Prelude.Compat: acosh :: Floating a => a -> a
- Prelude.Compat: all :: Foldable t => (a -> Bool) -> t a -> Bool
- Prelude.Compat: and :: Foldable t => t Bool -> Bool
- Prelude.Compat: any :: Foldable t => (a -> Bool) -> t a -> Bool
- Prelude.Compat: appendFile :: FilePath -> String -> IO ()
- Prelude.Compat: asTypeOf :: a -> a -> a
- Prelude.Compat: asin :: Floating a => a -> a
- Prelude.Compat: asinh :: Floating a => a -> a
- Prelude.Compat: atan :: Floating a => a -> a
- Prelude.Compat: atan2 :: RealFloat a => a -> a -> a
- Prelude.Compat: atanh :: Floating a => a -> a
- Prelude.Compat: break :: (a -> Bool) -> [a] -> ([a], [a])
- Prelude.Compat: ceiling :: (RealFrac a, Integral b) => a -> b
- Prelude.Compat: class Functor f => Applicative (f :: * -> *)
- Prelude.Compat: class Bounded a
- Prelude.Compat: class Enum a
- Prelude.Compat: class Eq a
- Prelude.Compat: class Fractional a => Floating a
- Prelude.Compat: class Foldable (t :: * -> *)
- Prelude.Compat: class Num a => Fractional a
- Prelude.Compat: class Functor (f :: * -> *)
- Prelude.Compat: class (Real a, Enum a) => Integral a
- Prelude.Compat: class Applicative m => Monad (m :: * -> *)
- Prelude.Compat: class Monoid a
- Prelude.Compat: class Num a
- Prelude.Compat: class Eq a => Ord a
- Prelude.Compat: class Read a
- Prelude.Compat: class (Num a, Ord a) => Real a
- Prelude.Compat: class (RealFrac a, Floating a) => RealFloat a
- Prelude.Compat: class (Real a, Fractional a) => RealFrac a
- Prelude.Compat: class Show a
- Prelude.Compat: class (Functor t, Foldable t) => Traversable (t :: * -> *)
- Prelude.Compat: compare :: Ord a => a -> a -> Ordering
- Prelude.Compat: concat :: Foldable t => t [a] -> [a]
- Prelude.Compat: concatMap :: Foldable t => (a -> [b]) -> t a -> [b]
- Prelude.Compat: const :: a -> b -> a
- Prelude.Compat: cos :: Floating a => a -> a
- Prelude.Compat: cosh :: Floating a => a -> a
- Prelude.Compat: curry :: ((a, b) -> c) -> a -> b -> c
- Prelude.Compat: cycle :: [a] -> [a]
- Prelude.Compat: data Bool :: *
- Prelude.Compat: data Char :: *
- Prelude.Compat: data Double :: *
- Prelude.Compat: data Either a b :: * -> * -> *
- Prelude.Compat: data Float :: *
- Prelude.Compat: data IO a :: * -> *
- Prelude.Compat: data Int :: *
- Prelude.Compat: data Integer :: *
- Prelude.Compat: data Maybe a :: * -> *
- Prelude.Compat: data Ordering :: *
- Prelude.Compat: data Word :: *
- Prelude.Compat: decodeFloat :: RealFloat a => a -> (Integer, Int)
- Prelude.Compat: div :: Integral a => a -> a -> a
- Prelude.Compat: divMod :: Integral a => a -> a -> (a, a)
- Prelude.Compat: drop :: Int -> [a] -> [a]
- Prelude.Compat: dropWhile :: (a -> Bool) -> [a] -> [a]
- Prelude.Compat: either :: (a -> c) -> (b -> c) -> Either a b -> c
- Prelude.Compat: elem :: (Foldable t, Eq a) => a -> t a -> Bool
- Prelude.Compat: encodeFloat :: RealFloat a => Integer -> Int -> a
- Prelude.Compat: enumFrom :: Enum a => a -> [a]
- Prelude.Compat: enumFromThen :: Enum a => a -> a -> [a]
- Prelude.Compat: enumFromThenTo :: Enum a => a -> a -> a -> [a]
- Prelude.Compat: enumFromTo :: Enum a => a -> a -> [a]
- Prelude.Compat: error :: [Char] -> a
- Prelude.Compat: errorWithoutStackTrace :: [Char] -> a
- Prelude.Compat: even :: Integral a => a -> Bool
- Prelude.Compat: exp :: Floating a => a -> a
- Prelude.Compat: exponent :: RealFloat a => a -> Int
- Prelude.Compat: fail :: Monad m => String -> m a
- Prelude.Compat: filter :: (a -> Bool) -> [a] -> [a]
- Prelude.Compat: flip :: (a -> b -> c) -> b -> a -> c
- Prelude.Compat: floatDigits :: RealFloat a => a -> Int
- Prelude.Compat: floatRadix :: RealFloat a => a -> Integer
- Prelude.Compat: floatRange :: RealFloat a => a -> (Int, Int)
- Prelude.Compat: floor :: (RealFrac a, Integral b) => a -> b
- Prelude.Compat: fmap :: Functor f => (a -> b) -> f a -> f b
- Prelude.Compat: foldMap :: (Foldable t, Monoid m) => (a -> m) -> t a -> m
- Prelude.Compat: foldl :: Foldable t => (b -> a -> b) -> b -> t a -> b
- Prelude.Compat: foldl1 :: Foldable t => (a -> a -> a) -> t a -> a
- Prelude.Compat: foldr :: Foldable t => (a -> b -> b) -> b -> t a -> b
- Prelude.Compat: foldr1 :: Foldable t => (a -> a -> a) -> t a -> a
- Prelude.Compat: fromEnum :: Enum a => a -> Int
- Prelude.Compat: fromInteger :: Num a => Integer -> a
- Prelude.Compat: fromIntegral :: (Integral a, Num b) => a -> b
- Prelude.Compat: fromRational :: Fractional a => Rational -> a
- Prelude.Compat: fst :: (a, b) -> a
- Prelude.Compat: gcd :: Integral a => a -> a -> a
- Prelude.Compat: getChar :: IO Char
- Prelude.Compat: getContents :: IO String
- Prelude.Compat: getLine :: IO String
- Prelude.Compat: head :: [a] -> a
- Prelude.Compat: id :: a -> a
- Prelude.Compat: init :: [a] -> [a]
- Prelude.Compat: interact :: (String -> String) -> IO ()
- Prelude.Compat: ioError :: IOError -> IO a
- Prelude.Compat: isDenormalized :: RealFloat a => a -> Bool
- Prelude.Compat: isIEEE :: RealFloat a => a -> Bool
- Prelude.Compat: isInfinite :: RealFloat a => a -> Bool
- Prelude.Compat: isNaN :: RealFloat a => a -> Bool
- Prelude.Compat: isNegativeZero :: RealFloat a => a -> Bool
- Prelude.Compat: iterate :: (a -> a) -> a -> [a]
- Prelude.Compat: last :: [a] -> a
- Prelude.Compat: lcm :: Integral a => a -> a -> a
- Prelude.Compat: length :: Foldable t => t a -> Int
- Prelude.Compat: lex :: ReadS String
- Prelude.Compat: lines :: String -> [String]
- Prelude.Compat: log :: Floating a => a -> a
- Prelude.Compat: logBase :: Floating a => a -> a -> a
- Prelude.Compat: lookup :: Eq a => a -> [(a, b)] -> Maybe b
- Prelude.Compat: map :: (a -> b) -> [a] -> [b]
- Prelude.Compat: mapM :: (Traversable t, Monad m) => (a -> m b) -> t a -> m (t b)
- Prelude.Compat: mapM_ :: (Foldable t, Monad m) => (a -> m b) -> t a -> m ()
- Prelude.Compat: mappend :: Monoid a => a -> a -> a
- Prelude.Compat: max :: Ord a => a -> a -> a
- Prelude.Compat: maxBound :: Bounded a => a
- Prelude.Compat: maximum :: (Foldable t, Ord a) => t a -> a
- Prelude.Compat: maybe :: b -> (a -> b) -> Maybe a -> b
- Prelude.Compat: mconcat :: Monoid a => [a] -> a
- Prelude.Compat: mempty :: Monoid a => a
- Prelude.Compat: min :: Ord a => a -> a -> a
- Prelude.Compat: minBound :: Bounded a => a
- Prelude.Compat: minimum :: (Foldable t, Ord a) => t a -> a
- Prelude.Compat: mod :: Integral a => a -> a -> a
- Prelude.Compat: negate :: Num a => a -> a
- Prelude.Compat: not :: Bool -> Bool
- Prelude.Compat: notElem :: (Foldable t, Eq a) => a -> t a -> Bool
- Prelude.Compat: null :: Foldable t => t a -> Bool
- Prelude.Compat: odd :: Integral a => a -> Bool
- Prelude.Compat: or :: Foldable t => t Bool -> Bool
- Prelude.Compat: otherwise :: Bool
- Prelude.Compat: pi :: Floating a => a
- Prelude.Compat: pred :: Enum a => a -> a
- Prelude.Compat: print :: Show a => a -> IO ()
- Prelude.Compat: product :: (Foldable t, Num a) => t a -> a
- Prelude.Compat: properFraction :: (RealFrac a, Integral b) => a -> (b, a)
- Prelude.Compat: pure :: Applicative f => a -> f a
- Prelude.Compat: putChar :: Char -> IO ()
- Prelude.Compat: putStr :: String -> IO ()
- Prelude.Compat: putStrLn :: String -> IO ()
- Prelude.Compat: quot :: Integral a => a -> a -> a
- Prelude.Compat: quotRem :: Integral a => a -> a -> (a, a)
- Prelude.Compat: read :: Read a => String -> a
- Prelude.Compat: readFile :: FilePath -> IO String
- Prelude.Compat: readIO :: Read a => String -> IO a
- Prelude.Compat: readList :: Read a => ReadS [a]
- Prelude.Compat: readLn :: Read a => IO a
- Prelude.Compat: readParen :: Bool -> ReadS a -> ReadS a
- Prelude.Compat: reads :: Read a => ReadS a
- Prelude.Compat: readsPrec :: Read a => Int -> ReadS a
- Prelude.Compat: realToFrac :: (Real a, Fractional b) => a -> b
- Prelude.Compat: recip :: Fractional a => a -> a
- Prelude.Compat: rem :: Integral a => a -> a -> a
- Prelude.Compat: repeat :: a -> [a]
- Prelude.Compat: replicate :: Int -> a -> [a]
- Prelude.Compat: return :: Monad m => a -> m a
- Prelude.Compat: reverse :: [a] -> [a]
- Prelude.Compat: round :: (RealFrac a, Integral b) => a -> b
- Prelude.Compat: scaleFloat :: RealFloat a => Int -> a -> a
- Prelude.Compat: scanl :: (b -> a -> b) -> b -> [a] -> [b]
- Prelude.Compat: scanl1 :: (a -> a -> a) -> [a] -> [a]
- Prelude.Compat: scanr :: (a -> b -> b) -> b -> [a] -> [b]
- Prelude.Compat: scanr1 :: (a -> a -> a) -> [a] -> [a]
- Prelude.Compat: seq :: a -> b -> b
- Prelude.Compat: sequence :: (Traversable t, Monad m) => t (m a) -> m (t a)
- Prelude.Compat: sequenceA :: (Traversable t, Applicative f) => t (f a) -> f (t a)
- Prelude.Compat: sequence_ :: (Foldable t, Monad m) => t (m a) -> m ()
- Prelude.Compat: show :: Show a => a -> String
- Prelude.Compat: showChar :: Char -> ShowS
- Prelude.Compat: showList :: Show a => [a] -> ShowS
- Prelude.Compat: showParen :: Bool -> ShowS -> ShowS
- Prelude.Compat: showString :: String -> ShowS
- Prelude.Compat: shows :: Show a => a -> ShowS
- Prelude.Compat: showsPrec :: Show a => Int -> a -> ShowS
- Prelude.Compat: significand :: RealFloat a => a -> a
- Prelude.Compat: signum :: Num a => a -> a
- Prelude.Compat: sin :: Floating a => a -> a
- Prelude.Compat: sinh :: Floating a => a -> a
- Prelude.Compat: snd :: (a, b) -> b
- Prelude.Compat: span :: (a -> Bool) -> [a] -> ([a], [a])
- Prelude.Compat: splitAt :: Int -> [a] -> ([a], [a])
- Prelude.Compat: sqrt :: Floating a => a -> a
- Prelude.Compat: subtract :: Num a => a -> a -> a
- Prelude.Compat: succ :: Enum a => a -> a
- Prelude.Compat: sum :: (Foldable t, Num a) => t a -> a
- Prelude.Compat: tail :: [a] -> [a]
- Prelude.Compat: take :: Int -> [a] -> [a]
- Prelude.Compat: takeWhile :: (a -> Bool) -> [a] -> [a]
- Prelude.Compat: tan :: Floating a => a -> a
- Prelude.Compat: tanh :: Floating a => a -> a
- Prelude.Compat: toEnum :: Enum a => Int -> a
- Prelude.Compat: toInteger :: Integral a => a -> Integer
- Prelude.Compat: toRational :: Real a => a -> Rational
- Prelude.Compat: traverse :: (Traversable t, Applicative f) => (a -> f b) -> t a -> f (t b)
- Prelude.Compat: truncate :: (RealFrac a, Integral b) => a -> b
- Prelude.Compat: type FilePath = String
- Prelude.Compat: type IOError = IOException
- Prelude.Compat: type Rational = Ratio Integer
- Prelude.Compat: type ReadS a = String -> [(a, String)]
- Prelude.Compat: type ShowS = String -> String
- Prelude.Compat: type String = [Char]
- Prelude.Compat: uncurry :: (a -> b -> c) -> (a, b) -> c
- Prelude.Compat: undefined :: a
- Prelude.Compat: unlines :: [String] -> String
- Prelude.Compat: until :: (a -> Bool) -> (a -> a) -> a -> a
- Prelude.Compat: unwords :: [String] -> String
- Prelude.Compat: unzip :: [(a, b)] -> ([a], [b])
- Prelude.Compat: unzip3 :: [(a, b, c)] -> ([a], [b], [c])
- Prelude.Compat: userError :: String -> IOError
- Prelude.Compat: words :: String -> [String]
- Prelude.Compat: writeFile :: FilePath -> String -> IO ()
- Prelude.Compat: zip :: [a] -> [b] -> [(a, b)]
- Prelude.Compat: zip3 :: [a] -> [b] -> [c] -> [(a, b, c)]
- Prelude.Compat: zipWith :: (a -> b -> c) -> [a] -> [b] -> [c]
- Prelude.Compat: zipWith3 :: (a -> b -> c -> d) -> [a] -> [b] -> [c] -> [d]
+ Data.Function.Compat: infixl 1 &
+ Data.Functor.Compat: infixl 4 $>
+ Data.Monoid.Compat: infixr 6 <>
- Control.Monad.Compat: (>>) :: Monad m => m a -> m b -> m b
+ Control.Monad.Compat: (>>) :: m a -> m b -> m b
- Control.Monad.Compat: (>>=) :: Monad m => m a -> (a -> m b) -> m b
+ Control.Monad.Compat: (>>=) :: m a -> (a -> m b) -> m b
- Control.Monad.Compat: fail :: Monad m => String -> m a
+ Control.Monad.Compat: fail :: String -> m a
- Control.Monad.Compat: mplus :: MonadPlus m => m a -> m a -> m a
+ Control.Monad.Compat: mplus :: m a -> m a -> m a
- Control.Monad.Compat: mzero :: MonadPlus m => m a
+ Control.Monad.Compat: mzero :: m a
- Control.Monad.Compat: return :: Monad m => a -> m a
+ Control.Monad.Compat: return :: a -> m a
- Data.Functor.Compat: (<$) :: Functor f => a -> f b -> f a
+ Data.Functor.Compat: (<$) :: a -> f b -> f a
- Data.Functor.Compat: fmap :: Functor f => (a -> b) -> f a -> f b
+ Data.Functor.Compat: fmap :: (a -> b) -> f a -> f b
- Data.Functor.Const.Compat: Const :: a -> Const a b
+ Data.Functor.Const.Compat: Const :: a -> Const k a
- Data.Functor.Const.Compat: [getConst] :: Const a b -> a
+ Data.Functor.Const.Compat: [getConst] :: Const k a -> a
- Data.Functor.Const.Compat: newtype Const a b :: * -> * -> *
+ Data.Functor.Const.Compat: newtype Const k a (b :: k) :: forall k. * -> k -> *
- Debug.Trace.Compat: traceM :: (Applicative f) => String -> f ()
+ Debug.Trace.Compat: traceM :: Applicative f => String -> f ()
- Text.Read.Compat: readList :: Read a => ReadS [a]
+ Text.Read.Compat: readList :: ReadS [a]
- Text.Read.Compat: readListPrec :: Read a => ReadPrec [a]
+ Text.Read.Compat: readListPrec :: ReadPrec [a]
- Text.Read.Compat: readPrec :: Read a => ReadPrec a
+ Text.Read.Compat: readPrec :: ReadPrec a
- Text.Read.Compat: readsPrec :: Read a => Int -> ReadS a
+ Text.Read.Compat: readsPrec :: Int -> ReadS a
Files
- CHANGES.markdown +4/−0
- LICENSE +1/−1
- README.markdown +3/−0
- base-compat.cabal +5/−4
- src/Control/Monad/Compat.hs +12/−4
CHANGES.markdown view
@@ -1,3 +1,7 @@+## Changes in 0.9.1+ - Use the more efficient version of `replicateM` and `replicateM_` introduced+ in `base-4.9`+ ## Changes in 0.9.0 - Sync with `base-4.9`/GHC 8.0 - Weakened `RealFloat` constraints on `realPart`, `imagPart`, `conjugate`,
LICENSE view
@@ -1,4 +1,4 @@-Copyright (c) 2012-2015 Simon Hengel <sol@typeful.net> and Ryan Scott <ryan.gl.scott@gmail.com>+Copyright (c) 2012-2016 Simon Hengel <sol@typeful.net> and Ryan Scott <ryan.gl.scott@gmail.com> Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal
README.markdown view
@@ -194,6 +194,9 @@ * [`bifunctors`](http://hackage.haskell.org/package/bifunctors) for the [`Bifunctor`](http://hackage.haskell.org/package/base-4.8.0.0/docs/Data-Bifunctor.html#t:Bifunctor) type class, introduced in `base-4.8.0.0`+* [`fail`](http://hackage.haskell.org/package/fail)+ for the [`MonadFail`](http://hackage.haskell.org/package/base-4.9.0.0/docs/Control-Monad-Fail.html#t:MonadFail)+ type class, introduced in `base-4.9.0.0` * [`generic-deriving`](http://hackage.haskell.org/package/generic-deriving) for everything in the [`GHC.Generics`](http://hackage.haskell.org/package/base-4.8.0.0/docs/GHC-Generics.html) module, introduced to `ghc-prim` in GHC 7.2 (and later moved to `base-4.6.0.0`)
base-compat.cabal view
@@ -1,10 +1,10 @@ name: base-compat-version: 0.9.0+version: 0.9.1 license: MIT license-file: LICENSE-copyright: (c) 2012-2015 Simon Hengel,- (c) 2014 João Cristóvão,- (c) 2015 Ryan Scott+copyright: (c) 2012-2016 Simon Hengel,+ (c) 2014-2016 João Cristóvão,+ (c) 2015-2016 Ryan Scott author: Simon Hengel <sol@typeful.net>, João Cristóvão <jmacristovao@gmail.com>, Ryan Scott <ryan.gl.scott@gmail.com>@@ -38,6 +38,7 @@ , GHC == 7.6.1, GHC == 7.6.2, GHC == 7.6.3 , GHC == 7.8.1, GHC == 7.8.2, GHC == 7.8.3, GHC == 7.8.4 , GHC == 7.10.1, GHC == 7.10.2, GHC == 7.10.3+ , GHC == 8.0.1 extra-source-files: CHANGES.markdown, README.markdown source-repository head
src/Control/Monad/Compat.hs view
@@ -171,14 +171,22 @@ {-# INLINEABLE replicateM #-} {-# SPECIALISE replicateM :: Int -> IO a -> IO [a] #-} {-# SPECIALISE replicateM :: Int -> Maybe a -> Maybe [a] #-}-replicateM 0 _ = pure []-replicateM n x = liftA2 (:) x (replicateM (pred n) x)+replicateM cnt0 f =+ loop cnt0+ where+ loop cnt+ | cnt <= 0 = pure []+ | otherwise = liftA2 (:) f (loop (cnt - 1)) -- | Like 'replicateM', but discards the result. replicateM_ :: (Applicative m) => Int -> m a -> m () {-# INLINEABLE replicateM_ #-} {-# SPECIALISE replicateM_ :: Int -> IO a -> IO () #-} {-# SPECIALISE replicateM_ :: Int -> Maybe a -> Maybe () #-}-replicateM_ 0 _ = pure ()-replicateM_ n x = x *> replicateM_ (pred n) x+replicateM_ cnt0 f =+ loop cnt0+ where+ loop cnt+ | cnt <= 0 = pure ()+ | otherwise = f *> loop (cnt - 1) #endif