How can I create list of String
in Haskell in order to use it in a function which takes the list and a word as arguments and looks for the same Char
from a word in the list of String
? Should I use Data.Map or Data.List for creating a list?
I've tried creating it like this:
dictionary :: [String]
dictonary = fromList ["wit","ass","bad","shoe","cold","pie","and","or"]
fromList
and you are done. The brackets already form a list, there's no need to do anything else. – chifromList
. You already constructed a list. – Willem Van Onsem