realworldocaml / examples

All the examples in Real World OCaml
The Unlicense
376 stars 81 forks source link

mistake in guided tour? #14

Closed porterjamesj closed 10 years ago

porterjamesj commented 10 years ago

when I run this bit of code, utop gives me:

utop #  let is_inside_scene point scene =
     List.exists scene
       ~f:(fun el -> is_inside_scene_element point el)
   ;;
Error: The function applied to this argument has type 'a list -> bool
This argument cannot be applied with label ~f

However if I change the code to:

let is_inside_scene point scene =
     List.exists
       (fun el -> is_inside_scene_element point el)
       scene

everything works fine. This also seems to match the signature given in the List docs. Is this an error in the book?

porterjamesj commented 10 years ago

derp; forgot open Core.Std; sorry for noise.