data-validation 0.1.0.0 → 0.1.0.1
raw patch · 3 files changed
+16/−9 lines, 3 filesPVP ok
version bump matches the API change (PVP)
API changes (from Hackage documentation)
Files
- CHANGELOG.md +5/−1
- data-validation.cabal +1/−1
- src/Data/Validation.hs +10/−7
CHANGELOG.md view
@@ -1,5 +1,9 @@ # Revision history for data-validation -## 0.1.0.0 -- YYYY-mm-dd +## 0.1.0.1 -- 2020-08-27 + +* Minor changes to haddocks. + +## 0.1.0.0 -- 2020-08-26 * First version. Released on an unsuspecting world.
data-validation.cabal view
@@ -1,6 +1,6 @@ cabal-version: 2.4 name: data-validation -version: 0.1.0.0 +version: 0.1.0.1 synopsis: A library for creating type safe validations. description: A library for creating type safe validations using typeclasses.
src/Data/Validation.hs view
@@ -86,7 +86,7 @@ ------------------------------------------------------------------------------------------------------------------------ {- $basics - Validation generally takes the form of `a -> Either f b` where: + Validation generally takes the form of @a -> Either f b@ where: [@a@]: Some unvalidated type. @@ -105,13 +105,13 @@ * @a@ ~ 'String' * @b@ ~ EmailAddress - * @c@ ~ MyFailures + * @f@ ~ MyFailures -} {- $proof - The transformation from `a` to `b` is important and provides a type safe way to prove that validation was successful. + The transformation from @a@ to @b@ is important and provides a type safe way to prove that validation was successful. However, rather than using the 'Either' type, this library uses the 'Proof' type. A 'Proof' represents either a validated type or a collection of failures. Notice, we use the term validation /failures/ instead of /errors/ @@ -160,7 +160,7 @@ In that case, the key would need to identify that the `phoneNumber` field is a subfield of `contact`. The key would look like this: - >> ['contact, 'phoneNumber] + > ['contact, 'phoneNumber] -} -- | A type that holds either validation failures or a validated value. @@ -374,9 +374,12 @@ -- | A type class that represents a value that can be validated. -- -- The parameters represent the following: --- * `f`: the type of validation failures. --- * `a`: the unvalidated type or view model. --- * `b`: the validated type. +-- +-- * @f@: the type of validation failures. +-- +-- * @a@: the unvalidated type or view model. +-- +-- * @b@: the validated type. class Validatable f a b | a -> f b where validation :: a -> VCtx f b