Haskell has a notion of “generic functions” that has some apparent similarity with common lisp—having neither experience with Haskell nor with common lisp, I might be very approximative here. This means that one can define a generic
to_string facility to define a string representation for all types. Of course, the facility has to be defined in the special cases but there is a
to_string function whose signature is
α → string.
Are types erased in Haskell, as they are in OCaml? If yes, how does the implementation of “generic functions” in Haskell differ from that of common lisp, where types are dynamic, and thus not erased?
I understand that implementation details are compiler specific, but there is probably provisions common to many or all implementations.