summaryrefslogtreecommitdiffstats
path: root/tests/240-functor.sml
blob: d18337e9e97709518e8645d82533b69a736c48ba (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
signature MagicNumber = sig
  val n : int
end

functor Exiter(N : MagicNumber) = struct
  fun exit _ = __builtin "exit" N.n
end

structure FourtyTwo = struct
  val a = 16
  val n = 42
  val z = 38
end

structure FourtyTwoExiter = Exiter(FourtyTwo)

val _ = FourtyTwoExiter.exit ()