On Tue, Apr 8, 2008 at 10:24 AM, Jackm139 <[EMAIL PROTECTED]> wrote:
>  import List
>
>  same :: [[Char]] -> [[Char]] -> Bool
>  same [xs] [ys] = map (normalize) [[xs]] == map (normalize) [[ys]]
>
>  normalize :: [String] -> [String]
>  normalize [xs] = [(sort (nub xs))]
>

Your pattern binding [xs] and [ys] says to only match when the list
contains one element. Otherwise, you get a pattern-matching failure at
run-time. Use "normalize xs" to match a list of strings, and "same xs
ys" to match lists of lists. xs and ys will have different types with
those patterns, but you'll get it.

Justin
_______________________________________________
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe

Reply via email to