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..340825c 100644 --- a/changelog.md +++ b/changelog.md @@ -1,3 +1,11 @@ +# 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 +- 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 - 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