pa-label 0.1.1.0 → 0.1.2.0
raw patch · 3 files changed
+16/−3 lines, 3 filesPVP ok
version bump matches the API change (PVP)
API changes (from Hackage documentation)
+ Label: addToT2 :: forall l1 l2 l3 t1 t2 t3. Label l3 t3 -> T2 l1 t1 l2 t2 -> T3 l1 t1 l2 t2 l3 t3
Files
- CHANGELOG.md +6/−2
- pa-label.cabal +5/−1
- src/Label.hs +5/−0
CHANGELOG.md view
@@ -1,9 +1,13 @@ # Revision history for pa-label +## 0.1.2.0 -- 2024-09-04++- Add `addToT2`+ ## 0.1.1.0 -- 2024-03-18 -* Add `zipT2/zipT3`, `unzipT2/unzipT3`+- Add `zipT2/zipT3`, `unzipT2/unzipT3` ## 0.1.0.0 -- 2023-05-19 -* First version; contains the `Label` type, `T2`/`T3`, `E2`/`E3`, and some helpers.+- First version; contains the `Label` type, `T2`/`T3`, `E2`/`E3`, and some helpers.
pa-label.cabal view
@@ -1,7 +1,7 @@ cabal-version: 3.0 -- !!! ATTN: file autogenerated from pa-template.cabal.mustache on toplevel !!! name: pa-label-version: 0.1.1.0+version: 0.1.2.0 synopsis: Labels, and labelled tuples and enums (GHC >9.2) description: license: BSD-3-Clause@@ -60,6 +60,10 @@ -- to enable the `type` keyword in import lists (ormolu uses this automatically) ExplicitNamespaces++ -- allows defining pattern synonyms, but also the `import Foo (pattern FooPattern)` import syntax+ PatternSynonyms+ default-language: GHC2021
src/Label.hs view
@@ -15,6 +15,7 @@ focusOnField, monoMapT2, tupleToT2,+ addToT2, zipT2, unzipT2, T3 (..),@@ -171,6 +172,10 @@ -- @tupleToT2 @"left" @"right" ('c', True) :: T2 "left" Char "right" Bool@ tupleToT2 :: forall l1 l2 t1 t2. (t1, t2) -> T2 l1 t1 l2 t2 tupleToT2 (t1, t2) = T2 (label @l1 t1) (label @l2 t2)++-- | Add a field to the end of a T2, turning it into a T3.+addToT2 :: forall l1 l2 l3 t1 t2 t3. Label l3 t3 -> T2 l1 t1 l2 t2 -> T3 l1 t1 l2 t2 l3 t3+addToT2 new (T2 a b) = T3 a b new -- | If you have a tuple of lists, make it into a list of tuples. The names are attached to each value. zipT2 ::