I'm sorry, it took me a dinner out to see, this was unnecessarily complicated. :) The delete functions perfectly fits a right fold. And if the words aren't of equal length, they are not anagrams.
-- deletes the first occurance of element x from a listdelete_[]=[]deletex(y:ys)=ifx==ythenyselsey:deletexys-- deletes all elements of the second list from the firstwithout::Eqa=>[a]->[a]->[a]without=foldrdelete-- are there any remaining characters? isAnagramword1word2=null$word1`without`word2
delete could also be imported from Data.List
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
I'm sorry, it took me a dinner out to see, this was unnecessarily complicated. :) The delete functions perfectly fits a right fold. And if the words aren't of equal length, they are not anagrams.
delete could also be imported from Data.List