Skip to content

Commit

Permalink
release 0.1.0
Browse files Browse the repository at this point in the history
  • Loading branch information
raehik committed May 16, 2022
1 parent 0386d43 commit d253d20
Show file tree
Hide file tree
Showing 4 changed files with 28 additions and 6 deletions.
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
## 0.1.0 (Unreleased)
## 0.1.0 (2022-05-16)
Initial release.

* basic instances (lists, numerics)
Expand Down
24 changes: 23 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -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.
4 changes: 2 additions & 2 deletions package.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions strongweak.cabal
Original file line number Diff line number Diff line change
Expand Up @@ -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

0 comments on commit d253d20

Please sign in to comment.