[Haskell-cafe] testing for same characters in lists of strings

Jackm139 jackmarathon at gmail.com
Tue Apr 8 13:24:20 EDT 2008

Thanks for all the replies!
I have it working somewhat.  It works as long as there is only one string in
each list, but if the lists contain more than one string it fails. here is
what I have:

import List

same :: [[Char]] -> [[Char]] -> Bool
same [xs] [ys] = map (normalize) [[xs]] == map (normalize) [[ys]]

normalize :: [String] -> [String]
normalize [xs] = [(sort (nub xs))]

How can I make this work for lists that contain more than one string?
View this message in context: http://www.nabble.com/testing-for-same-characters-in-lists-of-strings-tp16546167p16568724.html
Sent from the Haskell - Haskell-Cafe mailing list archive at Nabble.com.

More information about the Haskell-Cafe mailing list