From 63a772c053abd297b5e565dc81400c3e7931755d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mois=C3=A9s=20Ackerman?= Date: Fri, 15 Mar 2024 16:22:13 +0100 Subject: [PATCH 1/2] Deprecate `DA.{Map,TextMap}.fromListWith`, add `DA.{Map,TextMap}.fromListWith{L,R}` (#18753) * Fix doctest for TextMap. * Optimise fromListWith for list-like structures and fix tests. * Implement fromListWithL and fromListWithR, restore behaviour fromListWith with fromListWithR, deprecate fromListWith. * Explain combining function in fromListWithL docs * Regenerate compiler/damlc/tests/platform-independence.dar-hash --------- Co-authored-by: Ang Hao Yang --- .../damlc/daml-stdlib-src/DA/Map.daml | 36 ++++++++-- .../damlc/daml-stdlib-src/DA/TextMap.daml | 37 ++++++++-- .../damlc/tests/daml-test-files/Map.daml | 12 ++-- .../damlc/tests/daml-test-files/TextMap.daml | 10 ++- .../tests/platform-independence.dar-hash | 68 +++++++++---------- 5 files changed, 109 insertions(+), 54 deletions(-) diff --git a/sdk/compiler/damlc/daml-stdlib-src/DA/Map.daml b/sdk/compiler/damlc/daml-stdlib-src/DA/Map.daml index d0d5f02f37ee..722fcdffea05 100644 --- a/sdk/compiler/damlc/daml-stdlib-src/DA/Map.daml +++ b/sdk/compiler/damlc/daml-stdlib-src/DA/Map.daml @@ -39,6 +39,8 @@ module DA.Map , toList , fromList , fromListWith + , fromListWithL + , fromListWithR , null , lookup , member @@ -70,23 +72,43 @@ fromList : Ord k => [(k, v)] -> Map k v fromList list = foldl (\acc (key, value) -> insert key value acc) empty list -- | Create a map from a list of key/value pairs with a combining --- function. Examples: +-- function. The combining function is only used when a key appears multiple +-- times in the list and it takes two arguments: the first one is the new value +-- being inserted at that key and the second one is the value accumulated so +-- far at that key. +-- Examples: -- -- ``` --- >>> fromListWith (++) [("A", [1]), ("A", [2]), ("B", [2]), ("B", [1]), ("A", [3])] --- fromList [("A", [1, 2, 3]), ("B", [2, 1])] --- >>> fromListWith (++) [] == (empty : Map Text [Int]) +-- >>> fromListWithL (++) [("A", [1]), ("A", [2]), ("B", [2]), ("B", [1]), ("A", [3])] +-- fromList [("A", [3, 2, 1]), ("B", [1, 2])] +-- >>> fromListWithL (++) [] == (empty : Map Text [Int]) -- True -- ``` -fromListWith : Ord k => (v -> v -> v) -> [(k, v)] -> Map k v -fromListWith f = foldl g empty +fromListWithL : Ord k => (v -> v -> v) -> [(k, v)] -> Map k v +fromListWithL f = foldl g empty where g acc (k, x) = let z = case lookup k acc of None -> x - Some y -> f y x + Some y -> f x y in insert k z acc +-- | Create a map from a list of key/value pairs like `fromListWithL` +-- with the combining function flipped. Examples: +-- +-- ``` +-- >>> fromListWithR (++) [("A", [1]), ("A", [2]), ("B", [2]), ("B", [1]), ("A", [3])] +-- fromList [("A", [1, 2, 3]), ("B", [2, 1])] +-- >>> fromListWithR (++) [] == (empty : Map Text [Int]) +-- True +-- ``` +fromListWithR : Ord k => (v -> v -> v) -> [(k, v)] -> Map k v +fromListWithR = fromListWithL . flip + +{-# DEPRECATED fromListWith "Daml compatibility helper, use 'fromListWithR' instead of 'fromListWith'" #-} +fromListWith : Ord k => (v -> v -> v) -> [(k, v)] -> Map k v +fromListWith = fromListWithR + -- | Get the list of keys in the map. Keys are sorted according to the -- built-in order for the type `k`, which matches the `Ord k` instance -- when using `deriving Ord`. diff --git a/sdk/compiler/damlc/daml-stdlib-src/DA/TextMap.daml b/sdk/compiler/damlc/daml-stdlib-src/DA/TextMap.daml index dbb462c5e343..71f5d950be13 100644 --- a/sdk/compiler/damlc/daml-stdlib-src/DA/TextMap.daml +++ b/sdk/compiler/damlc/daml-stdlib-src/DA/TextMap.daml @@ -11,6 +11,8 @@ module DA.TextMap , toList , fromList , fromListWith + , fromListWithL + , fromListWithR , null , lookup , member @@ -36,20 +38,43 @@ fromList : [(Text, a)] -> TextMap a fromList list = foldl (\acc (key, value) -> insert key value acc) empty list -- | Create a map from a list of key/value pairs with a combining --- function. Examples: +-- function. The combining function is only used when a key appears multiple +-- times in the list and it takes two arguments: the first one is the new value +-- being inserted at that key and the second one is the value accumulated so +-- far at that key. +-- Examples: +-- -- ``` --- fromListWith (++) [("A", [1]), ("A", [2]), ("B", [2]), ("B", [1]), ("A", [3])] == fromList [("A", [1, 2, 3]), ("B", [2, 1])] --- fromListWith (++) [] == (empty : TextMap [Int]) +-- >>> fromListWithL (++) [("A", [1]), ("A", [2]), ("B", [2]), ("B", [1]), ("A", [3])] +-- fromList [("A", [3, 2, 1]), ("B", [1, 2])] +-- >>> fromListWithL (++) [] == (empty : TextMap [Int]) +-- True -- ``` -fromListWith : (a -> a -> a) -> [(Text, a)] -> TextMap a -fromListWith f = foldl g empty +fromListWithL : (a -> a -> a) -> [(Text, a)] -> TextMap a +fromListWithL f = foldl g empty where g acc (k, x) = let z = case lookup k acc of None -> x - Some y -> f y x + Some y -> f x y in insert k z acc +-- | Create a map from a list of key/value pairs like `fromListWithL` +-- with the combining function flipped. Examples: +-- +-- ``` +-- >>> fromListWithR (++) [("A", [1]), ("A", [2]), ("B", [2]), ("B", [1]), ("A", [3])] +-- fromList [("A", [1, 2, 3]), ("B", [2, 1])] +-- >>> fromListWithR (++) [] == (empty : TextMap [Int]) +-- True +-- ``` +fromListWithR : (a -> a -> a) -> [(Text, a)] -> TextMap a +fromListWithR = fromListWithL . flip + +{-# DEPRECATED fromListWith "Daml compatibility helper, use 'fromListWithR' instead of 'fromListWith'" #-} +fromListWith : (a -> a -> a) -> [(Text, a)] -> TextMap a +fromListWith = fromListWithR + -- | Convert the map to a list of key/value pairs where the keys are -- in ascending order. toList : TextMap a -> [(Text, a)] diff --git a/sdk/compiler/damlc/tests/daml-test-files/Map.daml b/sdk/compiler/damlc/tests/daml-test-files/Map.daml index 1716efb8428d..c346d3e9d748 100644 --- a/sdk/compiler/damlc/tests/daml-test-files/Map.daml +++ b/sdk/compiler/damlc/tests/daml-test-files/Map.daml @@ -26,9 +26,13 @@ testFromList = script do True === member 3 (fromList [(1, "a"), (3, "b"), (4, "c")]) [(1, "b")] === toList (fromList [(1, "a"), (1, "c"), (1, "b")]) -testFromListWith = script do - fromListWith (<>) [(5,"a"), (5,"b"), (3,"b"), (3,"a"), (5,"c")] === fromList [(5, "abc"), (3, "ba")] - fromListWith (<>) [] === (M.empty : Map Int Text) +testFromListWithL = script do + fromListWithL (<>) [(5,"a"), (5,"b"), (3,"b"), (3,"a"), (5,"c")] === fromList [(5, "cba"), (3, "ab")] + fromListWithL (<>) [] === (M.empty : Map Int Text) + +testFromListWithR = script do + fromListWithR (<>) [(5,"a"), (5,"b"), (3,"b"), (3,"a"), (5,"c")] === fromList [(5, "abc"), (3, "ba")] + fromListWithR (<>) [] === (M.empty : Map Int Text) testMember = script do False === member "a" (fromList ([("", 1.0), ("b", 2.0), ("c", 3.0)] : [(Text, Decimal)])) @@ -87,4 +91,4 @@ testUnionWith = script do testInsertWith = script do insertWith (-) 1 2 (fromList []) === fromList [(1, 2)] - insertWith (-) 1 2 (fromList [(1,1)]) === fromList [(1, 2-1)] \ No newline at end of file + insertWith (-) 1 2 (fromList [(1,1)]) === fromList [(1, 2-1)] diff --git a/sdk/compiler/damlc/tests/daml-test-files/TextMap.daml b/sdk/compiler/damlc/tests/daml-test-files/TextMap.daml index 355e734605f1..2540dc66680e 100644 --- a/sdk/compiler/damlc/tests/daml-test-files/TextMap.daml +++ b/sdk/compiler/damlc/tests/daml-test-files/TextMap.daml @@ -24,9 +24,13 @@ testFromList = script do True === member "3" (fromList [("1", "a"), ("3", "b"), ("4", "c")]) fromList [("1", "b")] === fromList [("1", "a"), ("1", "c"), ("1", "b")] -testFromListWith = script do - fromListWith (++) [("A", [1]), ("A", [2]), ("B", [2]), ("B", [1]), ("A", [3])] === fromList [("A", [1, 2, 3]), ("B", [2, 1])] - fromListWith (++) [] === (empty : TextMap [Int]) +testFromListWithL = script do + fromListWithL (++) [("A", [1]), ("A", [2]), ("B", [2]), ("B", [1]), ("A", [3])] === fromList [("A", [3, 2, 1]), ("B", [1, 2])] + fromListWithL (++) [] === (empty : TextMap [Int]) + +testFromListWithR = script do + fromListWithR (++) [("A", [1]), ("A", [2]), ("B", [2]), ("B", [1]), ("A", [3])] === fromList [("A", [1, 2, 3]), ("B", [2, 1])] + fromListWithR (++) [] === (empty : TextMap [Int]) testMember = script do False === member "a" (fromList ([("", 1.0), ("b", 2.0), ("c", 3.0)] : [(Text, Decimal)])) diff --git a/sdk/compiler/damlc/tests/platform-independence.dar-hash b/sdk/compiler/damlc/tests/platform-independence.dar-hash index 960552346432..8d58442a8bba 100644 --- a/sdk/compiler/damlc/tests/platform-independence.dar-hash +++ b/sdk/compiler/damlc/tests/platform-independence.dar-hash @@ -1,34 +1,34 @@ -d437ea94d68765e6d072e55d55232140c75f3d0cd2704fd5d138492eddf6f15f META-INF/MANIFEST.MF -af53bfb744c41db01eb8066a4f2485bab8af7444206202213be5a37dc0e2f36d platform-independence-1.0.0-cc970409d01aa851d1d61ba77865520cd6df798508181c5af579d3995232e5fc/compiler/damlc/tests/PlatformIndependence.daml -0000000000000000000000000000000000000000000000000000000000000000 platform-independence-1.0.0-cc970409d01aa851d1d61ba77865520cd6df798508181c5af579d3995232e5fc/compiler/damlc/tests/PlatformIndependence.hi -0000000000000000000000000000000000000000000000000000000000000000 platform-independence-1.0.0-cc970409d01aa851d1d61ba77865520cd6df798508181c5af579d3995232e5fc/compiler/damlc/tests/PlatformIndependence.hie -f449ec0bad9cadcaa79224e1ac15d9851968e6d4d73754fd0e2adce768f72056 platform-independence-1.0.0-cc970409d01aa851d1d61ba77865520cd6df798508181c5af579d3995232e5fc/daml-prim-315cb5676675c14e71453d4a9a2a58900e5b50d6665cba4cdf21f58b22abff83.dalf -6458feec418d71e834dfa5b56a32b640f0595d1cf9bef29c3456cf9eac1c921e platform-independence-1.0.0-cc970409d01aa851d1d61ba77865520cd6df798508181c5af579d3995232e5fc/daml-prim-DA-Exception-ArithmeticError-cb0552debf219cc909f51cbb5c3b41e9981d39f8f645b1f35e2ef5be2e0b858a.dalf -ce477181ed187d31fb71e2819cd8af24b3bee3ff55b02950c23363849cf86a47 platform-independence-1.0.0-cc970409d01aa851d1d61ba77865520cd6df798508181c5af579d3995232e5fc/daml-prim-DA-Exception-AssertionFailed-3f4deaf145a15cdcfa762c058005e2edb9baa75bb7f95a4f8f6f937378e86415.dalf -a5dafa3128e153955c2360201cb700b09d170914847b184184e4413be848cecb platform-independence-1.0.0-cc970409d01aa851d1d61ba77865520cd6df798508181c5af579d3995232e5fc/daml-prim-DA-Exception-GeneralError-86828b9843465f419db1ef8a8ee741d1eef645df02375ebf509cdc8c3ddd16cb.dalf -9ec4a0044ebf1002e47c5119b06c8650535f0bd841d8a0c7189455a3720169f3 platform-independence-1.0.0-cc970409d01aa851d1d61ba77865520cd6df798508181c5af579d3995232e5fc/daml-prim-DA-Exception-PreconditionFailed-f20de1e4e37b92280264c08bf15eca0be0bc5babd7a7b5e574997f154c00cb78.dalf -9a6861aa98233c2fd6a446edd4255c2891ab3db5eec355955381f35088956a23 platform-independence-1.0.0-cc970409d01aa851d1d61ba77865520cd6df798508181c5af579d3995232e5fc/daml-prim-DA-Internal-Erased-76bf0fd12bd945762a01f8fc5bbcdfa4d0ff20f8762af490f8f41d6237c6524f.dalf -e66c79fc41a6bd6350ab265ee3bd15c0a6d5cd1748757194577448c89ce9e6a7 platform-independence-1.0.0-cc970409d01aa851d1d61ba77865520cd6df798508181c5af579d3995232e5fc/daml-prim-DA-Internal-NatSyn-38e6274601b21d7202bb995bc5ec147decda5a01b68d57dda422425038772af7.dalf -608e8efb2ed17a67eae9ddb74ca235a848195da170f47bf4d18d33bc7e96cc44 platform-independence-1.0.0-cc970409d01aa851d1d61ba77865520cd6df798508181c5af579d3995232e5fc/daml-prim-DA-Internal-PromotedText-d58cf9939847921b2aab78eaa7b427dc4c649d25e6bee3c749ace4c3f52f5c97.dalf -42105a59d0c9c7088a8860693f6da3d60ca62da5ccac1b9cf0dde8f975b984a5 platform-independence-1.0.0-cc970409d01aa851d1d61ba77865520cd6df798508181c5af579d3995232e5fc/daml-prim-DA-Types-40f452260bef3f29dede136108fc08a88d5a5250310281067087da6f0baddff7.dalf -12906f0e43060e26f823f03c2bbfe4d541db833d370db4caae2c66f38acae440 platform-independence-1.0.0-cc970409d01aa851d1d61ba77865520cd6df798508181c5af579d3995232e5fc/daml-prim-GHC-Prim-e491352788e56ca4603acc411ffe1a49fefd76ed8b163af86cf5ee5f4c38645b.dalf -bdc8c66d0511eff0262d3a133269e655bf47ba742e98ced5bc76a3fcd0211a73 platform-independence-1.0.0-cc970409d01aa851d1d61ba77865520cd6df798508181c5af579d3995232e5fc/daml-prim-GHC-Tuple-6839a6d3d430c569b2425e9391717b44ca324b88ba621d597778811b2d05031d.dalf -e99c27f6b9d297aaf747b572356e08376ce8d7a994ff00242749978b8a8a9ab0 platform-independence-1.0.0-cc970409d01aa851d1d61ba77865520cd6df798508181c5af579d3995232e5fc/daml-prim-GHC-Types-518032f41fd0175461b35ae0c9691e08b4aea55e62915f8360af2cc7a1f2ba6c.dalf -08a841ff213451e925c9c544b5c990c5499ac70471bd6114dacab4d7678b300a platform-independence-1.0.0-cc970409d01aa851d1d61ba77865520cd6df798508181c5af579d3995232e5fc/daml-stdlib-0.0.0-b81cc36228f1cbf48969c312905bdd13fecb3af020b7017867a4c8e9b819e6c1.dalf -dc4bd12915aea953a4ae6fb5e3b31fd3ec99605ae402c8b6350035ed9bbdeda7 platform-independence-1.0.0-cc970409d01aa851d1d61ba77865520cd6df798508181c5af579d3995232e5fc/daml-stdlib-DA-Action-State-Type-10e0333b52bba1ff147fc408a6b7d68465b157635ee230493bd6029b750dcb05.dalf -6d9d1309c57dab98cb34fda6b26d3c6d5b2e5fb1357333bce2c0b26c262fc372 platform-independence-1.0.0-cc970409d01aa851d1d61ba77865520cd6df798508181c5af579d3995232e5fc/daml-stdlib-DA-Date-Types-bfcd37bd6b84768e86e432f5f6c33e25d9e7724a9d42e33875ff74f6348e733f.dalf -acb729cf88297d61a52ba5852019326077f682e914052449d75142447b89b964 platform-independence-1.0.0-cc970409d01aa851d1d61ba77865520cd6df798508181c5af579d3995232e5fc/daml-stdlib-DA-Internal-Any-cc348d369011362a5190fe96dd1f0dfbc697fdfd10e382b9e9666f0da05961b7.dalf -5625ab94e607b99fd03cfb3a618c3ec8227cf35dc917cc310d12c34691d10c9d platform-independence-1.0.0-cc970409d01aa851d1d61ba77865520cd6df798508181c5af579d3995232e5fc/daml-stdlib-DA-Internal-Down-057eed1fd48c238491b8ea06b9b5bf85a5d4c9275dd3f6183e0e6b01730cc2ba.dalf -fb97292e2989cf6b046d0c07355a86741ba327231b13596e646f6aed3c65b726 platform-independence-1.0.0-cc970409d01aa851d1d61ba77865520cd6df798508181c5af579d3995232e5fc/daml-stdlib-DA-Internal-Interface-AnyView-Types-6df2d1fd8ea994ed048a79587b2722e3a887ac7592abf31ecf46fe09ac02d689.dalf -e6817a705c974eea0b05051e919e18cab97df616f3d8c8e590b41cde1147b7bf platform-independence-1.0.0-cc970409d01aa851d1d61ba77865520cd6df798508181c5af579d3995232e5fc/daml-stdlib-DA-Internal-Template-d14e08374fc7197d6a0de468c968ae8ba3aadbf9315476fd39071831f5923662.dalf -542ba5ef4d1707d77dbaa2c457adc06f28bad394968bae25635a982b7b1f6916 platform-independence-1.0.0-cc970409d01aa851d1d61ba77865520cd6df798508181c5af579d3995232e5fc/daml-stdlib-DA-Logic-Types-c1f1f00558799eec139fb4f4c76f95fb52fa1837a5dd29600baa1c8ed1bdccfd.dalf -a70854a646e926e98a102a6d332c67872b4bc5978700bf946ce58dfc94ba993c platform-independence-1.0.0-cc970409d01aa851d1d61ba77865520cd6df798508181c5af579d3995232e5fc/daml-stdlib-DA-Monoid-Types-6c2c0667393c5f92f1885163068cd31800d2264eb088eb6fc740e11241b2bf06.dalf -e80bf135b35aa8a1eca973e1b57b95b2ff3c6f9b1039be8b0a8e6a1810bfc613 platform-independence-1.0.0-cc970409d01aa851d1d61ba77865520cd6df798508181c5af579d3995232e5fc/daml-stdlib-DA-NonEmpty-Types-e22bce619ae24ca3b8e6519281cb5a33b64b3190cc763248b4c3f9ad5087a92c.dalf -77210bf43703a6883586997dfab07154c988f294b144337d056f99ba14fa6150 platform-independence-1.0.0-cc970409d01aa851d1d61ba77865520cd6df798508181c5af579d3995232e5fc/daml-stdlib-DA-Random-Types-e4cc67c3264eba4a19c080cac5ab32d87551578e0f5f58b6a9460f91c7abc254.dalf -aea033031e908d0a9b7c4701bc4a563c5f25b0f626ab3abb11725fe6525d4f79 platform-independence-1.0.0-cc970409d01aa851d1d61ba77865520cd6df798508181c5af579d3995232e5fc/daml-stdlib-DA-Semigroup-Types-8a7806365bbd98d88b4c13832ebfa305f6abaeaf32cfa2b7dd25c4fa489b79fb.dalf -41970cee0963cbf25ffb1d35601b4200631aedf794f80ab22f999416b48d8531 platform-independence-1.0.0-cc970409d01aa851d1d61ba77865520cd6df798508181c5af579d3995232e5fc/daml-stdlib-DA-Set-Types-97b883cd8a2b7f49f90d5d39c981cf6e110cf1f1c64427a28a6d58ec88c43657.dalf -e198664748ca9a14de3cf197a0bac3aec6deb3d4097db73dfbf300bb97e30b9a platform-independence-1.0.0-cc970409d01aa851d1d61ba77865520cd6df798508181c5af579d3995232e5fc/daml-stdlib-DA-Stack-Types-5921708ce82f4255deb1b26d2c05358b548720938a5a325718dc69f381ba47ff.dalf -826cad481a81e8e1fd7151a0f9c3bf5c14cc14e2983e1abc143387dafe4b8282 platform-independence-1.0.0-cc970409d01aa851d1d61ba77865520cd6df798508181c5af579d3995232e5fc/daml-stdlib-DA-Time-Types-733e38d36a2759688a4b2c4cec69d48e7b55ecc8dedc8067b815926c917a182a.dalf -348c6f5fcd6b3b2753a8418cdb980b3a8c73fcc37ff1ffc63c0a9625159ca067 platform-independence-1.0.0-cc970409d01aa851d1d61ba77865520cd6df798508181c5af579d3995232e5fc/daml-stdlib-DA-Validation-Types-99a2705ed38c1c26cbb8fe7acf36bbf626668e167a33335de932599219e0a235.dalf -c0ee8933aa71d974733d3a902430a66c774ab14302a5f84d9fff398f8d94d60c platform-independence-1.0.0-cc970409d01aa851d1d61ba77865520cd6df798508181c5af579d3995232e5fc/data/platform-independence-1.0.0.conf -f2de19ae3b4212dc81c4ae005bf574e0d324be87895ef708d60eac489784550e platform-independence-1.0.0-cc970409d01aa851d1d61ba77865520cd6df798508181c5af579d3995232e5fc/platform-independence-1.0.0-cc970409d01aa851d1d61ba77865520cd6df798508181c5af579d3995232e5fc.dalf +897d70c821b4328c82230a674b12e47d78b036b8fb344d523582733d5fd50c1c META-INF/MANIFEST.MF +af53bfb744c41db01eb8066a4f2485bab8af7444206202213be5a37dc0e2f36d platform-independence-1.0.0-09606c32c345f63adef3cf47e7152fa2418282cb70bff10ead8167ab67a44590/compiler/damlc/tests/PlatformIndependence.daml +0000000000000000000000000000000000000000000000000000000000000000 platform-independence-1.0.0-09606c32c345f63adef3cf47e7152fa2418282cb70bff10ead8167ab67a44590/compiler/damlc/tests/PlatformIndependence.hi +0000000000000000000000000000000000000000000000000000000000000000 platform-independence-1.0.0-09606c32c345f63adef3cf47e7152fa2418282cb70bff10ead8167ab67a44590/compiler/damlc/tests/PlatformIndependence.hie +f449ec0bad9cadcaa79224e1ac15d9851968e6d4d73754fd0e2adce768f72056 platform-independence-1.0.0-09606c32c345f63adef3cf47e7152fa2418282cb70bff10ead8167ab67a44590/daml-prim-315cb5676675c14e71453d4a9a2a58900e5b50d6665cba4cdf21f58b22abff83.dalf +6458feec418d71e834dfa5b56a32b640f0595d1cf9bef29c3456cf9eac1c921e platform-independence-1.0.0-09606c32c345f63adef3cf47e7152fa2418282cb70bff10ead8167ab67a44590/daml-prim-DA-Exception-ArithmeticError-cb0552debf219cc909f51cbb5c3b41e9981d39f8f645b1f35e2ef5be2e0b858a.dalf +ce477181ed187d31fb71e2819cd8af24b3bee3ff55b02950c23363849cf86a47 platform-independence-1.0.0-09606c32c345f63adef3cf47e7152fa2418282cb70bff10ead8167ab67a44590/daml-prim-DA-Exception-AssertionFailed-3f4deaf145a15cdcfa762c058005e2edb9baa75bb7f95a4f8f6f937378e86415.dalf +a5dafa3128e153955c2360201cb700b09d170914847b184184e4413be848cecb platform-independence-1.0.0-09606c32c345f63adef3cf47e7152fa2418282cb70bff10ead8167ab67a44590/daml-prim-DA-Exception-GeneralError-86828b9843465f419db1ef8a8ee741d1eef645df02375ebf509cdc8c3ddd16cb.dalf +9ec4a0044ebf1002e47c5119b06c8650535f0bd841d8a0c7189455a3720169f3 platform-independence-1.0.0-09606c32c345f63adef3cf47e7152fa2418282cb70bff10ead8167ab67a44590/daml-prim-DA-Exception-PreconditionFailed-f20de1e4e37b92280264c08bf15eca0be0bc5babd7a7b5e574997f154c00cb78.dalf +9a6861aa98233c2fd6a446edd4255c2891ab3db5eec355955381f35088956a23 platform-independence-1.0.0-09606c32c345f63adef3cf47e7152fa2418282cb70bff10ead8167ab67a44590/daml-prim-DA-Internal-Erased-76bf0fd12bd945762a01f8fc5bbcdfa4d0ff20f8762af490f8f41d6237c6524f.dalf +e66c79fc41a6bd6350ab265ee3bd15c0a6d5cd1748757194577448c89ce9e6a7 platform-independence-1.0.0-09606c32c345f63adef3cf47e7152fa2418282cb70bff10ead8167ab67a44590/daml-prim-DA-Internal-NatSyn-38e6274601b21d7202bb995bc5ec147decda5a01b68d57dda422425038772af7.dalf +608e8efb2ed17a67eae9ddb74ca235a848195da170f47bf4d18d33bc7e96cc44 platform-independence-1.0.0-09606c32c345f63adef3cf47e7152fa2418282cb70bff10ead8167ab67a44590/daml-prim-DA-Internal-PromotedText-d58cf9939847921b2aab78eaa7b427dc4c649d25e6bee3c749ace4c3f52f5c97.dalf +42105a59d0c9c7088a8860693f6da3d60ca62da5ccac1b9cf0dde8f975b984a5 platform-independence-1.0.0-09606c32c345f63adef3cf47e7152fa2418282cb70bff10ead8167ab67a44590/daml-prim-DA-Types-40f452260bef3f29dede136108fc08a88d5a5250310281067087da6f0baddff7.dalf +12906f0e43060e26f823f03c2bbfe4d541db833d370db4caae2c66f38acae440 platform-independence-1.0.0-09606c32c345f63adef3cf47e7152fa2418282cb70bff10ead8167ab67a44590/daml-prim-GHC-Prim-e491352788e56ca4603acc411ffe1a49fefd76ed8b163af86cf5ee5f4c38645b.dalf +bdc8c66d0511eff0262d3a133269e655bf47ba742e98ced5bc76a3fcd0211a73 platform-independence-1.0.0-09606c32c345f63adef3cf47e7152fa2418282cb70bff10ead8167ab67a44590/daml-prim-GHC-Tuple-6839a6d3d430c569b2425e9391717b44ca324b88ba621d597778811b2d05031d.dalf +e99c27f6b9d297aaf747b572356e08376ce8d7a994ff00242749978b8a8a9ab0 platform-independence-1.0.0-09606c32c345f63adef3cf47e7152fa2418282cb70bff10ead8167ab67a44590/daml-prim-GHC-Types-518032f41fd0175461b35ae0c9691e08b4aea55e62915f8360af2cc7a1f2ba6c.dalf +3e2da9beca11aedbbd0cd1371975d1f57d26f5b9457236da4777e4ec3176f84f platform-independence-1.0.0-09606c32c345f63adef3cf47e7152fa2418282cb70bff10ead8167ab67a44590/daml-stdlib-0.0.0-03d719eb3e4652f1483b15bd829f74799b07e7a143e175a4fe85ac2807ee44f8.dalf +dc4bd12915aea953a4ae6fb5e3b31fd3ec99605ae402c8b6350035ed9bbdeda7 platform-independence-1.0.0-09606c32c345f63adef3cf47e7152fa2418282cb70bff10ead8167ab67a44590/daml-stdlib-DA-Action-State-Type-10e0333b52bba1ff147fc408a6b7d68465b157635ee230493bd6029b750dcb05.dalf +6d9d1309c57dab98cb34fda6b26d3c6d5b2e5fb1357333bce2c0b26c262fc372 platform-independence-1.0.0-09606c32c345f63adef3cf47e7152fa2418282cb70bff10ead8167ab67a44590/daml-stdlib-DA-Date-Types-bfcd37bd6b84768e86e432f5f6c33e25d9e7724a9d42e33875ff74f6348e733f.dalf +acb729cf88297d61a52ba5852019326077f682e914052449d75142447b89b964 platform-independence-1.0.0-09606c32c345f63adef3cf47e7152fa2418282cb70bff10ead8167ab67a44590/daml-stdlib-DA-Internal-Any-cc348d369011362a5190fe96dd1f0dfbc697fdfd10e382b9e9666f0da05961b7.dalf +5625ab94e607b99fd03cfb3a618c3ec8227cf35dc917cc310d12c34691d10c9d platform-independence-1.0.0-09606c32c345f63adef3cf47e7152fa2418282cb70bff10ead8167ab67a44590/daml-stdlib-DA-Internal-Down-057eed1fd48c238491b8ea06b9b5bf85a5d4c9275dd3f6183e0e6b01730cc2ba.dalf +fb97292e2989cf6b046d0c07355a86741ba327231b13596e646f6aed3c65b726 platform-independence-1.0.0-09606c32c345f63adef3cf47e7152fa2418282cb70bff10ead8167ab67a44590/daml-stdlib-DA-Internal-Interface-AnyView-Types-6df2d1fd8ea994ed048a79587b2722e3a887ac7592abf31ecf46fe09ac02d689.dalf +e6817a705c974eea0b05051e919e18cab97df616f3d8c8e590b41cde1147b7bf platform-independence-1.0.0-09606c32c345f63adef3cf47e7152fa2418282cb70bff10ead8167ab67a44590/daml-stdlib-DA-Internal-Template-d14e08374fc7197d6a0de468c968ae8ba3aadbf9315476fd39071831f5923662.dalf +542ba5ef4d1707d77dbaa2c457adc06f28bad394968bae25635a982b7b1f6916 platform-independence-1.0.0-09606c32c345f63adef3cf47e7152fa2418282cb70bff10ead8167ab67a44590/daml-stdlib-DA-Logic-Types-c1f1f00558799eec139fb4f4c76f95fb52fa1837a5dd29600baa1c8ed1bdccfd.dalf +a70854a646e926e98a102a6d332c67872b4bc5978700bf946ce58dfc94ba993c platform-independence-1.0.0-09606c32c345f63adef3cf47e7152fa2418282cb70bff10ead8167ab67a44590/daml-stdlib-DA-Monoid-Types-6c2c0667393c5f92f1885163068cd31800d2264eb088eb6fc740e11241b2bf06.dalf +e80bf135b35aa8a1eca973e1b57b95b2ff3c6f9b1039be8b0a8e6a1810bfc613 platform-independence-1.0.0-09606c32c345f63adef3cf47e7152fa2418282cb70bff10ead8167ab67a44590/daml-stdlib-DA-NonEmpty-Types-e22bce619ae24ca3b8e6519281cb5a33b64b3190cc763248b4c3f9ad5087a92c.dalf +77210bf43703a6883586997dfab07154c988f294b144337d056f99ba14fa6150 platform-independence-1.0.0-09606c32c345f63adef3cf47e7152fa2418282cb70bff10ead8167ab67a44590/daml-stdlib-DA-Random-Types-e4cc67c3264eba4a19c080cac5ab32d87551578e0f5f58b6a9460f91c7abc254.dalf +aea033031e908d0a9b7c4701bc4a563c5f25b0f626ab3abb11725fe6525d4f79 platform-independence-1.0.0-09606c32c345f63adef3cf47e7152fa2418282cb70bff10ead8167ab67a44590/daml-stdlib-DA-Semigroup-Types-8a7806365bbd98d88b4c13832ebfa305f6abaeaf32cfa2b7dd25c4fa489b79fb.dalf +41970cee0963cbf25ffb1d35601b4200631aedf794f80ab22f999416b48d8531 platform-independence-1.0.0-09606c32c345f63adef3cf47e7152fa2418282cb70bff10ead8167ab67a44590/daml-stdlib-DA-Set-Types-97b883cd8a2b7f49f90d5d39c981cf6e110cf1f1c64427a28a6d58ec88c43657.dalf +e198664748ca9a14de3cf197a0bac3aec6deb3d4097db73dfbf300bb97e30b9a platform-independence-1.0.0-09606c32c345f63adef3cf47e7152fa2418282cb70bff10ead8167ab67a44590/daml-stdlib-DA-Stack-Types-5921708ce82f4255deb1b26d2c05358b548720938a5a325718dc69f381ba47ff.dalf +826cad481a81e8e1fd7151a0f9c3bf5c14cc14e2983e1abc143387dafe4b8282 platform-independence-1.0.0-09606c32c345f63adef3cf47e7152fa2418282cb70bff10ead8167ab67a44590/daml-stdlib-DA-Time-Types-733e38d36a2759688a4b2c4cec69d48e7b55ecc8dedc8067b815926c917a182a.dalf +348c6f5fcd6b3b2753a8418cdb980b3a8c73fcc37ff1ffc63c0a9625159ca067 platform-independence-1.0.0-09606c32c345f63adef3cf47e7152fa2418282cb70bff10ead8167ab67a44590/daml-stdlib-DA-Validation-Types-99a2705ed38c1c26cbb8fe7acf36bbf626668e167a33335de932599219e0a235.dalf +eb662351a3fb811dec75afc9db7083d754ee211d19074a304565de8d91e4cac5 platform-independence-1.0.0-09606c32c345f63adef3cf47e7152fa2418282cb70bff10ead8167ab67a44590/data/platform-independence-1.0.0.conf +92035030440fb3768bf6d3d4bc4c2776bd4168ff25ced73897b286af2bb989e6 platform-independence-1.0.0-09606c32c345f63adef3cf47e7152fa2418282cb70bff10ead8167ab67a44590/platform-independence-1.0.0-09606c32c345f63adef3cf47e7152fa2418282cb70bff10ead8167ab67a44590.dalf From 76d88fdfd8d9126e4c94687f645e22ccb45b4f53 Mon Sep 17 00:00:00 2001 From: Ang Hao Yang Date: Thu, 26 Sep 2024 19:04:01 +0800 Subject: [PATCH 2/2] Introduce insertWith from Map to TextMap and refactor fromListWithL. (#19962) --- .../damlc/daml-stdlib-src/DA/Map.daml | 6 +- .../damlc/daml-stdlib-src/DA/TextMap.daml | 16 +++-- .../damlc/tests/daml-test-files/TextMap.daml | 4 ++ .../tests/platform-independence.dar-hash | 68 +++++++++---------- 4 files changed, 50 insertions(+), 44 deletions(-) diff --git a/sdk/compiler/damlc/daml-stdlib-src/DA/Map.daml b/sdk/compiler/damlc/daml-stdlib-src/DA/Map.daml index 722fcdffea05..a10bd2845d10 100644 --- a/sdk/compiler/damlc/daml-stdlib-src/DA/Map.daml +++ b/sdk/compiler/damlc/daml-stdlib-src/DA/Map.daml @@ -87,11 +87,7 @@ fromList list = foldl (\acc (key, value) -> insert key value acc) empty list fromListWithL : Ord k => (v -> v -> v) -> [(k, v)] -> Map k v fromListWithL f = foldl g empty where - g acc (k, x) = - let z = case lookup k acc of - None -> x - Some y -> f x y - in insert k z acc + g acc (k, v) = insertWith f k v acc -- | Create a map from a list of key/value pairs like `fromListWithL` -- with the combining function flipped. Examples: diff --git a/sdk/compiler/damlc/daml-stdlib-src/DA/TextMap.daml b/sdk/compiler/damlc/daml-stdlib-src/DA/TextMap.daml index 71f5d950be13..effd6d9cc0c5 100644 --- a/sdk/compiler/damlc/daml-stdlib-src/DA/TextMap.daml +++ b/sdk/compiler/damlc/daml-stdlib-src/DA/TextMap.daml @@ -20,6 +20,7 @@ module DA.TextMap , filterWithKey , delete , insert + , insertWith , union , merge ) where @@ -53,11 +54,7 @@ fromList list = foldl (\acc (key, value) -> insert key value acc) empty list fromListWithL : (a -> a -> a) -> [(Text, a)] -> TextMap a fromListWithL f = foldl g empty where - g acc (k, x) = - let z = case lookup k acc of - None -> x - Some y -> f x y - in insert k z acc + g acc (k, v) = insertWith f k v acc -- | Create a map from a list of key/value pairs like `fromListWithL` -- with the combining function flipped. Examples: @@ -121,6 +118,15 @@ delete = primitive @"BETextMapDelete" insert : Text -> a -> TextMap a -> TextMap a insert = primitive @"BETextMapInsert" +-- | Insert a new key/value pair in the map. If the key is already +-- present in the map, it is combined with the previous value using the given function +-- `f new_value old_value`. +insertWith : (v -> v -> v) -> Text -> v -> TextMap v -> TextMap v +insertWith f k v m = + case lookup k m of + None -> insert k v m + Some v' -> insert k (f v v') m + -- | The union of two maps, preferring the first map when equal -- keys are encountered. union : TextMap a -> TextMap a -> TextMap a diff --git a/sdk/compiler/damlc/tests/daml-test-files/TextMap.daml b/sdk/compiler/damlc/tests/daml-test-files/TextMap.daml index 2540dc66680e..2bc8f59baa8f 100644 --- a/sdk/compiler/damlc/tests/daml-test-files/TextMap.daml +++ b/sdk/compiler/damlc/tests/daml-test-files/TextMap.daml @@ -80,3 +80,7 @@ testMerge = script do [("A", "bb"), ("C", "aa")] === toList (merge (\_ v -> if v <= "bb" then Some v else None) (\_ v -> Some v) (\_ _ _ -> None) m1 empty) [("A", "a"), ("C", "b")] === toList (merge (\_ v -> Some v) (\_ v -> if v <= "bb" then Some v else None) (\_ _ _ -> None) empty m2) [("A","bb"), ("B","dd"), ("C","aa")] === toList (merge (\_ _ -> None) (\_ _ -> None) (\_ v _ -> Some v) m1 m2) + +testInsertWith = script do + insertWith (-) "A" 2 (fromList []) === fromList [("A", 2)] + insertWith (-) "A" 2 (fromList [("A",1)]) === fromList [("A", 2-1)] diff --git a/sdk/compiler/damlc/tests/platform-independence.dar-hash b/sdk/compiler/damlc/tests/platform-independence.dar-hash index 8d58442a8bba..31d16842821d 100644 --- a/sdk/compiler/damlc/tests/platform-independence.dar-hash +++ b/sdk/compiler/damlc/tests/platform-independence.dar-hash @@ -1,34 +1,34 @@ -897d70c821b4328c82230a674b12e47d78b036b8fb344d523582733d5fd50c1c META-INF/MANIFEST.MF -af53bfb744c41db01eb8066a4f2485bab8af7444206202213be5a37dc0e2f36d platform-independence-1.0.0-09606c32c345f63adef3cf47e7152fa2418282cb70bff10ead8167ab67a44590/compiler/damlc/tests/PlatformIndependence.daml -0000000000000000000000000000000000000000000000000000000000000000 platform-independence-1.0.0-09606c32c345f63adef3cf47e7152fa2418282cb70bff10ead8167ab67a44590/compiler/damlc/tests/PlatformIndependence.hi -0000000000000000000000000000000000000000000000000000000000000000 platform-independence-1.0.0-09606c32c345f63adef3cf47e7152fa2418282cb70bff10ead8167ab67a44590/compiler/damlc/tests/PlatformIndependence.hie -f449ec0bad9cadcaa79224e1ac15d9851968e6d4d73754fd0e2adce768f72056 platform-independence-1.0.0-09606c32c345f63adef3cf47e7152fa2418282cb70bff10ead8167ab67a44590/daml-prim-315cb5676675c14e71453d4a9a2a58900e5b50d6665cba4cdf21f58b22abff83.dalf -6458feec418d71e834dfa5b56a32b640f0595d1cf9bef29c3456cf9eac1c921e platform-independence-1.0.0-09606c32c345f63adef3cf47e7152fa2418282cb70bff10ead8167ab67a44590/daml-prim-DA-Exception-ArithmeticError-cb0552debf219cc909f51cbb5c3b41e9981d39f8f645b1f35e2ef5be2e0b858a.dalf -ce477181ed187d31fb71e2819cd8af24b3bee3ff55b02950c23363849cf86a47 platform-independence-1.0.0-09606c32c345f63adef3cf47e7152fa2418282cb70bff10ead8167ab67a44590/daml-prim-DA-Exception-AssertionFailed-3f4deaf145a15cdcfa762c058005e2edb9baa75bb7f95a4f8f6f937378e86415.dalf -a5dafa3128e153955c2360201cb700b09d170914847b184184e4413be848cecb platform-independence-1.0.0-09606c32c345f63adef3cf47e7152fa2418282cb70bff10ead8167ab67a44590/daml-prim-DA-Exception-GeneralError-86828b9843465f419db1ef8a8ee741d1eef645df02375ebf509cdc8c3ddd16cb.dalf -9ec4a0044ebf1002e47c5119b06c8650535f0bd841d8a0c7189455a3720169f3 platform-independence-1.0.0-09606c32c345f63adef3cf47e7152fa2418282cb70bff10ead8167ab67a44590/daml-prim-DA-Exception-PreconditionFailed-f20de1e4e37b92280264c08bf15eca0be0bc5babd7a7b5e574997f154c00cb78.dalf -9a6861aa98233c2fd6a446edd4255c2891ab3db5eec355955381f35088956a23 platform-independence-1.0.0-09606c32c345f63adef3cf47e7152fa2418282cb70bff10ead8167ab67a44590/daml-prim-DA-Internal-Erased-76bf0fd12bd945762a01f8fc5bbcdfa4d0ff20f8762af490f8f41d6237c6524f.dalf -e66c79fc41a6bd6350ab265ee3bd15c0a6d5cd1748757194577448c89ce9e6a7 platform-independence-1.0.0-09606c32c345f63adef3cf47e7152fa2418282cb70bff10ead8167ab67a44590/daml-prim-DA-Internal-NatSyn-38e6274601b21d7202bb995bc5ec147decda5a01b68d57dda422425038772af7.dalf -608e8efb2ed17a67eae9ddb74ca235a848195da170f47bf4d18d33bc7e96cc44 platform-independence-1.0.0-09606c32c345f63adef3cf47e7152fa2418282cb70bff10ead8167ab67a44590/daml-prim-DA-Internal-PromotedText-d58cf9939847921b2aab78eaa7b427dc4c649d25e6bee3c749ace4c3f52f5c97.dalf -42105a59d0c9c7088a8860693f6da3d60ca62da5ccac1b9cf0dde8f975b984a5 platform-independence-1.0.0-09606c32c345f63adef3cf47e7152fa2418282cb70bff10ead8167ab67a44590/daml-prim-DA-Types-40f452260bef3f29dede136108fc08a88d5a5250310281067087da6f0baddff7.dalf -12906f0e43060e26f823f03c2bbfe4d541db833d370db4caae2c66f38acae440 platform-independence-1.0.0-09606c32c345f63adef3cf47e7152fa2418282cb70bff10ead8167ab67a44590/daml-prim-GHC-Prim-e491352788e56ca4603acc411ffe1a49fefd76ed8b163af86cf5ee5f4c38645b.dalf -bdc8c66d0511eff0262d3a133269e655bf47ba742e98ced5bc76a3fcd0211a73 platform-independence-1.0.0-09606c32c345f63adef3cf47e7152fa2418282cb70bff10ead8167ab67a44590/daml-prim-GHC-Tuple-6839a6d3d430c569b2425e9391717b44ca324b88ba621d597778811b2d05031d.dalf -e99c27f6b9d297aaf747b572356e08376ce8d7a994ff00242749978b8a8a9ab0 platform-independence-1.0.0-09606c32c345f63adef3cf47e7152fa2418282cb70bff10ead8167ab67a44590/daml-prim-GHC-Types-518032f41fd0175461b35ae0c9691e08b4aea55e62915f8360af2cc7a1f2ba6c.dalf -3e2da9beca11aedbbd0cd1371975d1f57d26f5b9457236da4777e4ec3176f84f platform-independence-1.0.0-09606c32c345f63adef3cf47e7152fa2418282cb70bff10ead8167ab67a44590/daml-stdlib-0.0.0-03d719eb3e4652f1483b15bd829f74799b07e7a143e175a4fe85ac2807ee44f8.dalf -dc4bd12915aea953a4ae6fb5e3b31fd3ec99605ae402c8b6350035ed9bbdeda7 platform-independence-1.0.0-09606c32c345f63adef3cf47e7152fa2418282cb70bff10ead8167ab67a44590/daml-stdlib-DA-Action-State-Type-10e0333b52bba1ff147fc408a6b7d68465b157635ee230493bd6029b750dcb05.dalf -6d9d1309c57dab98cb34fda6b26d3c6d5b2e5fb1357333bce2c0b26c262fc372 platform-independence-1.0.0-09606c32c345f63adef3cf47e7152fa2418282cb70bff10ead8167ab67a44590/daml-stdlib-DA-Date-Types-bfcd37bd6b84768e86e432f5f6c33e25d9e7724a9d42e33875ff74f6348e733f.dalf -acb729cf88297d61a52ba5852019326077f682e914052449d75142447b89b964 platform-independence-1.0.0-09606c32c345f63adef3cf47e7152fa2418282cb70bff10ead8167ab67a44590/daml-stdlib-DA-Internal-Any-cc348d369011362a5190fe96dd1f0dfbc697fdfd10e382b9e9666f0da05961b7.dalf -5625ab94e607b99fd03cfb3a618c3ec8227cf35dc917cc310d12c34691d10c9d platform-independence-1.0.0-09606c32c345f63adef3cf47e7152fa2418282cb70bff10ead8167ab67a44590/daml-stdlib-DA-Internal-Down-057eed1fd48c238491b8ea06b9b5bf85a5d4c9275dd3f6183e0e6b01730cc2ba.dalf -fb97292e2989cf6b046d0c07355a86741ba327231b13596e646f6aed3c65b726 platform-independence-1.0.0-09606c32c345f63adef3cf47e7152fa2418282cb70bff10ead8167ab67a44590/daml-stdlib-DA-Internal-Interface-AnyView-Types-6df2d1fd8ea994ed048a79587b2722e3a887ac7592abf31ecf46fe09ac02d689.dalf -e6817a705c974eea0b05051e919e18cab97df616f3d8c8e590b41cde1147b7bf platform-independence-1.0.0-09606c32c345f63adef3cf47e7152fa2418282cb70bff10ead8167ab67a44590/daml-stdlib-DA-Internal-Template-d14e08374fc7197d6a0de468c968ae8ba3aadbf9315476fd39071831f5923662.dalf -542ba5ef4d1707d77dbaa2c457adc06f28bad394968bae25635a982b7b1f6916 platform-independence-1.0.0-09606c32c345f63adef3cf47e7152fa2418282cb70bff10ead8167ab67a44590/daml-stdlib-DA-Logic-Types-c1f1f00558799eec139fb4f4c76f95fb52fa1837a5dd29600baa1c8ed1bdccfd.dalf -a70854a646e926e98a102a6d332c67872b4bc5978700bf946ce58dfc94ba993c platform-independence-1.0.0-09606c32c345f63adef3cf47e7152fa2418282cb70bff10ead8167ab67a44590/daml-stdlib-DA-Monoid-Types-6c2c0667393c5f92f1885163068cd31800d2264eb088eb6fc740e11241b2bf06.dalf -e80bf135b35aa8a1eca973e1b57b95b2ff3c6f9b1039be8b0a8e6a1810bfc613 platform-independence-1.0.0-09606c32c345f63adef3cf47e7152fa2418282cb70bff10ead8167ab67a44590/daml-stdlib-DA-NonEmpty-Types-e22bce619ae24ca3b8e6519281cb5a33b64b3190cc763248b4c3f9ad5087a92c.dalf -77210bf43703a6883586997dfab07154c988f294b144337d056f99ba14fa6150 platform-independence-1.0.0-09606c32c345f63adef3cf47e7152fa2418282cb70bff10ead8167ab67a44590/daml-stdlib-DA-Random-Types-e4cc67c3264eba4a19c080cac5ab32d87551578e0f5f58b6a9460f91c7abc254.dalf -aea033031e908d0a9b7c4701bc4a563c5f25b0f626ab3abb11725fe6525d4f79 platform-independence-1.0.0-09606c32c345f63adef3cf47e7152fa2418282cb70bff10ead8167ab67a44590/daml-stdlib-DA-Semigroup-Types-8a7806365bbd98d88b4c13832ebfa305f6abaeaf32cfa2b7dd25c4fa489b79fb.dalf -41970cee0963cbf25ffb1d35601b4200631aedf794f80ab22f999416b48d8531 platform-independence-1.0.0-09606c32c345f63adef3cf47e7152fa2418282cb70bff10ead8167ab67a44590/daml-stdlib-DA-Set-Types-97b883cd8a2b7f49f90d5d39c981cf6e110cf1f1c64427a28a6d58ec88c43657.dalf -e198664748ca9a14de3cf197a0bac3aec6deb3d4097db73dfbf300bb97e30b9a platform-independence-1.0.0-09606c32c345f63adef3cf47e7152fa2418282cb70bff10ead8167ab67a44590/daml-stdlib-DA-Stack-Types-5921708ce82f4255deb1b26d2c05358b548720938a5a325718dc69f381ba47ff.dalf -826cad481a81e8e1fd7151a0f9c3bf5c14cc14e2983e1abc143387dafe4b8282 platform-independence-1.0.0-09606c32c345f63adef3cf47e7152fa2418282cb70bff10ead8167ab67a44590/daml-stdlib-DA-Time-Types-733e38d36a2759688a4b2c4cec69d48e7b55ecc8dedc8067b815926c917a182a.dalf -348c6f5fcd6b3b2753a8418cdb980b3a8c73fcc37ff1ffc63c0a9625159ca067 platform-independence-1.0.0-09606c32c345f63adef3cf47e7152fa2418282cb70bff10ead8167ab67a44590/daml-stdlib-DA-Validation-Types-99a2705ed38c1c26cbb8fe7acf36bbf626668e167a33335de932599219e0a235.dalf -eb662351a3fb811dec75afc9db7083d754ee211d19074a304565de8d91e4cac5 platform-independence-1.0.0-09606c32c345f63adef3cf47e7152fa2418282cb70bff10ead8167ab67a44590/data/platform-independence-1.0.0.conf -92035030440fb3768bf6d3d4bc4c2776bd4168ff25ced73897b286af2bb989e6 platform-independence-1.0.0-09606c32c345f63adef3cf47e7152fa2418282cb70bff10ead8167ab67a44590/platform-independence-1.0.0-09606c32c345f63adef3cf47e7152fa2418282cb70bff10ead8167ab67a44590.dalf +51c9911d87df2df4e5cd040270d37fc7a3af96d4ea1341f3c39b777aca92c256 META-INF/MANIFEST.MF +af53bfb744c41db01eb8066a4f2485bab8af7444206202213be5a37dc0e2f36d platform-independence-1.0.0-afa90d0ccc76d39acbe1156fcb6d655b19805c160258b2237fb6df900a4121ef/compiler/damlc/tests/PlatformIndependence.daml +0000000000000000000000000000000000000000000000000000000000000000 platform-independence-1.0.0-afa90d0ccc76d39acbe1156fcb6d655b19805c160258b2237fb6df900a4121ef/compiler/damlc/tests/PlatformIndependence.hi +0000000000000000000000000000000000000000000000000000000000000000 platform-independence-1.0.0-afa90d0ccc76d39acbe1156fcb6d655b19805c160258b2237fb6df900a4121ef/compiler/damlc/tests/PlatformIndependence.hie +f449ec0bad9cadcaa79224e1ac15d9851968e6d4d73754fd0e2adce768f72056 platform-independence-1.0.0-afa90d0ccc76d39acbe1156fcb6d655b19805c160258b2237fb6df900a4121ef/daml-prim-315cb5676675c14e71453d4a9a2a58900e5b50d6665cba4cdf21f58b22abff83.dalf +6458feec418d71e834dfa5b56a32b640f0595d1cf9bef29c3456cf9eac1c921e platform-independence-1.0.0-afa90d0ccc76d39acbe1156fcb6d655b19805c160258b2237fb6df900a4121ef/daml-prim-DA-Exception-ArithmeticError-cb0552debf219cc909f51cbb5c3b41e9981d39f8f645b1f35e2ef5be2e0b858a.dalf +ce477181ed187d31fb71e2819cd8af24b3bee3ff55b02950c23363849cf86a47 platform-independence-1.0.0-afa90d0ccc76d39acbe1156fcb6d655b19805c160258b2237fb6df900a4121ef/daml-prim-DA-Exception-AssertionFailed-3f4deaf145a15cdcfa762c058005e2edb9baa75bb7f95a4f8f6f937378e86415.dalf +a5dafa3128e153955c2360201cb700b09d170914847b184184e4413be848cecb platform-independence-1.0.0-afa90d0ccc76d39acbe1156fcb6d655b19805c160258b2237fb6df900a4121ef/daml-prim-DA-Exception-GeneralError-86828b9843465f419db1ef8a8ee741d1eef645df02375ebf509cdc8c3ddd16cb.dalf +9ec4a0044ebf1002e47c5119b06c8650535f0bd841d8a0c7189455a3720169f3 platform-independence-1.0.0-afa90d0ccc76d39acbe1156fcb6d655b19805c160258b2237fb6df900a4121ef/daml-prim-DA-Exception-PreconditionFailed-f20de1e4e37b92280264c08bf15eca0be0bc5babd7a7b5e574997f154c00cb78.dalf +9a6861aa98233c2fd6a446edd4255c2891ab3db5eec355955381f35088956a23 platform-independence-1.0.0-afa90d0ccc76d39acbe1156fcb6d655b19805c160258b2237fb6df900a4121ef/daml-prim-DA-Internal-Erased-76bf0fd12bd945762a01f8fc5bbcdfa4d0ff20f8762af490f8f41d6237c6524f.dalf +e66c79fc41a6bd6350ab265ee3bd15c0a6d5cd1748757194577448c89ce9e6a7 platform-independence-1.0.0-afa90d0ccc76d39acbe1156fcb6d655b19805c160258b2237fb6df900a4121ef/daml-prim-DA-Internal-NatSyn-38e6274601b21d7202bb995bc5ec147decda5a01b68d57dda422425038772af7.dalf +608e8efb2ed17a67eae9ddb74ca235a848195da170f47bf4d18d33bc7e96cc44 platform-independence-1.0.0-afa90d0ccc76d39acbe1156fcb6d655b19805c160258b2237fb6df900a4121ef/daml-prim-DA-Internal-PromotedText-d58cf9939847921b2aab78eaa7b427dc4c649d25e6bee3c749ace4c3f52f5c97.dalf +42105a59d0c9c7088a8860693f6da3d60ca62da5ccac1b9cf0dde8f975b984a5 platform-independence-1.0.0-afa90d0ccc76d39acbe1156fcb6d655b19805c160258b2237fb6df900a4121ef/daml-prim-DA-Types-40f452260bef3f29dede136108fc08a88d5a5250310281067087da6f0baddff7.dalf +12906f0e43060e26f823f03c2bbfe4d541db833d370db4caae2c66f38acae440 platform-independence-1.0.0-afa90d0ccc76d39acbe1156fcb6d655b19805c160258b2237fb6df900a4121ef/daml-prim-GHC-Prim-e491352788e56ca4603acc411ffe1a49fefd76ed8b163af86cf5ee5f4c38645b.dalf +bdc8c66d0511eff0262d3a133269e655bf47ba742e98ced5bc76a3fcd0211a73 platform-independence-1.0.0-afa90d0ccc76d39acbe1156fcb6d655b19805c160258b2237fb6df900a4121ef/daml-prim-GHC-Tuple-6839a6d3d430c569b2425e9391717b44ca324b88ba621d597778811b2d05031d.dalf +e99c27f6b9d297aaf747b572356e08376ce8d7a994ff00242749978b8a8a9ab0 platform-independence-1.0.0-afa90d0ccc76d39acbe1156fcb6d655b19805c160258b2237fb6df900a4121ef/daml-prim-GHC-Types-518032f41fd0175461b35ae0c9691e08b4aea55e62915f8360af2cc7a1f2ba6c.dalf +73d0a96981ef31471f0ad14977bbe1eddb58ec9a459ba7bc47f438a28d11f476 platform-independence-1.0.0-afa90d0ccc76d39acbe1156fcb6d655b19805c160258b2237fb6df900a4121ef/daml-stdlib-0.0.0-13d63775db3c564fdf3f66c3596a15fea533376645b6d715133965cc77cd2885.dalf +dc4bd12915aea953a4ae6fb5e3b31fd3ec99605ae402c8b6350035ed9bbdeda7 platform-independence-1.0.0-afa90d0ccc76d39acbe1156fcb6d655b19805c160258b2237fb6df900a4121ef/daml-stdlib-DA-Action-State-Type-10e0333b52bba1ff147fc408a6b7d68465b157635ee230493bd6029b750dcb05.dalf +6d9d1309c57dab98cb34fda6b26d3c6d5b2e5fb1357333bce2c0b26c262fc372 platform-independence-1.0.0-afa90d0ccc76d39acbe1156fcb6d655b19805c160258b2237fb6df900a4121ef/daml-stdlib-DA-Date-Types-bfcd37bd6b84768e86e432f5f6c33e25d9e7724a9d42e33875ff74f6348e733f.dalf +acb729cf88297d61a52ba5852019326077f682e914052449d75142447b89b964 platform-independence-1.0.0-afa90d0ccc76d39acbe1156fcb6d655b19805c160258b2237fb6df900a4121ef/daml-stdlib-DA-Internal-Any-cc348d369011362a5190fe96dd1f0dfbc697fdfd10e382b9e9666f0da05961b7.dalf +5625ab94e607b99fd03cfb3a618c3ec8227cf35dc917cc310d12c34691d10c9d platform-independence-1.0.0-afa90d0ccc76d39acbe1156fcb6d655b19805c160258b2237fb6df900a4121ef/daml-stdlib-DA-Internal-Down-057eed1fd48c238491b8ea06b9b5bf85a5d4c9275dd3f6183e0e6b01730cc2ba.dalf +fb97292e2989cf6b046d0c07355a86741ba327231b13596e646f6aed3c65b726 platform-independence-1.0.0-afa90d0ccc76d39acbe1156fcb6d655b19805c160258b2237fb6df900a4121ef/daml-stdlib-DA-Internal-Interface-AnyView-Types-6df2d1fd8ea994ed048a79587b2722e3a887ac7592abf31ecf46fe09ac02d689.dalf +e6817a705c974eea0b05051e919e18cab97df616f3d8c8e590b41cde1147b7bf platform-independence-1.0.0-afa90d0ccc76d39acbe1156fcb6d655b19805c160258b2237fb6df900a4121ef/daml-stdlib-DA-Internal-Template-d14e08374fc7197d6a0de468c968ae8ba3aadbf9315476fd39071831f5923662.dalf +542ba5ef4d1707d77dbaa2c457adc06f28bad394968bae25635a982b7b1f6916 platform-independence-1.0.0-afa90d0ccc76d39acbe1156fcb6d655b19805c160258b2237fb6df900a4121ef/daml-stdlib-DA-Logic-Types-c1f1f00558799eec139fb4f4c76f95fb52fa1837a5dd29600baa1c8ed1bdccfd.dalf +a70854a646e926e98a102a6d332c67872b4bc5978700bf946ce58dfc94ba993c platform-independence-1.0.0-afa90d0ccc76d39acbe1156fcb6d655b19805c160258b2237fb6df900a4121ef/daml-stdlib-DA-Monoid-Types-6c2c0667393c5f92f1885163068cd31800d2264eb088eb6fc740e11241b2bf06.dalf +e80bf135b35aa8a1eca973e1b57b95b2ff3c6f9b1039be8b0a8e6a1810bfc613 platform-independence-1.0.0-afa90d0ccc76d39acbe1156fcb6d655b19805c160258b2237fb6df900a4121ef/daml-stdlib-DA-NonEmpty-Types-e22bce619ae24ca3b8e6519281cb5a33b64b3190cc763248b4c3f9ad5087a92c.dalf +77210bf43703a6883586997dfab07154c988f294b144337d056f99ba14fa6150 platform-independence-1.0.0-afa90d0ccc76d39acbe1156fcb6d655b19805c160258b2237fb6df900a4121ef/daml-stdlib-DA-Random-Types-e4cc67c3264eba4a19c080cac5ab32d87551578e0f5f58b6a9460f91c7abc254.dalf +aea033031e908d0a9b7c4701bc4a563c5f25b0f626ab3abb11725fe6525d4f79 platform-independence-1.0.0-afa90d0ccc76d39acbe1156fcb6d655b19805c160258b2237fb6df900a4121ef/daml-stdlib-DA-Semigroup-Types-8a7806365bbd98d88b4c13832ebfa305f6abaeaf32cfa2b7dd25c4fa489b79fb.dalf +41970cee0963cbf25ffb1d35601b4200631aedf794f80ab22f999416b48d8531 platform-independence-1.0.0-afa90d0ccc76d39acbe1156fcb6d655b19805c160258b2237fb6df900a4121ef/daml-stdlib-DA-Set-Types-97b883cd8a2b7f49f90d5d39c981cf6e110cf1f1c64427a28a6d58ec88c43657.dalf +e198664748ca9a14de3cf197a0bac3aec6deb3d4097db73dfbf300bb97e30b9a platform-independence-1.0.0-afa90d0ccc76d39acbe1156fcb6d655b19805c160258b2237fb6df900a4121ef/daml-stdlib-DA-Stack-Types-5921708ce82f4255deb1b26d2c05358b548720938a5a325718dc69f381ba47ff.dalf +826cad481a81e8e1fd7151a0f9c3bf5c14cc14e2983e1abc143387dafe4b8282 platform-independence-1.0.0-afa90d0ccc76d39acbe1156fcb6d655b19805c160258b2237fb6df900a4121ef/daml-stdlib-DA-Time-Types-733e38d36a2759688a4b2c4cec69d48e7b55ecc8dedc8067b815926c917a182a.dalf +348c6f5fcd6b3b2753a8418cdb980b3a8c73fcc37ff1ffc63c0a9625159ca067 platform-independence-1.0.0-afa90d0ccc76d39acbe1156fcb6d655b19805c160258b2237fb6df900a4121ef/daml-stdlib-DA-Validation-Types-99a2705ed38c1c26cbb8fe7acf36bbf626668e167a33335de932599219e0a235.dalf +a7c3a32f719c08e00faf03d147c0f44a26915c4034af163e5ee72fa712b6bf38 platform-independence-1.0.0-afa90d0ccc76d39acbe1156fcb6d655b19805c160258b2237fb6df900a4121ef/data/platform-independence-1.0.0.conf +23894479a9091311c460e85c714c08f6f1d272da76006cbd21661757e583331b platform-independence-1.0.0-afa90d0ccc76d39acbe1156fcb6d655b19805c160258b2237fb6df900a4121ef/platform-independence-1.0.0-afa90d0ccc76d39acbe1156fcb6d655b19805c160258b2237fb6df900a4121ef.dalf