Bidello/src/Map.fs
bparodi@lezzo.org 365cbdf137 tests
2024-11-06 15:32:32 +01:00

10 lines
279 B
Forth

namespace Pentole
module Map =
let find (key: 'key) (map: Map<'key, 'value>) =
match Map.tryFind key map with
| Some v -> Ok v
| None -> Error $"Can't find key {key}"
let values (map: Map<'k, 'v>): 'v list =
Map.values map |> List.ofSeq