1
votes

First of all, does the following signature even exists (I personally think it may have errors), and, if it does, can you give me an example of matching code for it :

val f : 'a -> ('a -> 'a) -> 'b -> ('a -> ('a -> 'a) -> 'b) -> bool = <fun>
1
Yes you can write such a function. Could you give us more background? If it is a homework we should not give you a direct answer. - camlspotter
this question is quite twisted - Jackson Tale

1 Answers

2
votes

Here's these two as examples:

let f a aa b a_aa_b = (aa a, a_aa_b a aa) = (a,b) (* forced by type inference *)
let f (a:'a) (aa: 'a -> 'a) (b: 'b) (c: 'a -> ('a -> 'a) -> 'b) = true (* explicitly stated *)

I can not remember that I've seen this signature before, so I do not know which function may have hide behind it.