packages feed

bizzlelude 1.4.0 → 1.5.0

raw patch · 2 files changed

+17/−12 lines, 2 filesPVP ok

version bump matches the API change (PVP)

API changes (from Hackage documentation)

+ Prelude: (&>) :: (a -> b) -> (b -> c) -> (a -> c)
+ Prelude: (&>=) :: Monad m => (a -> m b) -> (b -> m c) -> (a -> m c)
+ Prelude: fromEither :: Either a a -> a

Files

bizzlelude.cabal view
@@ -1,5 +1,5 @@ Name:                bizzlelude-Version:             1.4.0+Version:             1.5.0 Cabal-version:       1.22.0 License:             BSD3 License-File:        LICENSE.txt
src/main/Misc.hs view
@@ -1,6 +1,6 @@ {-# LANGUAGE NoImplicitPrelude #-} {-# OPTIONS_GHC -fno-warn-missing-import-lists #-}-module Misc((|>), (>>>), (>=>), asString, asPath, asText, showText, concat, error, map, pam, (<&>), cartProduct, regexMatch, groupOn, return', scalaGroupBy, putStrFlush, unsafeRead, listDirsRecursively, uncurry5) where+module Misc((|>), (&>), (&>=), (>>>), (>=>), asString, asPath, asText, showText, concat, error, fromEither, map, pam, (<&>), cartProduct, regexMatch, groupOn, return', scalaGroupBy, putStrFlush, unsafeRead, listDirsRecursively, uncurry5) where  import External @@ -21,11 +21,13 @@ (|>) :: a -> (a -> b) -> b a |> f = f a -(>>>) :: (a -> b) -> (b -> c) -> (a -> c)+(&>), (>>>) :: (a -> b) -> (b -> c) -> (a -> c) (>>>) = (CArrow.>>>)+(&>)  = (>>>) -(>=>) :: Monad m => (a -> m b) -> (b -> m c) -> (a -> m c)+(&>=), (>=>) :: Monad m => (a -> m b) -> (b -> m c) -> (a -> m c) (>=>) = (CMonad.>=>)+(&>=) = (>=>)  infixl 2 >>>, >=> infixl 1 |>@@ -40,13 +42,13 @@ asText = Text.pack  showText :: Show a => a -> Text-showText = show >>> asText+showText = show &> asText  concat :: (Foldable t, MonadPlus m) => t (m a) -> m a concat = Foldable.msum  error :: Text -> a-error = asString >>> Err.error+error = asString &> Err.error  map :: (Functor f) => (a -> b) -> f a -> f b map = fmap@@ -59,10 +61,13 @@ cartProduct xs ys = [(x, y) | x <- xs, y <- ys]  regexMatch :: Text -> Text -> Maybe [Text]-regexMatch regex = asString >>> (matchRegexPR $ asString regex) >>> (map $ snd >>> (map $ snd >>> asText))+regexMatch regex = asString &> (matchRegexPR $ asString regex) &> (map $ snd &> (map $ snd &> asText)) +fromEither :: Either a a -> a+fromEither = either id id+ groupOn :: Ord criterion => (item -> criterion) -> [item] -> [[item]]-groupOn f = sort >>> group+groupOn f = sort &> group   where     sort  = List.sortBy (compare `on` f)     group = List.groupBy ((==) `on` f)@@ -71,9 +76,9 @@ return' = (return $!)  scalaGroupBy :: Ord criterion => (item -> criterion) -> [item] -> [(criterion, [item])]-scalaGroupBy f = (groupOn f) >>> pair+scalaGroupBy f = (groupOn f) &> pair   where-    pair  = tee $ List.head >>> f+    pair  = tee $ List.head &> f     tee f = map $ f &&& id  -- Hack to make GHCI print this before the prompt (JAB, 2/20/17)@@ -81,13 +86,13 @@ putStrFlush x = (TIO.putStr x) >>= (const $ SIO.hFlush SIO.stdout)  unsafeRead :: Integral a => Text -> a-unsafeRead = DTR.decimal >>> (Either.either (error "Well, that read *was* unsafe...") id) >>> fst+unsafeRead = DTR.decimal &> (Either.either (error "Well, that read *was* unsafe...") id) &> fst  listDirsRecursively :: FilePath -> IO [FilePath] listDirsRecursively filepath =   do     paths    <- SD.listDirectory filepath-    dirs     <- paths |> ((map $ \x -> filepath <> "/" <> x) >>> (filterM SD.doesDirectoryExist))+    dirs     <- paths |> ((map $ \x -> filepath <> "/" <> x) &> (filterM SD.doesDirectoryExist))     children <- mapM listDirsRecursively dirs     return $ dirs <> (concat children)