> To understand how Haskell makes these container types hard, compare the API for Data.Map to the API for java.util.Map[2]. You can ignore Java's rather pathetic facilities for FP entirely because you don't need them.
> The Haskell version has functions to do lookup, union, intersection and various predicates. In Java, they're trivial to implement with a loop.
I don't get it. I don't see how you do lookup with a loop at all. As for union and intersection, are you sure you write them in Java with a loop? The way that's obvious to me would be quadratic. Is there a better way?
> The Haskell version has functions to do lookup, union, intersection and various predicates. In Java, they're trivial to implement with a loop.
I don't get it. I don't see how you do lookup with a loop at all. As for union and intersection, are you sure you write them in Java with a loop? The way that's obvious to me would be quadratic. Is there a better way?