foundation-0.0.23: Alternative prelude with batteries and no dependencies

Safe Haskell | None
Language | Haskell2010

Foundation.Monad

Synopsis

- class Monad m => MonadIO (m :: Type -> Type) where
  - liftIO :: IO a -> m a
- class AMPMonad m => MonadFailure (m :: Type -> Type) where
  - type Failure (m :: Type -> Type) :: Type
  - mFail :: Failure m -> m ()
- class AMPMonad m => MonadThrow m where
  - throw :: Exception e => e -> m a
- class MonadThrow m => MonadCatch m where
  - catch :: Exception e => m a -> (e -> m a) -> m a
- class MonadCatch m => MonadBracket m where
  - generalBracket :: m a -> (a -> b -> m ignored1) -> (a -> SomeException -> m ignored2) -> (a -> m b) -> m b
- class MonadTrans trans where
  - lift :: AMPMonad m => m a -> trans m a
- newtype Identity a = Identity {
  - runIdentity :: a
  }
- replicateM :: Applicative m => CountOf a -> m a -> m [a]

# Documentation

class Monad m => MonadIO (m :: Type -> Type) where Source #

Monads in which `IO` computations may be embedded. Any monad built by applying a sequence of monad transformers to the `IO` monad will be an instance of this class.

Instances should satisfy the following laws, which state that `liftIO` is a transformer of monads:

-     liftIO . return = return

-     liftIO (m >>= f) = liftIO m >>= (liftIO . f)

Methods

liftIO :: IO a -> m a Source #

Lift a computation from the `IO` monad.

Instances

MonadIO IO | Since: base-4.9.0.0
Instance details Defined in Control.Monad.IO.Class Methods liftIO :: IO a -> IO a Source #
MonadIO m => MonadIO (ResourceT m) Source # |
Instance details Defined in Foundation.Conduit.Internal Methods liftIO :: IO a -> ResourceT m a Source #
(Functor m, MonadIO m) => MonadIO (StateT s m) Source # |
Instance details Defined in Foundation.Monad.State Methods liftIO :: IO a -> StateT s m a Source #
MonadIO m => MonadIO (ReaderT r m) Source # |
Instance details Defined in Foundation.Monad.Reader Methods liftIO :: IO a -> ReaderT r m a Source #
MonadIO m => MonadIO (ExceptT e m) Source # |
Instance details Defined in Foundation.Monad.Except Methods liftIO :: IO a -> ExceptT e m a Source #
MonadIO m => MonadIO (Conduit i o m) Source # |
Instance details Defined in Foundation.Conduit.Internal Methods liftIO :: IO a -> Conduit i o m a Source #

class AMPMonad m => MonadFailure (m :: Type -> Type) where Source #

Monad that can represent failure

Similar to MonadFail but with a parametrized Failure linked to the Monad

Associated Types

type Failure (m :: Type -> Type) :: Type Source #

The associated type with the MonadFailure, representing what failure can be encoded in this monad

Methods

mFail :: Failure m -> m () Source #

Raise a Failure through a monad.

Instances

MonadFailure Maybe |
Instance details Defined in Basement.Monad Associated Types type Failure Maybe :: Type Source # Methods mFail :: Failure Maybe -> Maybe () Source #
MonadFailure (Either a) |
Instance details Defined in Basement.Monad Associated Types type Failure (Either a) :: Type Source # Methods mFail :: Failure (Either a) -> Either a () Source #
(Functor m, MonadFailure m) => MonadFailure (StateT s m) Source # |
Instance details Defined in Foundation.Monad.State Associated Types type Failure (StateT s m) :: Type Source # Methods mFail :: Failure (StateT s m) -> StateT s m () Source #
MonadFailure m => MonadFailure (ReaderT r m) Source # |
Instance details Defined in Foundation.Monad.Reader Associated Types type Failure (ReaderT r m) :: Type Source # Methods mFail :: Failure (ReaderT r m) -> ReaderT r m () Source #
AMPMonad m => MonadFailure (ExceptT e m) Source # |
Instance details Defined in Foundation.Monad.Except Associated Types type Failure (ExceptT e m) :: Type Source # Methods mFail :: Failure (ExceptT e m) -> ExceptT e m () Source #
MonadFailure m => MonadFailure (Conduit i o m) Source # |
Instance details Defined in Foundation.Conduit.Internal Associated Types type Failure (Conduit i o m) :: Type Source # Methods mFail :: Failure (Conduit i o m) -> Conduit i o m () Source #
Monad state => MonadFailure (Builder collection mutCollection step state err) |
Instance details Defined in Basement.MutableBuilder Associated Types type Failure (Builder collection mutCollection step state err) :: Type Source # Methods mFail :: Failure (Builder collection mutCollection step state err) -> Builder collection mutCollection step state err () Source #

class AMPMonad m => MonadThrow m where Source #

Monad that can throw exception

Methods

throw :: Exception e => e -> m a Source #

Throw immediatity an exception. Only a `MonadCatch` monad will be able to catch the exception using `catch`

Instances

MonadThrow IO Source # |
Instance details Defined in Foundation.Monad.Exception Methods throw :: Exception e => e -> IO a Source #
MonadThrow m => MonadThrow (ResourceT m) Source # |
Instance details Defined in Foundation.Conduit.Internal Methods throw :: Exception e => e -> ResourceT m a Source #
(Functor m, MonadThrow m) => MonadThrow (StateT s m) Source # |
Instance details Defined in Foundation.Monad.State Methods throw :: Exception e => e -> StateT s m a Source #
MonadThrow m => MonadThrow (ReaderT r m) Source # |
Instance details Defined in Foundation.Monad.Reader Methods throw :: Exception e => e -> ReaderT r m a Source #
MonadThrow m => MonadThrow (Conduit i o m) Source # |
Instance details Defined in Foundation.Conduit.Internal Methods throw :: Exception e => e -> Conduit i o m a Source #

class MonadThrow m => MonadCatch m where Source #

Monad that can catch exception

Methods

catch :: Exception e => m a -> (e -> m a) -> m a Source #

Instances

MonadCatch IO Source # |
Instance details Defined in Foundation.Monad.Exception Methods catch :: Exception e => IO a -> (e -> IO a) -> IO a Source #
MonadCatch m => MonadCatch (ResourceT m) Source # |
Instance details Defined in Foundation.Conduit.Internal Methods catch :: Exception e => ResourceT m a -> (e -> ResourceT m a) -> ResourceT m a Source #
(Functor m, MonadCatch m) => MonadCatch (StateT s m) Source # |
Instance details Defined in Foundation.Monad.State Methods catch :: Exception e => StateT s m a -> (e -> StateT s m a) -> StateT s m a Source #
MonadCatch m => MonadCatch (ReaderT r m) Source # |
Instance details Defined in Foundation.Monad.Reader Methods catch :: Exception e => ReaderT r m a -> (e -> ReaderT r m a) -> ReaderT r m a Source #
MonadCatch m => MonadCatch (Conduit i o m) Source # |
Instance details Defined in Foundation.Conduit.Internal Methods catch :: Exception e => Conduit i o m a -> (e -> Conduit i o m a) -> Conduit i o m a Source #

class MonadCatch m => MonadBracket m where Source #

Monad that can ensure cleanup actions are performed even in the case of exceptions, both synchronous and asynchronous. This usually excludes continuation-based monads.

Methods

generalBracket Source #

Arguments

:: m a | acquire some resource
-> (a -> b -> m ignored1) | cleanup, no exception thrown
-> (a -> SomeException -> m ignored2) | cleanup, some exception thrown. The exception will be rethrown
-> (a -> m b) | inner action to perform with the resource
-> m b |

A generalized version of the standard bracket function which allows distinguishing different exit cases.

Instances

MonadBracket IO Source # |
Instance details Defined in Foundation.Monad.Exception Methods generalBracket :: IO a -> (a -> b -> IO ignored1) -> (a -> SomeException -> IO ignored2) -> (a -> IO b) -> IO b Source #
MonadBracket m => MonadBracket (ResourceT m) Source # |
Instance details Defined in Foundation.Conduit.Internal Methods generalBracket :: ResourceT m a -> (a -> b -> ResourceT m ignored1) -> (a -> SomeException -> ResourceT m ignored2) -> (a -> ResourceT m b) -> ResourceT m b Source #
MonadBracket m => MonadBracket (ReaderT r m) Source # |
Instance details Defined in Foundation.Monad.Reader Methods generalBracket :: ReaderT r m a -> (a -> b -> ReaderT r m ignored1) -> (a -> SomeException -> ReaderT r m ignored2) -> (a -> ReaderT r m b) -> ReaderT r m b Source #

class MonadTrans trans where Source #

Basic Transformer class

Methods

lift :: AMPMonad m => m a -> trans m a Source #

Lift a computation from an inner monad to the current transformer monad

Instances

MonadTrans ResourceT Source # |
Instance details Defined in Foundation.Conduit.Internal Methods lift :: AMPMonad m => m a -> ResourceT m a Source #
MonadTrans (StateT s) Source # |
Instance details Defined in Foundation.Monad.State Methods lift :: AMPMonad m => m a -> StateT s m a Source #
MonadTrans (ReaderT r) Source # |
Instance details Defined in Foundation.Monad.Reader Methods lift :: AMPMonad m => m a -> ReaderT r m a Source #
MonadTrans (ExceptT e) Source # |
Instance details Defined in Foundation.Monad.Except Methods lift :: AMPMonad m => m a -> ExceptT e m a Source #
MonadTrans (Conduit i o) Source # |
Instance details Defined in Foundation.Conduit.Internal Methods lift :: AMPMonad m => m a -> Conduit i o m a Source #

newtype Identity a Source #

Identity functor and monad. (a non-strict monad)

Since: base-4.8.0.0

Constructors

Identity |

Fields

- runIdentity :: a

Instances

Monad Identity | Since: base-4.8.0.0
Instance details Defined in Data.Functor.Identity Methods (>>=) :: Identity a -> (a -> Identity b) -> Identity b Source # (>>) :: Identity a -> Identity b -> Identity b Source # return :: a -> Identity a Source # fail :: String -> Identity a Source #
Functor Identity | Since: base-4.8.0.0
Instance details Defined in Data.Functor.Identity Methods fmap :: (a -> b) -> Identity a -> Identity b Source # (<$) :: a -> Identity b -> Identity a Source #
MonadFix Identity | Since: base-4.8.0.0
Instance details Defined in Data.Functor.Identity Methods mfix :: (a -> Identity a) -> Identity a Source #
Applicative Identity | Since: base-4.8.0.0
Instance details Defined in Data.Functor.Identity Methods pure :: a -> Identity a Source # (<*>) :: Identity (a -> b) -> Identity a -> Identity b Source # liftA2 :: (a -> b -> c) -> Identity a -> Identity b -> Identity c Source # (*>) :: Identity a -> Identity b -> Identity b Source # (<*) :: Identity a -> Identity b -> Identity a Source #
Foldable Identity | Since: base-4.8.0.0

Instance details

Defined in Data.Functor.Identity

Methods

fold :: Monoid m => Identity m -> m Source #

foldMap :: Monoid m => (a -> m) -> Identity a -> m Source #

foldr :: (a -> b -> b) -> b -> Identity a -> b Source #

foldr' :: (a -> b -> b) -> b -> Identity a -> b Source #

foldl :: (b -> a -> b) -> b -> Identity a -> b Source #

foldl' :: (b -> a -> b) -> b -> Identity a -> b Source #

foldr1 :: (a -> a -> a) -> Identity a -> a Source #

foldl1 :: (a -> a -> a) -> Identity a -> a Source #

toList :: Identity a -> [a] Source #

null :: Identity a -> Bool Source #

length :: Identity a -> Int Source #

elem :: Eq a => a -> Identity a -> Bool Source #

maximum :: Ord a => Identity a -> a Source #

minimum :: Ord a => Identity a -> a Source #

sum :: Num a => Identity a -> a Source #

product :: Num a => Identity a -> a Source #

Traversable Identity | Since: base-4.9.0.0
Instance details Defined in Data.Traversable Methods traverse :: Applicative f => (a -> f b) -> Identity a -> f (Identity b) Source # sequenceA :: Applicative f => Identity (f a) -> f (Identity a) Source # mapM :: Monad m => (a -> m b) -> Identity a -> m (Identity b) Source # sequence :: Monad m => Identity (m a) -> m (Identity a) Source #
Bounded a => Bounded (Identity a) | Since: base-4.9.0.0
Instance details Defined in Data.Functor.Identity Methods minBound :: Identity a Source # maxBound :: Identity a Source #
Enum a => Enum (Identity a) | Since: base-4.9.0.0

Instance details

Defined in Data.Functor.Identity

Methods

succ :: Identity a -> Identity a Source #

pred :: Identity a -> Identity a Source #

toEnum :: Int -> Identity a Source #

fromEnum :: Identity a -> Int Source #

enumFrom :: Identity a -> [Identity a] Source #

enumFromThen :: Identity a -> Identity a -> [Identity a] Source #

enumFromTo :: Identity a -> Identity a -> [Identity a] Source #

enumFromThenTo :: Identity a -> Identity a -> Identity a -> [Identity a] Source #

Eq a => Eq (Identity a) | Since: base-4.8.0.0
Instance details Defined in Data.Functor.Identity Methods (==) :: Identity a -> Identity a -> Bool Source # (/=) :: Identity a -> Identity a -> Bool Source #
Floating a => Floating (Identity a) | Since: base-4.9.0.0

Instance details

Defined in Data.Functor.Identity

Methods

pi :: Identity a Source #

exp :: Identity a -> Identity a Source #

log :: Identity a -> Identity a Source #

sqrt :: Identity a -> Identity a Source #

(**) :: Identity a -> Identity a -> Identity a Source #

logBase :: Identity a -> Identity a -> Identity a Source #

sin :: Identity a -> Identity a Source #

cos :: Identity a -> Identity a Source #

tan :: Identity a -> Identity a Source #

asin :: Identity a -> Identity a Source #

acos :: Identity a -> Identity a Source #

atan :: Identity a -> Identity a Source #

sinh :: Identity a -> Identity a Source #

cosh :: Identity a -> Identity a Source #

tanh :: Identity a -> Identity a Source #

asinh :: Identity a -> Identity a Source #

acosh :: Identity a -> Identity a Source #

atanh :: Identity a -> Identity a Source #

log1p :: Identity a -> Identity a Source #

expm1 :: Identity a -> Identity a Source #

log1pexp :: Identity a -> Identity a Source #

log1mexp :: Identity a -> Identity a Source #

Fractional a => Fractional (Identity a) | Since: base-4.9.0.0
Instance details Defined in Data.Functor.Identity Methods (/) :: Identity a -> Identity a -> Identity a Source # recip :: Identity a -> Identity a Source # fromRational :: Rational -> Identity a Source #
Integral a => Integral (Identity a) | Since: base-4.9.0.0

Instance details

Defined in Data.Functor.Identity

Methods

quot :: Identity a -> Identity a -> Identity a Source #

rem :: Identity a -> Identity a -> Identity a Source #

div :: Identity a -> Identity a -> Identity a Source #

mod :: Identity a -> Identity a -> Identity a Source #

quotRem :: Identity a -> Identity a -> (Identity a, Identity a) Source #

divMod :: Identity a -> Identity a -> (Identity a, Identity a) Source #

toInteger :: Identity a -> Integer Source #

Data a => Data (Identity a) | Since: base-4.9.0.0

Instance details

Defined in Data.Data

Methods

gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> Identity a -> c (Identity a) Source #

gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c (Identity a) Source #

toConstr :: Identity a -> Constr Source #

dataTypeOf :: Identity a -> DataType Source #

dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c (Identity a)) Source #

dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c (Identity a)) Source #

gmapT :: (forall b. Data b => b -> b) -> Identity a -> Identity a Source #

gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> Identity a -> r Source #

gmapQr :: (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> Identity a -> r Source #

gmapQ :: (forall d. Data d => d -> u) -> Identity a -> [u] Source #

gmapQi :: Int -> (forall d. Data d => d -> u) -> Identity a -> u Source #

gmapM :: Monad m => (forall d. Data d => d -> m d) -> Identity a -> m (Identity a) Source #

gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> Identity a -> m (Identity a) Source #

gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> Identity a -> m (Identity a) Source #

Num a => Num (Identity a) | Since: base-4.9.0.0
Instance details Defined in Data.Functor.Identity Methods (+) :: Identity a -> Identity a -> Identity a Source # (-) :: Identity a -> Identity a -> Identity a Source # (*) :: Identity a -> Identity a -> Identity a Source # negate :: Identity a -> Identity a Source # abs :: Identity a -> Identity a Source # signum :: Identity a -> Identity a Source # fromInteger :: Integer -> Identity a Source #
Ord a => Ord (Identity a) | Since: base-4.8.0.0

Instance details

Defined in Data.Functor.Identity

Methods

compare :: Identity a -> Identity a -> Ordering Source #

(<) :: Identity a -> Identity a -> Bool Source #

(<=) :: Identity a -> Identity a -> Bool Source #

(>) :: Identity a -> Identity a -> Bool Source #

(>=) :: Identity a -> Identity a -> Bool Source #

max :: Identity a -> Identity a -> Identity a Source #

min :: Identity a -> Identity a -> Identity a Source #

Read a => Read (Identity a) | This instance would be equivalent to the derived instances of the `Identity` newtype if the `runIdentity` field were removed Since: base-4.8.0.0
Instance details Defined in Data.Functor.Identity Methods readsPrec :: Int -> ReadS (Identity a) Source # readList :: ReadS [Identity a] Source # readPrec :: ReadPrec (Identity a) Source # readListPrec :: ReadPrec [Identity a] Source #
Real a => Real (Identity a) | Since: base-4.9.0.0
Instance details Defined in Data.Functor.Identity Methods toRational :: Identity a -> Rational Source #
RealFloat a => RealFloat (Identity a) | Since: base-4.9.0.0

Instance details

Defined in Data.Functor.Identity

Methods

floatRadix :: Identity a -> Integer Source #

floatDigits :: Identity a -> Int Source #

floatRange :: Identity a -> (Int, Int) Source #

decodeFloat :: Identity a -> (Integer, Int) Source #

encodeFloat :: Integer -> Int -> Identity a Source #

exponent :: Identity a -> Int Source #

significand :: Identity a -> Identity a Source #

scaleFloat :: Int -> Identity a -> Identity a Source #

isNaN :: Identity a -> Bool Source #

isInfinite :: Identity a -> Bool Source #

isDenormalized :: Identity a -> Bool Source #

isNegativeZero :: Identity a -> Bool Source #

isIEEE :: Identity a -> Bool Source #

atan2 :: Identity a -> Identity a -> Identity a Source #

RealFrac a => RealFrac (Identity a) | Since: base-4.9.0.0
Instance details Defined in Data.Functor.Identity Methods properFraction :: Integral b => Identity a -> (b, Identity a) Source # truncate :: Integral b => Identity a -> b Source # round :: Integral b => Identity a -> b Source # ceiling :: Integral b => Identity a -> b Source # floor :: Integral b => Identity a -> b Source #
Show a => Show (Identity a) | This instance would be equivalent to the derived instances of the `Identity` newtype if the `runIdentity` field were removed Since: base-4.8.0.0
Instance details Defined in Data.Functor.Identity Methods showsPrec :: Int -> Identity a -> ShowS Source # show :: Identity a -> String Source # showList :: [Identity a] -> ShowS Source #
Ix a => Ix (Identity a) | Since: base-4.9.0.0

Instance details

Defined in Data.Functor.Identity

Methods

range :: (Identity a, Identity a) -> [Identity a] Source #

index :: (Identity a, Identity a) -> Identity a -> Int Source #

unsafeIndex :: (Identity a, Identity a) -> Identity a -> Int

inRange :: (Identity a, Identity a) -> Identity a -> Bool Source #

rangeSize :: (Identity a, Identity a) -> Int Source #

unsafeRangeSize :: (Identity a, Identity a) -> Int

IsString a => IsString (Identity a) | Since: base-4.9.0.0
Instance details Defined in Data.String Methods fromString :: String -> Identity a Source #
Generic (Identity a) |
Instance details Defined in Data.Functor.Identity Associated Types type Rep (Identity a) :: Type -> Type Source # Methods from :: Identity a -> Rep (Identity a) x Source # to :: Rep (Identity a) x -> Identity a Source #
Semigroup a => Semigroup (Identity a) | Since: base-4.9.0.0
Instance details Defined in Data.Functor.Identity Methods (<>) :: Identity a -> Identity a -> Identity a Source # sconcat :: NonEmpty (Identity a) -> Identity a Source # stimes :: Integral b => b -> Identity a -> Identity a Source #
Monoid a => Monoid (Identity a) | Since: base-4.9.0.0
Instance details Defined in Data.Functor.Identity Methods mempty :: Identity a Source # mappend :: Identity a -> Identity a -> Identity a Source # mconcat :: [Identity a] -> Identity a Source #
Storable a => Storable (Identity a) | Since: base-4.9.0.0

Instance details

Defined in Data.Functor.Identity

Methods

sizeOf :: Identity a -> Int Source #

alignment :: Identity a -> Int Source #

peekElemOff :: Ptr (Identity a) -> Int -> IO (Identity a) Source #

pokeElemOff :: Ptr (Identity a) -> Int -> Identity a -> IO () Source #

peekByteOff :: Ptr b -> Int -> IO (Identity a) Source #

pokeByteOff :: Ptr b -> Int -> Identity a -> IO () Source #

peek :: Ptr (Identity a) -> IO (Identity a) Source #

poke :: Ptr (Identity a) -> Identity a -> IO () Source #

Bits a => Bits (Identity a) | Since: base-4.9.0.0

Instance details

Defined in Data.Functor.Identity

Methods

(.&.) :: Identity a -> Identity a -> Identity a Source #

(.|.) :: Identity a -> Identity a -> Identity a Source #

xor :: Identity a -> Identity a -> Identity a Source #

complement :: Identity a -> Identity a Source #

shift :: Identity a -> Int -> Identity a Source #

rotate :: Identity a -> Int -> Identity a Source #

zeroBits :: Identity a Source #

bit :: Int -> Identity a Source #

setBit :: Identity a -> Int -> Identity a Source #

clearBit :: Identity a -> Int -> Identity a Source #

complementBit :: Identity a -> Int -> Identity a Source #

testBit :: Identity a -> Int -> Bool Source #

bitSizeMaybe :: Identity a -> Maybe Int Source #

bitSize :: Identity a -> Int Source #

isSigned :: Identity a -> Bool Source #

shiftL :: Identity a -> Int -> Identity a Source #

unsafeShiftL :: Identity a -> Int -> Identity a Source #

shiftR :: Identity a -> Int -> Identity a Source #

unsafeShiftR :: Identity a -> Int -> Identity a Source #

rotateL :: Identity a -> Int -> Identity a Source #

rotateR :: Identity a -> Int -> Identity a Source #

popCount :: Identity a -> Int Source #

FiniteBits a => FiniteBits (Identity a) | Since: base-4.9.0.0
Instance details Defined in Data.Functor.Identity Methods finiteBitSize :: Identity a -> Int Source # countLeadingZeros :: Identity a -> Int Source # countTrailingZeros :: Identity a -> Int Source #
Generic1 Identity |
Instance details Defined in Data.Functor.Identity Associated Types type Rep1 Identity :: k -> Type Source # Methods from1 :: Identity a -> Rep1 Identity a Source # to1 :: Rep1 Identity a -> Identity a Source #
type Rep (Identity a) | Since: base-4.8.0.0
Instance details Defined in Data.Functor.Identity type Rep (Identity a) = D1 (MetaData "Identity" "Data.Functor.Identity" "base" True) (C1 (MetaCons "Identity" PrefixI True) (S1 (MetaSel (Just "runIdentity") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 a)))
type Rep1 Identity | Since: base-4.8.0.0
Instance details Defined in Data.Functor.Identity type Rep1 Identity = D1 (MetaData "Identity" "Data.Functor.Identity" "base" True) (C1 (MetaCons "Identity" PrefixI True) (S1 (MetaSel (Just "runIdentity") NoSourceUnpackedness NoSourceStrictness DecidedLazy) Par1))

replicateM :: Applicative m => CountOf a -> m a -> m [a] Source #

``replicateM` n act` performs the action `n` times, gathering the results.