
9 Oct
2008
9 Oct
'08
8:41 a.m.
Bertram Felgenhauer
Bart Massey wrote: That's nubWith :: (a -> b -> Maybe b) -> b -> [a] -> [a], right?
Yep.
All in all I must say that the design space for nub functions is surprisingly big. One aspect that hasn't been mentioned yet is special handling for finite types.
We actually did talk about it a little earlier in this sprawling thread. But nubWith should handle it nicely if folks care.
nubBool = take 2 . nub
nub works fine on Bool, but you probably want nubWith for Char. Thanks much for the comments! Bart Massey bart <at> cs.pdx.edu