From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Original-To: caml-list@sympa.inria.fr Delivered-To: caml-list@sympa.inria.fr 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 1799B7F7C2 for ; Thu, 6 Feb 2014 18:18:07 +0100 (CET) Received-SPF: None (mail3-smtp-sop.national.inria.fr: no sender authenticity information available from domain of lukstafi@gmail.com) identity=pra; client-ip=74.125.82.178; receiver=mail3-smtp-sop.national.inria.fr; envelope-from="lukstafi@gmail.com"; x-sender="lukstafi@gmail.com"; x-conformance=sidf_compatible Received-SPF: Pass (mail3-smtp-sop.national.inria.fr: domain of lukstafi@gmail.com designates 74.125.82.178 as permitted sender) identity=mailfrom; client-ip=74.125.82.178; receiver=mail3-smtp-sop.national.inria.fr; envelope-from="lukstafi@gmail.com"; x-sender="lukstafi@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-we0-f178.google.com) identity=helo; client-ip=74.125.82.178; receiver=mail3-smtp-sop.national.inria.fr; envelope-from="lukstafi@gmail.com"; x-sender="postmaster@mail-we0-f178.google.com"; x-conformance=sidf_compatible X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AngCAKzC81JKfVKylWdsb2JhbABZg0RXrmaHN4hUgQMIFg4BAQEBBw0JCRIqghwJAQEEAUABGx0BAwELBgUDAQc7IQEBEQEFARwGE4dwAQMJCA2gPoxegwmTXgoZJw1kiAYRAQUMjFiCFgeEOASWP4FsgTKLLINWGCmEWjs X-IPAS-Result: AngCAKzC81JKfVKylWdsb2JhbABZg0RXrmaHN4hUgQMIFg4BAQEBBw0JCRIqghwJAQEEAUABGx0BAwELBgUDAQc7IQEBEQEFARwGE4dwAQMJCA2gPoxegwmTXgoZJw1kiAYRAQUMjFiCFgeEOASWP4FsgTKLLINWGCmEWjs X-IronPort-AV: E=Sophos;i="4.95,793,1384297200"; d="scan'208";a="48068006" Received: from mail-we0-f178.google.com ([74.125.82.178]) by mail3-smtp-sop.national.inria.fr with ESMTP/TLS/RC4-SHA; 06 Feb 2014 18:18:06 +0100 Received: by mail-we0-f178.google.com with SMTP id q59so1533528wes.9 for ; Thu, 06 Feb 2014 09:18:06 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc:content-type; bh=8GWKvIGprSM/xEaO2PKUmmm/HlZxVVQy6k+uhNGfxuQ=; b=Rrn27/qC5pOb1pmkvhhmEQN5DUDs7ylI7suHSBHDaoBBUK6lwRiKf4vsTqovT9Rexl 7xJxvlFCIa79IoXlVvPOw0uiniGWzel2P3BoYLevf+k09eBl3MAu4wOQaw9VdFdgRn2V S+Ou1inwIyajkM7a+h+m61U02QksR10GuHzQ89z3gqjtjOEMwrDs997crjyEhTn1q5Z3 c2MBoBpm1pwQnbUwGlczk4H7PRQL1NjSRlDHFFakJRbfXjhyTmubCiWfK1K7+yl7SRTB QFtQ9tr1nQRCQ8IUkU26idg8XVrn7N6EB98TDjWqxIpEWSENiIwAYHSdJ0mF9n8A2xVB h8Rg== X-Received: by 10.180.211.239 with SMTP id nf15mr280457wic.9.1391707086099; Thu, 06 Feb 2014 09:18:06 -0800 (PST) MIME-Version: 1.0 Received: by 10.227.49.71 with HTTP; Thu, 6 Feb 2014 09:17:46 -0800 (PST) In-Reply-To: <52F3C3A1.8060500@gmail.com> References: <52F3C3A1.8060500@gmail.com> From: Lukasz Stafiniak Date: Thu, 6 Feb 2014 18:17:46 +0100 Message-ID: To: =?ISO-8859-1?Q?M=E1rio_Jos=E9_Parreira_Pereira?= Cc: "caml-list@inria.fr" Content-Type: multipart/alternative; boundary=001a11c264ec7f98db04f1c00e20 Subject: Re: [Caml-list] Type of term --001a11c264ec7f98db04f1c00e20 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable On Thu, Feb 6, 2014 at 6:17 PM, M=E1rio Jos=E9 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) =3D 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. --001a11c264ec7f98db04f1c00e20 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable
On T= hu, Feb 6, 2014 at 6:17 PM, M=E1rio Jos=E9 Parreira Pereira <marioj= ppereira@gmail.com> wrote:
Hi all,

Is there any way to get the type of (part of) a program? Something like:
=A0 =A0type_of(M) =3D sigma
computing the type of program M as sigma so I can pattern match it.

No. However, if you really need this rather th= an being confused by programming patterns from Java / C# / C++, you should = learn about GADTs.=A0http://caml.inria.fr/pub/docs/manual-ocaml-400/ma= nual021.html#toc85=A0

Cheers.
--001a11c264ec7f98db04f1c00e20--