Use recursion and list pattern matching to define a function exists with the following type: exists : (’a -> bool) -> ’a list -> bool The function should have the following behavior: for any predicate (function with boolean range) p and list l, a well-typed invocation (exists p l) should evaluate to true iff there exists some element x of l for which p x evaluates to true.
I am new to OCaml and do not know where to begin, any help would be great.
ListofOCaml. Maybe if you're using it on some dummy examples, you may have an idea to how solve your problem. - alifirat