Recently, I have discussed this issue on Slack as well, but I could not find a solution.
I am trying to iterate through a dictionary elements and compare them to another dictionary and check if one of them or all or nothing exist in the second dictionary, and then count all the occurrences.
Dict.fromList [("and",1),("fox",1),("stars",1),("the",2)] when compared to another dictionary of
Dict.fromList [("and",1),("fox",1),("now",1),("way",2)] then the answer should be 2 , since there are only two same elements.
What I have tried is the
member function of Dict and is giving me the result as string just to know if that string is a member of that dicitonary.
module Main exposing (main) import Dict exposing (..) import Html exposing (..) main = Html.text checkIf checkIf = if Dict.member "fox" <| Dict.fromList [("fox",1),("bee",1)] then "Yes" else "No"
This is Simply checking for the mentioned element to check if it is in the dictionary. there is no counting yet. I want to see if it is possible to use all the elements of one dictionary instead of only
"fox" and compare the elements of this dictionary to another dictionary.
I will be here if you need more details.