caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
From: Lukasz Stafiniak <lukstafi@gmail.com>
To: "Mário José Parreira Pereira" <mariojppereira@gmail.com>
Cc: "caml-list@inria.fr" <caml-list@inria.fr>
Subject: Re: [Caml-list] Type of term
Date: Thu, 6 Feb 2014 18:17:46 +0100	[thread overview]
Message-ID: <CAJMfKEW5B-k8p3-LPhASetv+RqjFPFiU9yG=3U9UeVdxD-2YRQ@mail.gmail.com> (raw)
In-Reply-To: <52F3C3A1.8060500@gmail.com>

[-- Attachment #1: Type: text/plain, Size: 512 bytes --]

On Thu, Feb 6, 2014 at 6:17 PM, Mário José Parreira Pereira <
mariojppereira@gmail.com> wrote:

> Hi all,
>
> Is there any way to get the type of (part of) a program? Something like:
>    type_of(M) = sigma
> computing the type of program M as sigma so I can pattern match it.
>

No. However, if you really need this rather than being confused by
programming patterns from Java / C# / C++, you should learn about GADTs.
http://caml.inria.fr/pub/docs/manual-ocaml-400/manual021.html#toc85

Cheers.

[-- Attachment #2: Type: text/html, Size: 1001 bytes --]

  reply	other threads:[~2014-02-06 17:18 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-02-06 17:17 Mário José Parreira Pereira
2014-02-06 17:17 ` Lukasz Stafiniak [this message]
2014-02-06 17:32   ` Mário José Parreira Pereira
2014-02-06 17:45     ` Raphaël Proust
2014-02-06 19:01     ` Gabriel Scherer
2014-02-06 19:05       ` Simon Cruanes
2014-02-10  8:58     ` Goswin von Brederlow
2014-02-06 17:23 ` Lukasz Stafiniak

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='CAJMfKEW5B-k8p3-LPhASetv+RqjFPFiU9yG=3U9UeVdxD-2YRQ@mail.gmail.com' \
    --to=lukstafi@gmail.com \
    --cc=caml-list@inria.fr \
    --cc=mariojppereira@gmail.com \
    /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).