13897Re: "ocaml_beginners":: probably stupid question of the day
- Jun 9, 2013On Wed, Jun 5, 2013 at 9:04 AM, Francois Berenger <berenger@...> wrote:
> **When you apply the functor, you need to specialize the type of elements
> Why do we have to provide the type + the comparison
> fonction when we create a set?
> Isn't the comparison function the only parameter
> that should be needed to "specialize" a set?
held in a set. That's because you need to somehow connect the type of the
elements in the set with the type accepted by your comparison function. The
only other option would be that the comparison function is polymorphic with
respect to elements it compares, which would be rather useless.
[Non-text portions of this message have been removed]
- << Previous post in topic