diff --git a/CHANGELOG.md b/CHANGELOG.md index 5aa26d2..c3e3d3b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,4 +1,4 @@ -## 0.1.0 (Unreleased) +## 0.1.0 (2022-05-16) Initial release. * basic instances (lists, numerics) diff --git a/README.md b/README.md index 37249ac..1a848aa 100644 --- a/README.md +++ b/README.md @@ -1,2 +1,24 @@ # strongweak -TODO +Definitions for transforming between types. + + * `strong -> weak` drops invariants (e.g. going from a bounded to an unbounded + numeric type) + * `weak -> Maybe strong` introduces invariants + +This is not a `Convertible` library that enumerates transformations between +types into a dictionary. + + * A "strong" type has exactly one "weak" representation. + * Weakening a type is safe. + * Strengthening a type may fail. + +There are generic derivers for generating `Strengthen` and `Weaken` instances +for arbitrary data types. The `Strengthen` instances annotate errors +extensively, telling you the datatype & record for which strengthening failed - +recursively, for nested types. + +This is a validation library. We don't fail on the first error -- we attempt to +validate every part of a data type, and collate the errors into a list. This +happens magically in the generic deriver, but if you're writing your own +instances, you may want `ApplicativeDo` so you can use do notation. So it'll +monadic, but actually everything will get checked. diff --git a/package.yaml b/package.yaml index 64edfc7..43b6157 100644 --- a/package.yaml +++ b/package.yaml @@ -67,8 +67,8 @@ dependencies: - base >= 4.14 && < 5 - vector-sized ^>= 1.5.0 - refined ^>= 0.6.3 -- prettyprinter # TODO -- validation +- prettyprinter ^>= 1.7.1 +- validation ^>= 1.1.2 library: source-dirs: src diff --git a/strongweak.cabal b/strongweak.cabal index 1904c9c..1ff7d88 100644 --- a/strongweak.cabal +++ b/strongweak.cabal @@ -75,8 +75,8 @@ library ghc-options: -Wall build-depends: base >=4.14 && <5 - , prettyprinter + , prettyprinter >=1.7.1 && <1.8 , refined >=0.6.3 && <0.7 - , validation + , validation >=1.1.2 && <1.2 , vector-sized >=1.5.0 && <1.6 default-language: Haskell2010