할 일에 대해 다른 행동이 필요합니다! 그리고하자! 내 사용자 지정 계산 식에서.다른 방법으로 do를 구현할 수 있습니까? 그리고하자! 계산식에?
type FooBuilder() = class
member b.Bind<'T, 'U>(x:'T, f:unit->'U):'U = failwith "not implemented" //do! implementation
member b.Bind<'T, 'U>(x:'T, f:'T->'U):'U = failwith "not implemented" //let! implementation
member b.Return<'T>(x:'T):'T = failwith "not implemented" //return implementation
end
let foo = FooBuilder()
let x = foo {
do!()
return 2
}
을하지만 컴파일러는 나에게 오류를 제공합니다 :
나는 다음과 같은 방법으로이를 달성하려고
A unique overload for method 'Bind' could not be determined based on type information prior to this program point. The available overloads are shown below (or in the Error List window). A type annotation may be needed.
할의 다른 구현을 할 수있는 방법이 있나요! 그리고하자!?
매우 자세한 설명을 주셔서 감사합니다. –