From c396dec4466e1176617e06468cb59de3a1f36287 Mon Sep 17 00:00:00 2001 From: Dominic Orchard Date: Thu, 26 Feb 2026 11:32:38 +0000 Subject: [PATCH 1/3] type application syntax instead --- README.md | 11 ++++++----- changelog.md | 5 +++++ examples/ExampleMap.hs | 11 ++++++----- type-level-sets.cabal | 2 +- 4 files changed, 18 insertions(+), 11 deletions(-) diff --git a/README.md b/README.md index 70934a1..e9a6229 100644 --- a/README.md +++ b/README.md @@ -8,6 +8,7 @@ Thanks to major contributions from @finnbar in 2025 to simplify the approach usi The following shows an example: {-# LANGUAGE DataKinds, TypeOperators, TypeFamilies, MultiParamTypeClasses #-} + {-# LANGUAGE TypeApplications #-} import Data.Type.Map -- Specifies how to combine duplicate key-value pairs for Int values @@ -16,14 +17,14 @@ The following shows an example: combine x y = x + y foo :: Map '["x" :-> Int, "z" :-> Bool, "w" :-> Int] - foo = Ext (Var :: (Var "x")) 2 - $ Ext (Var :: (Var "z")) True - $ Ext (Var :: (Var "w")) 5 + foo = Ext (Var @"x") 2 + $ Ext (Var @"z") True + $ Ext (Var @"w") 5 Empty bar :: Map '["y" :-> Int, "w" :-> Int] - bar = Ext (Var :: (Var "y")) 3 - $ Ext (Var :: (Var "w")) 1 + bar = Ext (Var @"y") 3 + $ Ext (Var @"w") 1 $ Empty -- foobar :: Map '["w" :-> Int, "x" :-> Int, "y" :-> Int, "z" :-> Bool] diff --git a/changelog.md b/changelog.md index 898a765..a641799 100644 --- a/changelog.md +++ b/changelog.md @@ -1,3 +1,8 @@ +# v0.9.1.0 +- Expanded test suite to cover README examples +- Added tests for Map union with Combine behavior +- Added tests for Set examples with Natural numbers + # v0.9.0.0 - GHC 9.2 support - Add Elem typeclass to retrieve the value at a type in a set diff --git a/examples/ExampleMap.hs b/examples/ExampleMap.hs index 3bf9209..f46801b 100644 --- a/examples/ExampleMap.hs +++ b/examples/ExampleMap.hs @@ -1,4 +1,5 @@ {-# LANGUAGE DataKinds, TypeOperators, TypeFamilies, MultiParamTypeClasses #-} +{-# LANGUAGE TypeApplications #-} module ExampleMap where @@ -12,17 +13,17 @@ instance Combinable Int Int where combine x y = x + y foo :: Map '["x" :-> Int, "z" :-> Bool, "w" :-> Int] -foo = Ext (Var :: (Var "x")) 2 - $ Ext (Var :: (Var "z")) True - $ Ext (Var :: (Var "w")) 5 +foo = Ext (Var @"x") 2 + $ Ext (Var @"z") True + $ Ext (Var @"w") 5 $ Empty foo' :: Map (AsMap '["z" :-> Bool, "x" :-> Int, "w" :-> Int]) foo' = asMap foo bar :: Map '["y" :-> Int, "w" :-> Int] -bar = Ext (Var :: (Var "y")) 3 $ - Ext (Var :: (Var "w")) 1 $ +bar = Ext (Var @"y") 3 $ + Ext (Var @"w") 1 $ Empty -- GHC can easily infer this type, so an explicit signature not necessary diff --git a/type-level-sets.cabal b/type-level-sets.cabal index a009b41..4d4f867 100644 --- a/type-level-sets.cabal +++ b/type-level-sets.cabal @@ -1,5 +1,5 @@ name: type-level-sets -version: 0.9.0.0 +version: 0.9.1.0 synopsis: Type-level sets and finite maps (with value-level counterparts) description: This package provides type-level sets (no duplicates, sorted to provide a normal form) via 'Set' and type-level From f8d7cb6d521f0cdc993bc0d0d4cb69b2c2c97b51 Mon Sep 17 00:00:00 2001 From: Dominic Orchard Date: Thu, 26 Feb 2026 11:33:18 +0000 Subject: [PATCH 2/3] update changelog --- changelog.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/changelog.md b/changelog.md index a641799..0390cc3 100644 --- a/changelog.md +++ b/changelog.md @@ -2,6 +2,8 @@ - Expanded test suite to cover README examples - Added tests for Map union with Combine behavior - Added tests for Set examples with Natural numbers +- Uses [rearrangements](https://github.com/finnbar/rearrangements) library to simplify the implementation. +- Updated to GHC 9.8 # v0.9.0.0 - GHC 9.2 support From d2f7b664453c8474da6a32f1451119d5d77ba0ad Mon Sep 17 00:00:00 2001 From: Dominic Orchard Date: Thu, 26 Feb 2026 11:38:01 +0000 Subject: [PATCH 3/3] Update changelog.md Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> --- changelog.md | 1 + 1 file changed, 1 insertion(+) diff --git a/changelog.md b/changelog.md index 0390cc3..340825c 100644 --- a/changelog.md +++ b/changelog.md @@ -3,6 +3,7 @@ - Added tests for Map union with Combine behavior - Added tests for Set examples with Natural numbers - Uses [rearrangements](https://github.com/finnbar/rearrangements) library to simplify the implementation. +- Migrated examples from explicit type annotations to `TypeApplications` syntax (e.g. `Var @"x"`). - Updated to GHC 9.8 # v0.9.0.0