
Hi, Am Mittwoch, den 26.04.2017, 21:45 +1000 schrieb Manuel M T Chakravarty:
* I am against adding the proposed ”instance force” declaration form as its *main* motivation is to simplify error messages and type signatures printed by GHCi — i.e., it is of a diagnostic and informative nature.
Hmm, maybe the proposal is unclear on that, but that is not the only motivation. The other main motivation is to make type inference easier and more predictable by avoiding ambiguous types, so that things like {-# LANGUAGE OverloadedStrings #-} print "Test" would work without problems. I believe than Ryan Trinkle expressed interest in a feature like this; he uses a type class to be able to swap out a real implementation of an interface with a testing stub, but in application code he _always_ wants the real implementation – although, to be honest, I think he is more interested in having a guarantee that the compiler optimizes the dictionary away completely, and maybe less in type inference. But I agree that a nicer means to this ends would be, well, nice. Greetings, Joachim -- Joachim “nomeata” Breitner mail@joachim-breitner.de • https://www.joachim-breitner.de/ XMPP: nomeata@joachim-breitner.de • OpenPGP-Key: 0xF0FBF51F Debian Developer: nomeata@debian.org