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 574E87FDEE for ; Thu, 2 Jun 2016 21:50:48 +0200 (CEST) IronPort-PHdr: 9a23:6OhzYR8FcB7Jz/9uRHKM819IXTAuvvDOBiVQ1KB80+0cTK2v8tzYMVDF4r011RmSDdSdtqMP0rGK+4nbGkU+or+5+EgYd5JNUxJXwe43pCcHRPC/NEvgMfTxZDY7FskRHHVs/nW8LFQHUJ2mPw6anHS+4HYoFwnlMkItf6KuSt+U0pX8jrvus7ToICx2xxOFKYtoKxu3qQiD/uI3uqBFbpgL9x3Sv3FTcP5Xz247bXianhL7+9vitMU7q3cYk7sb+sVBSaT3ebgjBfwdVWx+cjMD39DwrRTIUSeI43IdVC1WzksJUED560TVV53rsyb+/tF22CSAMNe+Gb89Uy6j4qMtUxTohT0KLRY29WjWjop7i6cN8zy7oBkq8ofOZ4fdEft4ZaDMNYcLQGtHRcVAfy5IBI6nc5ECAvZHNuFd+dqu72ASpAezUFH/TNjkzSVF0zqrhKA= Authentication-Results: mail3-smtp-sop.national.inria.fr; spf=None smtp.pra=yminsky@janestreet.com; spf=Pass smtp.mailfrom=yminsky@janestreet.com; spf=None smtp.helo=postmaster@mxout3.mail.janestreet.com Received-SPF: None (mail3-smtp-sop.national.inria.fr: no sender authenticity information available from domain of yminsky@janestreet.com) identity=pra; client-ip=38.105.200.229; receiver=mail3-smtp-sop.national.inria.fr; envelope-from="yminsky@janestreet.com"; x-sender="yminsky@janestreet.com"; x-conformance=sidf_compatible Received-SPF: Pass (mail3-smtp-sop.national.inria.fr: domain of yminsky@janestreet.com designates 38.105.200.229 as permitted sender) identity=mailfrom; client-ip=38.105.200.229; receiver=mail3-smtp-sop.national.inria.fr; envelope-from="yminsky@janestreet.com"; x-sender="yminsky@janestreet.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@mxout3.mail.janestreet.com) identity=helo; client-ip=38.105.200.229; receiver=mail3-smtp-sop.national.inria.fr; envelope-from="yminsky@janestreet.com"; x-sender="postmaster@mxout3.mail.janestreet.com"; x-conformance=sidf_compatible X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: A0AUAwC6jVBXduXIaSZehBB9BqlHhQyLb4F5IoVwAoEsBzoSAQEBAQEBAQERAQoWCVCCMIIWAQEEEhEdAQEsCwEPCwsNAgIJHQICIQESAQUBChIGEwgKCQeHcwMXAwujSIExPjGKVGeEQQEBBYg7AwqEHwEBAQEBAQEBAgEBAQEBAQEBFwgQcYUmhE2CQ4R+glkBhkUMkTczhgCGJ4F5gWlOhy2FOIdkhikSHoEPJAGCKYIQUop8AQEB X-IPAS-Result: A0AUAwC6jVBXduXIaSZehBB9BqlHhQyLb4F5IoVwAoEsBzoSAQEBAQEBAQERAQoWCVCCMIIWAQEEEhEdAQEsCwEPCwsNAgIJHQICIQESAQUBChIGEwgKCQeHcwMXAwujSIExPjGKVGeEQQEBBYg7AwqEHwEBAQEBAQEBAgEBAQEBAQEBFwgQcYUmhE2CQ4R+glkBhkUMkTczhgCGJ4F5gWlOhy2FOIdkhikSHoEPJAGCKYIQUop8AQEB X-IronPort-AV: E=Sophos;i="5.26,407,1459807200"; d="scan'208";a="179946813" Received: from mxout3.mail.janestreet.com ([38.105.200.229]) by mail3-smtp-sop.national.inria.fr with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 02 Jun 2016 21:50:28 +0200 Received: from tot-qpr-mailcore1.delacy.com ([172.27.56.68] helo=tot-qpr-mailcore1) by mxout3.mail.janestreet.com with esmtps (TLSv1:DHE-RSA-AES256-SHA:256) (Exim 4.82) (envelope-from ) id 1b8YdP-0006uv-FQ for caml-list@inria.fr; Thu, 02 Jun 2016 15:50:27 -0400 X-JS-Flow: external Received: by tot-qpr-mailcore1 with JS-mailcore (0.1) (envelope-from ) id BXUI4D-AAACoJ-Nb; 2016-06-02 15:50:27.430513-04:00 Received: from mail-vk0-f71.google.com ([209.85.213.71]) by mxgoog1.mail.janestreet.com with esmtps (UNKNOWN:AES128-GCM-SHA256:128) (Exim 4.72) (envelope-from ) id 1b8YdP-0002Tt-BK for caml-list@inria.fr; Thu, 02 Jun 2016 15:50:27 -0400 Received: by mail-vk0-f71.google.com with SMTP id t7so153445064vkf.2 for ; Thu, 02 Jun 2016 12:50:27 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=janestreet.com; s=google; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc; bh=xaeMWjj4EO2deeD3sS/F+n+W+VrcFrjJjtL1cuuwKWA=; b=C2brBFcf0qZFUqAkjyqvUftPmatO3TcAKTwMAEhOpnjMjS9ZTHslFqUUUo3CsGAoKU BBkSNB2NvBhYQAQgk3YYCaohS0REd8mm+FT6B6kzmGLFMtuuZlcuLJnGksbbzAAlzWcN aDnbvqDpGZBiqrI3sJlmq7xN26CyOpAlwvljQ= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:date :message-id:subject:from:to:cc; bh=xaeMWjj4EO2deeD3sS/F+n+W+VrcFrjJjtL1cuuwKWA=; b=OaQLJYONA9VuDTamA5oeAhdvu5aC/QJpqEr42TIpzdDOV0vYMMod4ExsEkPoQEJcRq FZ+iZEGJS3PHZwLM5zrYiBTh9e0RKbJUNHM0PG+cb0vzvABLAljFWzUa9s8puUMiBJLD 3gkAwU7IAyFRDgOGY3zPDm6Ynu67IaB+UGjRQsnlH2gCBzNeYdX93RINziTzBEGnkyKs TQcnUO/qB1YDm6mQlN78tcozF3ZhZW9dScV1f2jfeCTU4f24TQJKc6gqebYZhf/tLeUQ C9mngLZH+7MfutcZwOYihHmEstmuTj8FypW4UaqTjbzzYEcNOv0U7jCZkm2lPZ4iEEaK cGJA== X-Gm-Message-State: ALyK8tKIWFmEIyYcbjJ10MuxTIkAUZEbnzX73UJvmule4jDwhukONsrG2FadcJJ7jvF2zmoKREXE5GwisyR8CGhOyWTm9bBsA1Go1hjxamYQkozhKXIq7cSiSaiEVUWG+SZtElWujhw3t7z/QwDJsKY+4SpJSv7VrM9w/QqhtD8= X-Received: by 10.129.86.139 with SMTP id k133mr7023359ywb.96.1464897027045; Thu, 02 Jun 2016 12:50:27 -0700 (PDT) MIME-Version: 1.0 X-Received: by 10.129.86.139 with SMTP id k133mr7023351ywb.96.1464897026837; Thu, 02 Jun 2016 12:50:26 -0700 (PDT) Received: by 10.37.217.75 with HTTP; Thu, 2 Jun 2016 12:50:26 -0700 (PDT) In-Reply-To: References: Date: Thu, 2 Jun 2016 15:50:26 -0400 Message-ID: From:Yaron Minsky To:Gabriel Scherer Cc:"Carette, Jacques" , "caml-list@inria.fr" Content-Type: text/plain; charset=UTF-8 X-JS-Processed-by: mailcore Subject: Re: [Caml-list] Option to fully expand types in error messages? Have you tired using the short-paths flag? This doesn't completely expand the types, but it does a good job of picking the "right" type: the heuristic is (roughly) to pick the type alias with the fewest number of dots, and amongst those, pick the one defined most recently. It tends to make type errors quite a lot better, but I admit I'm not sure it would help in the case you describe. y On Thu, Jun 2, 2016 at 3:44 PM, Gabriel Scherer wrote: > This does not exist to my knowledge. I think that in a bug report, it > would be interesting if you could include some reproducible code and > an example of the error messages that are not readable. I would expect > that a better solution exists, that expands enough of the paths to > clarify the error, without expanding constraints that are not related > to the type error. > > One thing you might try to play with is the -short-paths options, that > tries to print shorter types (but is also possibly less predictable); > it can expand more if that can result in showing a shorter path, so > for types that are synonyms of existing paths plus constraints it > might result in constraint expansion. (I suspect it will not solve > your problem, but that it may be of interest to other people with > unclear type error messages.) > > On Thu, Jun 2, 2016 at 3:18 PM, Carette, Jacques wrote: >> In writing some code which uses a lot of monads with underlying types which >> use constraints, even simple errors can lead to extremely hard to read error >> messages. The main reason is that the two types given in errors are >> partially expanded, to different levels. This frequently means that the >> part where the type checker detects a mismatch is (extremely) opaque to >> human eyes. >> >> In that case, it would actually be preferable to fully expand the types. >> Yes, that will produce wallpaper. But at least the mismatch should be >> considerably easier to catch. >> >> Does this already exist, or should I submit a feature request? >> >> Jacques > > -- > Caml-list mailing list. Subscription management and archives: > https://sympa.inria.fr/sympa/arc/caml-list > Beginner's list: http://groups.yahoo.com/group/ocaml_beginners > Bug reports: http://caml.inria.fr/bin/caml-bugs