Whilst revising for my programming languages exam, there are a few type inference questions for the Standard ML section, I can do most of them by doing type inference in my head, and I'm quite good at it, however there is one question that leaves me stumped.
I have to write a function of type:
('a -> ('b -> 'c)) -> ('a -> 'b) -> ('a -> 'c)
So in my head I should have a function with two arguments that are functions, f and g. Both would take an argument, x, but I cannot add that argument x into this function as it only takes two arguments, so I am left to create this function using the o operator, for pipe-lining functions.
So f takes an argument, and returns a function g takes an argument, and returns a value. Then the overall function takes a value and returns a value.
I'm not sure how I can apply f and g using only the o operator to imply those rules.
Any help would be extremely appreciated :) Thanks, Ciaran