What I would like to do is have a function that I can repeatedly pass a transformation function into and receive a combined transformation, the transformation function would be of the form 'a -> 'b
i.e. rather than compose a fixed workflow like this:
let input = async{ let! transform1 = transformAB input
let! transform2 = transformBC transform1
let! transform3 = transformCD transform2
return! transform3 }
I would like to be able to do this:
let combined = buildTransform(transform1).Next(transform2).Next(transform3)
So then I could simply call combined input to get the results of the workflow.
Would this be possible without hitting the value restriction, or the compiler constraining all the transformers to be the same type?