From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail3-relais-sop.national.inria.fr (mail3-relais-sop.national.inria.fr [192.134.164.104]) by sympa.inria.fr (Postfix) with ESMTPS id 3F81B7EEBF for ; Mon, 29 Jun 2015 02:12:29 +0200 (CEST) Received-SPF: None (mail3-smtp-sop.national.inria.fr: no sender authenticity information available from domain of philippe.wang.lists@gmail.com) identity=pra; client-ip=209.85.160.179; receiver=mail3-smtp-sop.national.inria.fr; envelope-from="philippe.wang.lists@gmail.com"; x-sender="philippe.wang.lists@gmail.com"; x-conformance=sidf_compatible Received-SPF: Pass (mail3-smtp-sop.national.inria.fr: domain of philippe.wang.lists@gmail.com designates 209.85.160.179 as permitted sender) identity=mailfrom; client-ip=209.85.160.179; receiver=mail3-smtp-sop.national.inria.fr; envelope-from="philippe.wang.lists@gmail.com"; x-sender="philippe.wang.lists@gmail.com"; x-conformance=sidf_compatible; x-record-type="v=spf1" Received-SPF: None (mail3-smtp-sop.national.inria.fr: no sender authenticity information available from domain of postmaster@mail-yk0-f179.google.com) identity=helo; client-ip=209.85.160.179; receiver=mail3-smtp-sop.national.inria.fr; envelope-from="philippe.wang.lists@gmail.com"; x-sender="postmaster@mail-yk0-f179.google.com"; x-conformance=sidf_compatible X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: A0ATAgABjJBVm7OgVdFbhEQGgxjDEgdMAQEBAQEBEgEBAQEBBgsLCSEuhCMBAQQSEQQZATgBAwwBBQULDwImAgIiEgEFARwGNYd4AxKjCz4xiz+EZIpxJw2FdCYBBQ6BE4oph3WBQwEElARKiwuWcRIjgRUXSYNCPDGCSAEBAQ X-IPAS-Result: A0ATAgABjJBVm7OgVdFbhEQGgxjDEgdMAQEBAQEBEgEBAQEBBgsLCSEuhCMBAQQSEQQZATgBAwwBBQULDwImAgIiEgEFARwGNYd4AxKjCz4xiz+EZIpxJw2FdCYBBQ6BE4oph3WBQwEElARKiwuWcRIjgRUXSYNCPDGCSAEBAQ X-IronPort-AV: E=Sophos;i="5.13,695,1427752800"; d="scan'208";a="138183114" Received: from mail-yk0-f179.google.com ([209.85.160.179]) by mail3-smtp-sop.national.inria.fr with ESMTP/TLS/RC4-SHA; 29 Jun 2015 02:12:28 +0200 Received: by ykdy1 with SMTP id y1so101668255ykd.2 for ; Sun, 28 Jun 2015 17:12:26 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:date:message-id:subject :from:to:cc:content-type; bh=7Zd7FouZyY1CvCruslDlYjl5yL6mkGtM0fR7UbKNYS8=; b=gHM4TTd+s8TtHHy0GoLDo9iqndWj1j72Ov+R+gBf2H45r6SgcCkV9dW0mRzpi9kkop j2+Es7p0YPTwJxzZ8V9h/kuL7nZ/v41upo2HIAixeF0wItjFep7MhWxi/ESokF3KVmT7 Wn2NRuAzGiHaQDIiYfkXsWztqsvxxKMVlmUOu9+h6ygUtxWZX03ZNXDE9MDd5dASy7BG pFSGjYRvk98aiuv/bzdj0txGraRwSyCjMqXW5oucw1WEKr+9SYYEq06QpVmdkLENQreB alSX9lSF9/coNIC65Ab9U3Lxf2g6UqjTxIOSucLrLLJAKyOZ6/726NIsEwR7D2yRkNzp Paqg== MIME-Version: 1.0 X-Received: by 10.13.213.3 with SMTP id x3mr15788035ywd.156.1435536746790; Sun, 28 Jun 2015 17:12:26 -0700 (PDT) Sender: philippe.wang.lists@gmail.com Received: by 10.37.203.135 with HTTP; Sun, 28 Jun 2015 17:12:26 -0700 (PDT) In-Reply-To: References: Date: Mon, 29 Jun 2015 02:12:26 +0200 X-Google-Sender-Auth: rw-TW8_LFNbPk6KXFF1R8w0RhAs Message-ID: From: Philippe Wang To: Alan Schmitt Cc: OCaml Mailing List Content-Type: text/plain; charset=UTF-8 Subject: Re: [Caml-list] use of ";;" when teaching Ocaml Apart from the ";;" thing, if you teach to beginners (well, actually it could help experimented programmers as well), I suggest to make function signatures explicit, meaning: write let f (x : int) : int = x + 1 instead of let f x = x + 1 or let rec map (f : 'a -> 'b) (l : 'a list) : 'b list = ... instead of let rec map f l = ... for two main reasons: 1. it helps if there are bugs! Bugs are easier to find when we tell the type checker what we expect. 2. it helps the students, because type inference is not that helpful. But, I wouldn't force students to write those type annotations, except perhaps the first few weeks... Note that I would totally avoid this style: let rec map : ('a -> 'b) -> 'a list -> 'b list = fun f l -> ... (not that I don't like it, but I believe the other one is a lot more efficient, pedagogically speaking) Cheers, Philippe Wang