summaryrefslogtreecommitdiff
path: root/testsuite/tests/basic-private/length.ml
blob: c36e6702733fd186e9b6fb0f01c010903ba029c0 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
(*

A testbed file for private type abbreviation definitions.

We define a Length module to implement positive integers.

*)

type t = int;;

let make x =
  if x >= 0 then x else
  failwith (Printf.sprintf "cannot build negative length : %i" x)
;;

external from : t -> int = "%identity";;