我正在尝试实现一个merge
与抽象类型一起使用的通用过程,但它总是失败❰merge❱ expects a record of handlers
,即使调用者传递了一个记录类型:
let Keys
: Type
= < A | B >
let ConfigType
: Type
= { A : Text, B : Text }
let Renderer =
λ(configType : Type)
→ λ(config : configType)
→ λ(value : Keys)
→ merge config value
in Renderer ConfigType { A = "A", B = "B" } Keys.A
是否可以指示 configType 将是一个记录类型,以便可以解释这个通用方法?