I have the following code snippet:
type 'a f = 'a -> 'a
type foo = { f: 'a. 'a f }
let seqF : 'a. 'a f -> 'a f -> 'a f =
fun f1 f2 ->
fun a ->
let a = f1 a in
f2 a
let seq foo1 foo2 =
{ f = seqF foo1.f foo2.f }
and get this error at compile time:
Error: This field value has type 'b f which is less general than 'a. 'a f
Is there a way for me to keep the same level of polymorphism after having sequenced the functions.