stackwithを実装したいと思いvalue restrictionます。
私が欲しいのは、popとpushが常にまったく同じタイプについて話しているということです。
これが私のsigです。
module type MyStackSig =
sig
type 'a stack
exception EmptyStack
val create : unit -> 'a stack
val push : 'a stack -> 'a -> unit
val pop : 'a stack -> 'a
val is_empty : 'a stack -> bool
val size : 'a stack -> int
end;;
このシグニチャは十分value restrictionですか?
つまり、いつも同じタイプについて話しているのでしょうかpush?pop