code.ml
- let foldf1 =
- let foldf data accum = accum + data in
- 0, foldf
- let foldf2 =
- let foldf data accum = data :: accum in
- [], foldf
- let () =
- let foldpairs = [foldf1; foldf2] in
- let values, foldfs = List.split foldpairs in
- let results = List.fold_left
- (fun accum data ->
- List.map2
- (fun f a -> f data a)
- foldfs
- accum)
- values
- [1; 2; 3; 4]
- in ()
error.txt
- File "pplacer_src/polymorphism_test.ml", line 10, characters 27-33:
- Error: This expression has type 'a list * ('b -> 'b list -> 'b list)
- but an expression was expected of type int * (int -> int -> int)