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 A4F887FDEE for ; Fri, 3 Jun 2016 01:59:19 +0200 (CEST) IronPort-PHdr: 9a23:vNBpWBaZtUnu8TEFfg+jygT/LSx+4OfEezUN459isYplN5qZpcW6bnLW6fgltlLVR4KTs6sC0LqH9f65EjRaqb+681k8M7V0HycfjssXmwFySOWkMmbcaMDQUiohAc5ZX0Vk9XzoeWJcGcL5ekGA6ibqtW1aJBzzOEJPK/jvHcaK1oLsh7H0pcSYO18ArQH+SI0xBS3+lR/WuMgSjNkqAYcK4TyNnEF1ff9Lz3hjP1OZkkW0zM6x+Jl+73YY4Kp5pIZoGJ/3dKUgTLFeEC9ucyVsvJWq5lH/Sl6t73AFT2gN2jFBGQXZ8ByyCpz4qCbmqudV3SKfNNbqQKpyUj30vIlxTxq9qi4MLiM06yn4g9Zqja1GrVr1qBVl2Y/bfYy9MfNifuXbdNwdVGMEQ4BYXGpDGtXvPMM0E+MdMLMA/MHGrFwUoE77XFH0CQ== Authentication-Results: mail3-smtp-sop.national.inria.fr; spf=None smtp.pra=garrigue@math.nagoya-u.ac.jp; spf=None smtp.mailfrom=garrigue@math.nagoya-u.ac.jp; spf=None smtp.helo=postmaster@mailhost.math.nagoya-u.ac.jp Received-SPF: None (mail3-smtp-sop.national.inria.fr: no sender authenticity information available from domain of garrigue@math.nagoya-u.ac.jp) identity=pra; client-ip=133.6.130.5; receiver=mail3-smtp-sop.national.inria.fr; envelope-from="garrigue@math.nagoya-u.ac.jp"; x-sender="garrigue@math.nagoya-u.ac.jp"; x-conformance=sidf_compatible Received-SPF: None (mail3-smtp-sop.national.inria.fr: no sender authenticity information available from domain of garrigue@math.nagoya-u.ac.jp) identity=mailfrom; client-ip=133.6.130.5; receiver=mail3-smtp-sop.national.inria.fr; envelope-from="garrigue@math.nagoya-u.ac.jp"; x-sender="garrigue@math.nagoya-u.ac.jp"; x-conformance=sidf_compatible Received-SPF: None (mail3-smtp-sop.national.inria.fr: no sender authenticity information available from domain of postmaster@mailhost.math.nagoya-u.ac.jp) identity=helo; client-ip=133.6.130.5; receiver=mail3-smtp-sop.national.inria.fr; envelope-from="garrigue@math.nagoya-u.ac.jp"; x-sender="postmaster@mailhost.math.nagoya-u.ac.jp"; x-conformance=sidf_compatible X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: A0CtAAATyFBXfQWCBoVehQ26SoF5hhICgWwUAQEBAQEBAQERAQELFgdQgjCCFgEBBEADATUBAQ4LGBwSVwaIQbBDhSgHAokPg1sBAQEBAQEEAQEBAQEBAQEWAQiIHoJWhECDLIIujl2JYI4ggWmHe4U4j0wehDNfinwBAQE X-IPAS-Result: A0CtAAATyFBXfQWCBoVehQ26SoF5hhICgWwUAQEBAQEBAQERAQELFgdQgjCCFgEBBEADATUBAQ4LGBwSVwaIQbBDhSgHAokPg1sBAQEBAQEEAQEBAQEBAQEWAQiIHoJWhECDLIIujl2JYI4ggWmHe4U4j0wehDNfinwBAQE X-IronPort-AV: E=Sophos;i="5.26,409,1459807200"; d="scan'208";a="179962161" Received: from rabbit.math.nagoya-u.ac.jp (HELO mailhost.math.nagoya-u.ac.jp) ([133.6.130.5]) by mail3-smtp-sop.national.inria.fr with ESMTP; 03 Jun 2016 01:59:13 +0200 Received: from mailhost.math.nagoya-u.ac.jp (localhost [127.0.0.1]) by mailhost.math.nagoya-u.ac.jp (Postfix) with ESMTP id 4A94763EB for ; Fri, 3 Jun 2016 08:59:11 +0900 (JST) Received: from mailhost.math.nagoya-u.ac.jp (rabbit-172.math.nagoya-u.ac.jp [172.16.254.254]) by mailhost.math.nagoya-u.ac.jp (Postfix) with ESMTP id 9802F24E3; Fri, 3 Jun 2016 08:59:10 +0900 (JST) DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=math.nagoya-u.ac.jp; h= subject:mime-version:content-type:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; s=alpha; bh=73f7Q03mOtM0szaW0oD9aXaa+gc=; b=siZnb1hhFzdZ1FU2D/DT11iTFlSP N/EQ+4cAeo3VTg4hRSXrT/3xVF8CgkGSU/d9L9Um2GnsfDlZ2XMapShdvt0QiHWQ 51/cL4B/yzFJpV38KHM88mkw9sRiPmDobW/BoS70Apvk6w5ICDqCB/Unp3kWtLZe vyzBbR2HVQRO0wk= DomainKey-Signature: a=rsa-sha1; h=Received:Subject:Mime-Version:Content-Type:From:In-Reply-To:Date:Cc:Content-Transfer-Encoding:Message-Id:References:To:X-Mailer; b=yKnTzdnjeeRjDAp+KpPnvZ6gG6swwNy1s0defBfUlrQ0lYuKDODgRj0r+ZUgUUTabcNEj07SWyO7b07+80XSXVIZtXMYTEglUJ62Xt6nDOWfeoQhDtil5NZTL6CgLLxHTyfmT5hNC2+wILfqi4QbF/oWExPqXcnaIs78uj1KCa8=; c=nofws; d=math.nagoya-u.ac.jp; q=dns; s=alpha Received: from tet.garrigue.jp (58x158x128x157.ap58.ftth.ucom.ne.jp [58.158.128.157]) by mailhost.math.nagoya-u.ac.jp (Postfix) with ESMTPSA id 918936BEA; Fri, 3 Jun 2016 08:56:15 +0900 (JST) Mime-Version: 1.0 (Mac OS X Mail 9.3 \(3124\)) Content-Type: text/plain; charset=iso-8859-1 From: Jacques Garrigue In-Reply-To: Date: Fri, 3 Jun 2016 08:59:20 +0900 Cc: OCaML List Mailing Content-Transfer-Encoding: quoted-printable Message-Id: References: To: Jacques Carette X-Mailer: Apple Mail (2.3124) Subject: Re: [Caml-list] Option to fully expand types in error messages? On 2016/06/03 04:18, "Carette, Jacques" wrote: >=20 > In writing some code which uses a lot of monads with underlying types whi= ch use constraints, even simple errors can lead to extremely hard to read e= rror messages. The main reason is that the two types given in errors are p= artially expanded, to different levels. This frequently means that the par= t where the type checker detects a mismatch is (extremely) opaque to human = eyes. >=20 > 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 con= siderably easier to catch. >=20 > Does this already exist, or should I submit a feature request? >=20 > Jacques In the error message, types are expanded just enough to get down to the con= flict. If the conflict is not visible at that point, this is probably a scoping er= ror (and there should be an extra line stating that); otherwise this should be seen as a bug. As Yaron pointed, -short-paths can help by at least giving a normal form fo= r paths (which may not be the expansion, but should be unique in the error = context). But it will not expand a type if the expansion is not a type cons= tructor, or if the parameters are different. Jacques=