Skip to content

Commit 35831d7

Browse files
committed
release 0.11.0
1 parent fd746ff commit 35831d7

File tree

4 files changed

+8
-17
lines changed

4 files changed

+8
-17
lines changed

CHANGELOG.md

+5
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
## 0.11.0 (2024-10-17)
2+
* add `WeakenN` and `SWN` for chaining weakenings
3+
* clarify instance design: even zero-invariant coercible newtypes aren't allowed
4+
to recursively weaken their inner type!
5+
16
## 0.10.0 (2024-10-13)
27
* rename `Weak` to `Weakened`, to separate from `Weak :: Strength`
38
* update rerefined dependency

package.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
name: strongweak
2-
version: 0.10.0
2+
version: 0.11.0
33
synopsis: Convert between strong and weak representations of types
44
description: Please see README.md.
55
extra-source-files:

src/Strongweak.hs

+1-15
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ with the overall design. Here is some relevant guidance.
5151
If you want to handle multiple invariants, chain the weakens/strengthens.
5252
You may do this by nesting 'SW' uses, but you will then have to write your own
5353
instances, as the generics cannot handle such chaining. Alternatively, you may
54-
use 'SWChain'. This will add another newtype layer to the strong representation,
54+
use 'WeakenN'. This will add another newtype layer to the strong representation,
5555
but the generics are happy with it.
5656
5757
Some types may not have any invariants which may be usefully relaxed e.g.
@@ -67,18 +67,4 @@ necessarily what you want - indeed, it appears this sort of design would require
6767
a @'Weak' a = a, weaken = id@ overlapping instance, which I do not want. On the
6868
other hand, @[a]@ /does/ weaken to @['Weak' a]@, because there are no invariants
6969
present to remove, so decomposing is all the user could hope to do.
70-
71-
Another problem is coercible newtypes such as @Tagged@ from the @tagged@
72-
package. These have no invariants for us to weaken, so one's knee-jerk reaction
73-
might be to weaken the inner type. But what if the user doesn't want to weaken
74-
that inner type? They might be happy with using 'Data.Word.Word' instead of
75-
'Numeric.Natural.Natural', for example.
76-
77-
strongweak provides a special type 'Coercibly' which permits precisely defining
78-
how to weaken a newtype/pair of coercible types. For this reason, zero-invariant
79-
coercible newtypes are excluded from the strongweak ecosystem (e.g.
80-
'Data.Functor.Identity.Identity', 'Data.Functor.Const.Const', @Tagged@).
81-
82-
If your newtype puts the wrapped type as the final type variable, use
83-
'Coercibly1' for a considerably simpler invocation.
8470
-}

strongweak.cabal

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ cabal-version: 1.12
55
-- see: https://github.com/sol/hpack
66

77
name: strongweak
8-
version: 0.10.0
8+
version: 0.11.0
99
synopsis: Convert between strong and weak representations of types
1010
description: Please see README.md.
1111
category: Data

0 commit comments

Comments
 (0)