From 5683c65d715342579441ce9428e13dc73378a3f9 Mon Sep 17 00:00:00 2001 From: Stuart Hinson Date: Fri, 20 Sep 2024 07:16:53 -0400 Subject: [PATCH 1/2] Dict.update works with a Result --- examples/BasicDict/BasicDict.roc | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/examples/BasicDict/BasicDict.roc b/examples/BasicDict/BasicDict.roc index 0810d2f..897112a 100644 --- a/examples/BasicDict/BasicDict.roc +++ b/examples/BasicDict/BasicDict.roc @@ -48,13 +48,13 @@ expect # We need to account for the case when a key (=fruit) is not in the Dict. # So we need a function like this: - addFruit : [Present U64, Missing] -> [Present U64, Missing] + addFruit : Result U64 [Missing] -> Result U64 [Missing] addFruit = \valueTag -> when valueTag is # If the fruit is not in the dict (=missing), we set the count to 1 - Missing -> Present 1 + Err Missing -> Ok 1 # If the fruit is in the dict (=present), we increase the count - Present count -> Present (count + 1) + Ok count -> Ok (count + 1) Dict.get updatedDict "Apple" == (Ok 4) From a28758adeff123513b8d935796864296b31cc817 Mon Sep 17 00:00:00 2001 From: Anton-4 <17049058+Anton-4@users.noreply.github.com> Date: Thu, 26 Sep 2024 14:53:21 +0200 Subject: [PATCH 2/2] Update flake.lock --- flake.lock | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/flake.lock b/flake.lock index e122f82..b73f5c2 100644 --- a/flake.lock +++ b/flake.lock @@ -21,11 +21,11 @@ "systems": "systems" }, "locked": { - "lastModified": 1710146030, - "narHash": "sha256-SZ5L6eA7HJ/nmkzGG7/ISclqe6oZdOZTNoesiInkXPQ=", + "lastModified": 1726560853, + "narHash": "sha256-X6rJYSESBVr3hBoH0WbKE5KvhPU5bloyZ2L4K60/fPQ=", "owner": "numtide", "repo": "flake-utils", - "rev": "b1d9ab70662946ef0850d488da1c9019f3a9752a", + "rev": "c1dfcf08411b08f6b8615f7d8971a2bfa81d5e8a", "type": "github" }, "original": { @@ -102,11 +102,11 @@ "rust-overlay": "rust-overlay" }, "locked": { - "lastModified": 1725284455, - "narHash": "sha256-s/CF5Ol4mjURs+4S7fBZWc6dOClbyetuIFymflWN6d0=", + "lastModified": 1727352598, + "narHash": "sha256-YMAfnjqPNlKHKDFp1FAoVKqN5a3okUztdwHZ5BLtX3Q=", "owner": "roc-lang", "repo": "roc", - "rev": "2f916882244a663f7b363d3ff7097e190fca1841", + "rev": "2d03697acb9ac02962c295de87d0e7a7b76c34ce", "type": "github" }, "original": { @@ -158,11 +158,11 @@ ] }, "locked": { - "lastModified": 1725243956, - "narHash": "sha256-0A5ZP8uDCyBdYUzayZfy6JFdTefP79oZVAjyqA/yuSI=", + "lastModified": 1727317727, + "narHash": "sha256-yGYahXzCquyYEgf5GTtvtaN5hXbw20Ok2+o8uVxoaFs=", "owner": "oxalica", "repo": "rust-overlay", - "rev": "a10c8092d5f82622be79ed4dd12289f72011f850", + "rev": "a3d832f389606d7dc61a45b244c72ea472d1fcd4", "type": "github" }, "original": {