railroad 0.1.1.2 → 0.1.1.3
raw patch · 4 files changed
+10/−10 lines, 4 filesPVP ok
version bump matches the API change (PVP)
API changes (from Hackage documentation)
Files
- CHANGELOG.md +3/−0
- railroad.cabal +1/−1
- src/Railroad.hs +3/−3
- src/Railroad/MonadError.hs +3/−6
CHANGELOG.md view
@@ -1,5 +1,8 @@ # Revision history for railroad +## 0.1.1.3 -- 2026-10-10+* Documentation fixes: correct "success" typo and the doc comment of `(?)` in `Railroad.MonadError`.+ ## 0.1.1.2 -- 2026-04-17 * Remove strictness annotation from `TooMany` constructor in `CardinalityError`.
railroad.cabal view
@@ -1,6 +1,6 @@ cabal-version: 3.0 name: railroad-version: 0.1.1.2+version: 0.1.1.3 license: BSD-3-Clause license-file: LICENSE author: Frederik Kallstrup Mastratisi
src/Railroad.hs view
@@ -97,7 +97,7 @@ TooMany xs -> onTooMany xs --- | Non-empty is sucess state. Returns the collection as-is.+-- | Non-empty is success state. Returns the collection as-is. (?+) :: forall es e t a. (Error e :> es, Foldable t) => Eff es (t a) -> e -> Eff es (t a) (?+) action err = do@@ -105,7 +105,7 @@ if null xs then throwError_ err else pure xs --- | Single element is sucess state. Returns the single element+-- | Single element is success state. Returns the single element (?!) :: forall es e t a. (Error e :> es, Foldable t) => Eff es (t a) -> (CardinalityError (t a) -> e) -> Eff es a (?!) action toErr = do@@ -128,5 +128,5 @@ => Eff es (t a) -> ((t a) -> e) -> Eff es () (?@) = (?∅) -infixl 0 ??, ?, ??~, ?~, ?!, ?+, ?∅, ?@+infixl 0 ??, ?, ??~, ?~, ?!, ?+, ?∅, ?@ infixl 1 ?>
src/Railroad/MonadError.hs view
@@ -29,7 +29,7 @@ => m a -> (CErr a -> e) -> m (CRes a) action ?? toErr = action >>= collapse toErr --- | Collapses a structure using an error mapper.+-- | Collapses a structure using a constant error. (?) :: forall m e a. (MonadError e m, Bifurcate a) => m a -> e -> m (CRes a) action ? err = action ?? const err@@ -49,14 +49,14 @@ (?~) :: forall m a. (Bifurcate a, Monad m) => m a -> CRes a -> m (CRes a) action ?~ defaultVal = action ??~ (const defaultVal) --- | Non-empty is sucess state. Returns the collection as-is.+-- | Non-empty is success state. Returns the collection as-is. (?+) :: forall m e t a. (MonadError e m, Foldable t) => m (t a) -> e -> m (t a) (?+) action err = do xs <- action if null xs then throwError err else pure xs --- | Single element is sucess state. Returns the single element+-- | Single element is success state. Returns the single element (?!) :: forall m e t a. (MonadError e m, Foldable t) => m (t a) -> (CardinalityError (t a) -> e) -> m a (?!) action toErr = do@@ -72,9 +72,6 @@ (?∅) action toErr = do xs <- action if null xs then pure () else throwError (toErr xs)--- -- | Non-unicode alias for `(?∅)` (?@) :: forall m e t a. (MonadError e m, Foldable t)