[ghc-steering-committee] TypeApplications for Overloaded Literals (#129), Recommendation: accept

Joachim Breitner mail at joachim-breitner.de
Sun May 6 15:47:22 UTC 2018


Hi,

Am Sonntag, den 06.05.2018, 15:42 +0000 schrieb Iavor Diatchki:
> Is there a reason why we should write `5 @Int` as opposed to `5 :: Int`?

Because we can. Or rather, we should can, because 

   Prelude> :t 5
   5 :: Num t => t
   Prelude> :t 5 @Double
   <interactive>:1:1: error:
       • Cannot apply expression of type ‘t0’
         to a visible type argument ‘Double’
       • In the expression: 5 @Double

is confusing and inconsistent with the user’s expectation after
learning about when they can use ExplicitTypeApplications (unless one
knows about the syntactic sugar involved.)

> Also, there appears to be a typo in the spec, the part which specifies translations for integers (1 turned into 0?)

thanks, fixed.


(BTW, all of you are owners of the repository and should have the
necessary permissions to edit pull requests directly.)

Cheers,
Joachim

-- 
Joachim Breitner
  mail at joachim-breitner.de
  http://www.joachim-breitner.de/
-------------- 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/20180506/826ba6da/attachment.sig>


More information about the ghc-steering-committee mailing list