An anagram is a rearrangement of letters to form a new word. Given a word and a list of candidates, select the sublist of anagrams of the given word.
"listen" and a list of candidates like
"enlists" "google" "inlets" "banana" the program should return a list containing
To complete this exercise you need to implement the function
that takes a word and a group of words, returning the ones that are
anagrams of the given word.
If it is your first time solving this exercise, it is recommended that you stick to the provided signature:
anagramsFor :: String -> [String] -> [String]
Later, it may be a good idea to revisit this problem and play with other data types and libraries:
Text, from package text.
Set, from package containers.
MultiSet, from package multiset
The test suite was intentionally designed to accept almost any type signature that makes sense, so you are encouraged to find the one you think is the best.
Sign up to Exercism to learn and master Haskell with 100 exercises, and real human mentoring, all for free.