Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Charles OCaml
class Show a where
    show :: a -> String

instance Show Int where
    show = ... -- provided by default

show 1 
module type SHOW = sig
  type t
  val show : t -> string
end

module ShowInt = struct
  type t = int
  let show = string_of_int
end

ShowInt.show 1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.