packages feed

UtilityTM 0.0.3 → 0.0.4

raw patch · 2 files changed

+28/−6 lines, 2 filesPVP ok

version bump matches the API change (PVP)

API changes (from Hackage documentation)

+ Control.Monad.TM: findM :: Monad m => (a -> m Bool) -> [a] -> m (Maybe a)

Files

UtilityTM.cabal view
@@ -1,17 +1,22 @@ Name:               UtilityTM-Version:            0.0.3+Version:            0.0.4 License:            BSD3 License-File:       LICENSE Author:             Tony Morris <ʇǝu˙sıɹɹoɯʇ@ןןǝʞsɐɥ> Maintainer:         Tony Morris+Copyright:          Tony Morris Synopsis:           Utility functions that are missing from the standard library Category:           Development Description:        Utility functions that are missing from the standard library-Homepage:           https://bitbucket.org/dibblego/utility-tm/-Cabal-version:      >= 1.2+Homepage:           https://github.com/tonymorris/utility-tm+Cabal-version:      >= 1.6 Build-Type:         Simple -Flag small_base+Source-Repository   head+  Type:             git+  Location:         git@github.com:tonymorris/utility-tm.git++Flag                small_base   Description:      Choose the new, split-up base package.  Library@@ -25,5 +30,5 @@                     src    Exposed-Modules:-                      Control.Monad.TM-+                    Control.Monad.TM+  
src/Control/Monad/TM.hs view
@@ -5,6 +5,7 @@ ,  (.>>=.) , anyM , allM+, findM ) where  import Control.Applicative@@ -56,3 +57,19 @@      if z        then allM f as        else return False++-- | Find an element satisfying a predicate+findM ::+  Monad m =>+  (a -> m Bool)+  -> [a]+  -> m (Maybe a)+findM _ [] =+  return Nothing+findM f (x:xs) =+  do b <- f x+     if b+       then+         return (Just x)+       else+         findM f xs