List.filter is of type (just type List.filter;; in FSI):
> List.filter;; val it : (('a -> bool) -> 'a list -> 'a list)
therefore, it takes the value 'a -> bool and leads to 'a list -> 'a list
Now you feed him
> List.head;; val it : ('b list -> 'b)
(this is another 'a , so I renamed it), and now you have:
'a -> bool ~ 'b list -> 'b
you can combine this and see:
'b ~ bool (from the right side -> )'a ~ 'b list ~ bool list (left side)
but all this together, and you will get an answer. An output like F # gives you:
'a list -> 'a list ~ ('b list) list -> ('b list) list ~ (bool list) list -> (bool list) list ~ bool list list -> bool list list
Carsten
source share