packages feed

data-extra 2.0.0 → 2.1.0

raw patch · 4 files changed

+8/−1 lines, 4 filesPVP ok

version bump matches the API change (PVP)

API changes (from Hackage documentation)

+ Data.Maybe.Extra: sole :: [a] -> Maybe a

Files

data-extra.cabal view
@@ -1,5 +1,5 @@ name:                data-extra-version:             2.0.0+version:             2.1.0 synopsis:            Extra utilities for working on Data.* types. description:         Extra utilities for working on Data.* types. license:             BSD3
src/Data/Maybe/Extra.hs view
@@ -13,3 +13,8 @@ whenJust :: Monad m => Maybe a -> (a -> m c) -> m () whenJust (Just a) m = m a >> return () whenJust _         _ = return ()++-- | Return the sole element of the list or nothing.+sole :: [a] -> Maybe a+sole [x] = Just x+sole _   = Nothing
src/Data/Text/Extra.hs view
@@ -23,6 +23,7 @@   toText = pack   toLazyText = L.pack +-- | A class for converting from Text. class FromText a where   fromText :: Text -> Maybe a   fromLazyText :: L.Text -> Maybe a
src/Data/Time/Extra.hs view
@@ -65,6 +65,7 @@   end <- liftIO $ getCurrentTime   return (a,end `diffUTCTime` start) +-- | Trivial benchmark for some monadic action. bench :: MonadIO m => Integer -> m a -> m (a,NominalDiffTime) bench i computation = go i Nothing where   go n Nothing = do