[ghc-steering-committee] Proposal #23: instance force

Joachim Breitner mail at joachim-breitner.de
Wed Apr 26 16:46:33 UTC 2017


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 at joachim-breitner.dehttps://www.joachim-breitner.de/
  XMPP: nomeata at joachim-breitner.de • OpenPGP-Key: 0xF0FBF51F
  Debian Developer: nomeata at debian.org
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: This is a digitally signed message part
URL: <http://mail.haskell.org/pipermail/ghc-steering-committee/attachments/20170426/a5b8fccb/attachment.sig>


More information about the ghc-steering-committee mailing list