validate-input 0.4.0.0 → 0.5.0.0
raw patch · 4 files changed
+15/−16 lines, 4 filesdep +transformersdep −eitherPVP ok
version bump matches the API change (PVP)
Dependencies added: transformers
Dependencies removed: either
API changes (from Hackage documentation)
- Data.Validator: instance GHC.Base.Monad m => GHC.Base.Functor (Data.Validator.ValidationT e m)
+ Data.Validator: infixr 1 <=<
+ Data.Validator: instance GHC.Base.Functor m => GHC.Base.Functor (Data.Validator.ValidationT e m)
- Data.Validator: data Int64 :: *
+ Data.Validator: data Int64
- Data.Validator: data Regex :: *
+ Data.Validator: data Regex
Files
- LICENSE +1/−1
- README.md +2/−3
- src/Data/Validator.hs +6/−6
- validate-input.cabal +6/−6
LICENSE view
@@ -1,4 +1,4 @@-Copyright (c) 2015 Alexander Thiemann+Copyright (c) 2015-2021 Alexander Thiemann Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the
README.md view
@@ -78,10 +78,9 @@ ### Supported GHC Versions -* 7.8.4-* 7.10.2+* 8.8.4 ### License Released under the MIT license.-(c) 2015 Alexander Thiemann+(c) 2015-2021 Alexander Thiemann
src/Data/Validator.hs view
@@ -30,22 +30,22 @@ import Control.Monad import Control.Monad.Identity import Control.Monad.Trans-import Control.Monad.Trans.Either+import Control.Monad.Trans.Except import Data.Int import Data.String.Conversions import Text.Regex.PCRE.Heavy+import qualified Data.ByteString as BS+import qualified Data.ByteString.Lazy as BSL import qualified Data.List.NonEmpty as NEL import qualified Data.Text as T import qualified Data.Text.Lazy as TL-import qualified Data.ByteString as BS-import qualified Data.ByteString.Lazy as BSL -- | The validation monad type ValidationM e = ValidationT e Identity -- | The validation monad transformer newtype ValidationT e m a- = ValidationT { unValidationT :: EitherT e m a }+ = ValidationT { unValidationT :: ExceptT e m a } deriving (Monad, Functor, Applicative, Alternative, MonadPlus, MonadTrans) -- | Run a validation on a type 'a'@@ -56,7 +56,7 @@ -- | Run a validation on a type 'a' runValidatorT :: Monad m => TransValidationRuleT e m a b -> a -> m (Either e b) runValidatorT validationSteps input =- runEitherT $ unValidationT (validationSteps input)+ runExceptT $ unValidationT (validationSteps input) {-# INLINE runValidatorT #-} -- | A validation rule. Combine using @('>=>')@ or @('<=<')@@@ -97,7 +97,7 @@ -- | Mark a custom check as failed checkFailed :: Monad m => e -> ValidationT e m a-checkFailed = ValidationT . left+checkFailed = ValidationT . throwE {-# INLINE checkFailed #-} -- | Check that the value is at least N elements long
validate-input.cabal view
@@ -1,5 +1,5 @@ name: validate-input-version: 0.4.0.0+version: 0.5.0.0 synopsis: Input validation combinator library description: A small Haskell combinator library that provides a simple way of validating user provided data structures.@@ -9,12 +9,12 @@ license-file: LICENSE author: Alexander Thiemann <mail@athiemann.net> maintainer: Alexander Thiemann <mail@athiemann.net>-copyright: (c) 2015 Alexander Thiemann+copyright: (c) 2015-2021 Alexander Thiemann category: Web build-type: Simple cabal-version: >=1.10 tested-with:- GHC == 7.8.4, GHC == 7.10.2+ GHC == 8.8.4 extra-source-files: README.md@@ -28,7 +28,7 @@ build-depends: base >=4.6 && <5, bytestring >=0.10,- either >=4.3,+ transformers, mtl >=2.1, pcre-heavy >=1.0, string-conversions >=0.4,@@ -36,7 +36,7 @@ text >=1.2 hs-source-dirs: src default-language: Haskell2010- ghc-options: -auto-all -Wall -fno-warn-orphans+ ghc-options: -Wall -fno-warn-orphans test-suite validate-input-tests type: exitcode-stdio-1.0@@ -47,5 +47,5 @@ hspec >=2.1, QuickCheck >=2.7, validate-input- ghc-options: -auto-all -Wall -fno-warn-orphans+ ghc-options: -Wall -fno-warn-orphans default-language: Haskell2010