File: polyclass.ml

package info (click to toggle)
ocaml-visitors 20180513-1
  • links: PTS, VCS
  • area: main
  • in suites: buster
  • size: 1,640 kB
  • sloc: ml: 4,063; makefile: 120; sh: 13
file content (8 lines) | stat: -rw-r--r-- 152 bytes parent folder | download | duplicates (5)
1
2
3
4
5
6
7
8
class ['self] c = object (_ : 'self)
  method identity (x : 'a) : 'a = x
end

let b : bool =
  new c # identity true
let i : int =
  new c # identity 0