我可以在签名中使用签名中该类型之前和签名中的类型来专门化该类型吗?下面是一个示例:
signature A = sig
type t
type s
end我可以通过以下方式来专门化A吗?
signature B = A where type s = t listSML/NJ和Mlton都抱怨t没有绑定。
发布于 2017-07-24 19:10:21
不,这确实不能直接做到。原因是相当技术性的,在一般情况下,很难将良好的语义归因于这样的操作。
您可以通过引入另一个辅助类型来获得最接近的结果:
signature B =
sig
type t'
include A with type t = t' with type s = t' list
endhttps://stackoverflow.com/questions/45260866
复制相似问题