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 mail2-relais-roc.national.inria.fr (mail2-relais-roc.national.inria.fr [192.134.164.83]) by sympa.inria.fr (Postfix) with ESMTPS id 2AF9D7F0D9 for ; Wed, 26 Aug 2015 03:26:09 +0200 (CEST) IronPort-PHdr: 9a23:RR9hrBIdObB+UnQe6dmcpTZWNBhigK39O0sv0rFitYgVKvzxwZ3uMQTl6Ol3ixeRBMOAu6kC1bKd7/2ocFdDyKjCmUhKSIZLWR4BhJdetC0bK+nBN3fGKuX3ZTcxBsVIWQwt1Xi6NU9IBJS2PAWK8TWM5DIfUi/yKRBybrysXNWC1ILpj6vuptX6WEZhunmUWftKNhK4rAHc5IE9oLBJDeIP8CbPuWZCYO9MxGlldhq5lhf44dqsrtY4q3wD89pozcNLUL37cqIkVvQYSW1+ayFmrPHs4DLDVwqU+nwEUlI2DBVFGUCR5xHgX4zttTP68Op61SaXJ+XqUPU+VC6m7qEtRBK+2wkdMDts0mjck9F9l+p0qQi7phNizsaAb4iPLvtxY671eNoGRSxHV8lWRiUEH8W1ZM0NF7xSbq5js4Dhqg5W/lOFDg62Cbaqk2cQiw== Authentication-Results: mail2-smtp-roc.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 (mail2-smtp-roc.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=mail2-smtp-roc.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 (mail2-smtp-roc.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=mail2-smtp-roc.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 (mail2-smtp-roc.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=mail2-smtp-roc.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: A0AVAQCVFN1VlwWCBoVdFoNZLTy+GoFuCoV7AoFzEgEBAQEBAQEBEAEBAQEBCBYHT4IdggYBAQECAQEjHQMBNQEBAwsLGAICGA4CAlcGiDkHDrIkcYRrAosxhGwBAQEBAQUBAQEBAQEBARMBBoEiijWEVzMHgi47Eh2BFI1kh1iFBodsgUpGhwiNUoNqhDNiAQGCSgEBAQ X-IPAS-Result: A0AVAQCVFN1VlwWCBoVdFoNZLTy+GoFuCoV7AoFzEgEBAQEBAQEBEAEBAQEBCBYHT4IdggYBAQECAQEjHQMBNQEBAwsLGAICGA4CAlcGiDkHDrIkcYRrAosxhGwBAQEBAQUBAQEBAQEBARMBBoEiijWEVzMHgi47Eh2BFI1kh1iFBodsgUpGhwiNUoNqhDNiAQGCSgEBAQ X-IronPort-AV: E=Sophos;i="5.17,413,1437429600"; d="scan'208";a="174849533" Received: from rabbit.math.nagoya-u.ac.jp (HELO mailhost.math.nagoya-u.ac.jp) ([133.6.130.5]) by mail2-smtp-roc.national.inria.fr with ESMTP; 26 Aug 2015 03:26:06 +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 7440463A4; Wed, 26 Aug 2015 10:26:03 +0900 (JST) Received: from mailhost.math.nagoya-u.ac.jp (rabbit-172 [172.16.254.254]) by mailhost.math.nagoya-u.ac.jp (Postfix) with ESMTP id B60174114; Wed, 26 Aug 2015 10:26:02 +0900 (JST) DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=math.nagoya-u.ac.jp; h= content-type:mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; s=alpha; bh=fBlVKLqWvK+drJOB1MmG33hTpcc=; b=xCb2SJriGlk9iui8KpoWMwfjjab0 rVbmgv6yrTsodLE0hCnzyFO8CUZIZIf2aAQBnP0RM/3lJWQ+6r9q/ITkin1SMoxO OpPiCpEmDZ8LKa3QuaN2J66BgGh6nRBGGPc1a6Ic0bktQoY45kHx++ojSu4DfTY4 b0A51tWqDXpNZq8= DomainKey-Signature: a=rsa-sha1; h=Received:Content-Type:Mime-Version:Subject:From:In-Reply-To:Date:Cc:Content-Transfer-Encoding:Message-Id:References:To:X-Mailer; b=SZz06aNDYNaBeTuU5vNZ7Gc4BX1FdZWVunW9+emS6aikHwnudV9uTBPDu4Sjhxy3BCvVRfvwgZmRNBpMcABUrotaRCwS9oaPNai4KxfXJhZed1TlOSRMcKshjSwLY/tYETp9WApmyQCjJMSCNyGS3aVjKPKZ10n2nDJd241FUIA=; 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 052408530; Wed, 26 Aug 2015 10:26:01 +0900 (JST) Content-Type: text/plain; charset=utf-8 Mime-Version: 1.0 (Mac OS X Mail 8.2 \(2104\)) From: Jacques Garrigue In-Reply-To: <55DC8E2A.7030101@tu-berlin.de> Date: Wed, 26 Aug 2015 10:26:01 +0900 Cc: OCaML List Mailing Content-Transfer-Encoding: quoted-printable Message-Id: <24A57847-DEB0-4E99-9C95-E32BA41E88AE@math.nagoya-u.ac.jp> References: <55D827DB.3010506@tu-berlin.de> <55D85FE7.2050001@tu-berlin.de> <0D467B24-3C94-4640-8264-85BE5312EB55@math.nagoya-u.ac.jp> <55DAB843.5010800@tu-berlin.de> <55DAEEDA.6020709@tu-berlin.de> <3A6D9855-8FCD-4345-983D-011DD5138C0E@math.nagoya-u.ac.jp> <55DC8E2A.7030101@tu-berlin.de> To: =?utf-8?Q?Christoph_H=C3=B6ger?= X-Mailer: Apple Mail (2.2104) Subject: Re: [Caml-list] Expansion of type-constructors in ctype.ml On 2015/08/26 00:47, Christoph H=C3=B6ger wrote: >=20 > Am 25.08.2015 um 16:02 schrieb Jacques Garrigue: >> Do you mean that modifying moregen and eqtype (but not unify) >> in a conservative way would be enough to solve your problem? >=20 > At least until now, it seems to solve it. I can compile my ~12k classes > in ~20min now. I expect the number of classes to decrease while I > optimize the output of my compiler and their size to increase while I > add more features. So the best bet is that the performance will stay the > same, unless I encounter some more performance problems. >=20 > Btw: Is there a place/format to discuss concrete proposed patches? This > list seems to be more on the user's side. The standard place would be a problem report on Mantis. Performance problems are perfectly valid. However, I think this stills falls in the scope of this list too, as the pr= oblem is wide enough. But opening a PR on Mantis is useful for future reference. >> Then indeed we could do that. >> At least your code for eqtype seems fine. For moregen, this is not suffi= cient, due to non-local side effects. >> By the way, we should keep your example around to prevent regressions. >=20 > Feel free to add the example wherever you want. I can also open a bug in > mantis if you think that is appropriate. Do you have any insights on > what could be done for moregen? The only safe way I see is to use the variance information. I=E2=80=99ll look into that when I have some time. >> You should read the following paper: >> http://www.math.nagoya-u.ac.jp/~garrigue/papers/injectivity.pdf >=20 > Thanks. Will do. >=20 >> may_pos and may_neg are both unset (i.e. nothing is set) =3D> no need to= recurse >> inj is set =3D> must recurse >> otherwise =3D> must expand >=20 > Sounds like inj is what I want for my concrete case. I recon there is no > flag yet to manually set it. Do you know of a trick to force the > inference mechanism to do so? You don=E2=80=99t have to set it. It=E2=80=99s inferred automatically for a= ll type definitions. When you look up a type with Env.find_type, you get the variance as a field= of the result. The you can check whether Inj is set by [Variance.(mem Inj v)]. You can check if there is no occurence with [v =3D Variance.null]. > And by "no need to recurse" you mean that this argument could be left > out (i.e. replaced by unit)? Yes. No need to compare, since it would never be visited after expansion. Jacques Garrigue=