News for hackers. Stuff that matters.
Re:Dynamic typing and anti-lock brakes by kragen on Wednesday June 09, 2010 @08:45PM (#1418815)
OCaml does warn you:

    : kragen@inexorable:~/mail ; ocaml
            Objective Caml version 3.10.2

    # let divide x = function 0 -> None | y -> Some (x / y) ;;
    val divide : int -> int -> int option = <fun>
    # let printResult = function Some x -> print_int x ;;  
    Warning P: this pattern-matching is not exhaustive.
    Here is an example of a value that is not matched:
    None
    val printResult : int option -> unit = <fun>
    # printResult (divide 9 3) ;;
    3- : unit = ()
    # printResult (divide 10 0) ;;
    Exception: Match_failure ("", 1, 18).
    #

There are no comments on this comment yet.