caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
From: Gerd Stolpmann <info@gerd-stolpmann.de>
To: caml-list <caml-list@inria.fr>
Subject: [Caml-list] ignore in postfix position
Date: Tue, 9 Jan 2018 12:49:27 +0100	[thread overview]
Message-ID: <5d17ed87-e78d-f9c4-ae42-382f4c2ed353@gerd-stolpmann.de> (raw)


[-- Attachment #1.1: Type: text/plain, Size: 971 bytes --]

Hi list,

the "ignore" function behaves specially when applied to a partial function:

# ignore (fun _ -> ());;
Warning 5: this function application is partial,
maybe some arguments are missing.

This very useful warning is not emitted, however, when I switch to a
slight variation, like:

# (fun _ -> ()) |> ignore

I like this post-fix syntax more than the original because "ignore"
isn't then as distracting, but it's a pity that the warning can no
longer be generated. I am wondering whether this behavior is deeply
anchored in the inference engine or whether this is improvable.

Gerd

-- 
------------------------------------------------------------
Gerd Stolpmann, Darmstadt, Germany    gerd@gerd-stolpmann.de
My OCaml site:          http://www.camlcity.org
Contact details:        http://www.camlcity.org/contact.html
Company homepage:       http://www.gerd-stolpmann.de
------------------------------------------------------------



[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

             reply	other threads:[~2018-01-09 11:49 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-01-09 11:49 Gerd Stolpmann [this message]
2018-02-07 11:09 ` Josh Berdine

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=5d17ed87-e78d-f9c4-ae42-382f4c2ed353@gerd-stolpmann.de \
    --to=info@gerd-stolpmann.de \
    --cc=caml-list@inria.fr \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).