Am 24.08.2015 um 00:18 schrieb Jacques Garrigue: > This is indeed a pretty difficult problem, as you must be careful of not > changing the semantics of unification. > Until recently, the only solution was to expand the type, as there was > no static information cacheing whether an argument was used in the > body or not. > However, since relatively recent changes about variance information > (the switch to 7 flags…), we actually have at least an approximation > of which unifications must be done imperatively, and which needn’t > be done at all. > So it might be doable at least for part of the parameters. That sounds interesting. What are the relevant variance flags? > I would have to see the code to tell you more. > As stated above, the real problem is the length of the cycles in the expanded > graph. I really do not think that this is related to any cycles. It is just about large unfolded types. I attached a script to generate a meaningful example. When I try to run ocamlbuild m_9.cmo, it takes ~30s already. A preliminary patched version of the ocaml compiler can handle this particular example in pretty much no time at all. regards, Christoph -- Christoph Höger Technische Universität Berlin Fakultät IV - Elektrotechnik und Informatik Übersetzerbau und Programmiersprachen Sekr. TEL12-2, Ernst-Reuter-Platz 7, 10587 Berlin Tel.: +49 (30) 314-24890 E-Mail: christoph.hoeger@tu-berlin.de