-
-
Save Wilfred/9fa93451a5a33ebbb3cf4e841781fcef to your computer and use it in GitHub Desktop.
inserting a key and value in a map
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
open Core_kernel | |
let foo (s : string): int Core_kernel.String.Map.t = | |
let m = String.Map.empty in | |
let m = String.Map.add m ~key:s ~data:1 in | |
m | |
(* | |
This expression has type | |
int Core_kernel.String.Map.t Base__.Map_intf.Or_duplicate.t | |
but an expression was expected of type | |
int Core_kernel.String.Map.t = | |
(Core_kernel.String.Map.Key.t, int, | |
Core_kernel.String.Map.Key.comparator_witness) | |
Base__Map.t | |
*) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment