contstuff 0.5.0 → 0.5.1
raw patch · 2 files changed
+15/−3 lines, 2 filesPVP ok
version bump matches the API change (PVP)
API changes (from Hackage documentation)
+ Control.ContStuff: findAll_ :: (Applicative m) => ChoiceT () i m a -> m ()
+ Control.ContStuff: findFirst_ :: (Applicative m) => ChoiceT () i m a -> m ()
Files
- Control/ContStuff.hs +14/−2
- contstuff.cabal +1/−1
Control/ContStuff.hs view
@@ -20,8 +20,8 @@ -- ** ContT ContT(..), runContT, evalContT, modifyContT, -- ** Choice/nondeterminism- ChoiceT(..), runChoiceT, choice, findFirst, findAll,- listChoiceT, listA, maybeChoiceT,+ ChoiceT(..), runChoiceT, choice, findFirst, findFirst_, findAll,+ findAll_, listChoiceT, listA, maybeChoiceT, -- ** Exceptions EitherT(..), runEitherT, evalEitherT, modifyEitherT, MaybeT(..), runMaybeT, evalMaybeT, modifyMaybeT,@@ -185,10 +185,22 @@ findFirst = runChoiceT (\_ y _ -> pure (pure y)) empty pure +-- | Find the first solution and ignore it.++findFirst_ :: Applicative m => ChoiceT () i m a -> m ()+findFirst_ = runChoiceT (\_ _ _ -> pure ()) undefined (const $ pure ())++ -- | Find all solutions. findAll :: (Alternative f, Applicative m) => ChoiceT (f a) (f a) m a -> m (f a) findAll = runChoiceT (\x y k -> k (x <|> pure y)) empty pure+++-- | Find all solutions and ignore them.++findAll_ :: Applicative m => ChoiceT () i m a -> m ()+findAll_ = runChoiceT (\_ _ k -> k undefined) undefined (const $ pure ()) -- | Get list of solutions (faster than 'findAll', but returns solutions
contstuff.cabal view
@@ -1,5 +1,5 @@ Name: contstuff-Version: 0.5.0+Version: 0.5.1 Category: Control, Monads Synopsis: Easy to use CPS-based monads Maintainer: Ertugrul Söylemez <es@ertes.de>