Created
September 20, 2022 17:15
-
-
Save djellemah/320b8c90d700fc37d509d4b03673c8c7 to your computer and use it in GitHub Desktop.
get environment variables in F#
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
let dict_map (dict : System.Collections.IDictionary) = | |
let values = ref (Map<'a,'b> []) | |
for obj in dict do | |
let de = obj :?> System.Collections.DictionaryEntry | |
values := Map.add (de.Key :?> 'a) (de.Value :?> 'b) !values | |
!values | |
System.Environment.GetEnvironmentVariables() |> dict_map<string,string> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment