How to use infix operator from a SML module?
问题 I have the following to code and I use SML/NJ: signature STACK= sig type 'a Stack val empty :'a Stack val isEmpty : 'a Stack -> bool val cons : 'a*'a Stack -> 'a Stack val head : 'a Stack ->'a val tail : 'a Stack -> 'a Stack val ++ : 'a Stack * 'a Stack -> 'a Stack end structure List : STACK = struct infix 9 ++ type 'a Stack = 'a list val empty = [] fun isEmpty s = null s fun cons (x,s) = x::s fun head s = hd s fun tail s = tl s fun xs ++ ys = if isEmpty xs then ys else cons(head xs, tail xs