Re:Runtime Support for Multicore Haskell: A Retrospective
by atombender on Tuesday December 17, 2019 @02:59PM
(#21818048)
Yes, you need to add new functions. You cannot redefine "+" to work a custom vector type.
Similarly, you cannot have a "print" function that works for all sorts of types. OCaml has print_string, print_int, and so on.
OCaml does have parametric polymorphism ("generics"). You can write functions which support generic parameters. And you can use modules as "functors" to sort of package up types in a similar way as Haskell typeclasses (e.g. see [1]).
Similarly, you cannot have a "print" function that works for all sorts of types. OCaml has print_string, print_int, and so on.
OCaml does have parametric polymorphism ("generics"). You can write functions which support generic parameters. And you can use modules as "functors" to sort of package up types in a similar way as Haskell typeclasses (e.g. see [1]).
[1] https://stackoverflow.com/questions/14934242/whats-the-close...