Skip to content

Instantly share code, notes, and snippets.

@tmcgilchrist
Last active August 29, 2015 14:21
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tmcgilchrist/4d8fc777a3baea288038 to your computer and use it in GitHub Desktop.
Save tmcgilchrist/4d8fc777a3baea288038 to your computer and use it in GitHub Desktop.
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