Bikeshedding request for GHCi's :type
Iavor Diatchki
iavor.diatchki at gmail.com
Thu Apr 28 15:00:29 UTC 2016
Currently GHCi shows the "real" type of an expression (i.e., the inferred
generalized type), when you ask it:
Prelude> :t 1
1 :: Num a => a
Note that there is no defaulting happening, at least at the top level---of
course if there were local things that needed to be defaulted while the
expression was being type-checked then those would be defaulted.
If you ask GHCi to *evaluate* a polymorphic expression, then it will try to
default the type when it is figuring out how to show the result. The
alternative would be to say "sorry, I can't evaluate this, because it is
polymorphic, so please tell me what type do you mean". This is probably a
bit too inconvenient for practical use.
-Iavor
On Thu, Apr 28, 2016 at 5:24 AM, Johannes Waldmann <
johannes.waldmann at htwk-leipzig.de> wrote:
> > .. :type should report the real type
>
> What about defaulting? Is it real?
> https://ghc.haskell.org/trac/ghc/ticket/11994
>
> - J.W.
> _______________________________________________
> ghc-devs mailing list
> ghc-devs at haskell.org
> http://mail.haskell.org/cgi-bin/mailman/listinfo/ghc-devs
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.haskell.org/pipermail/ghc-devs/attachments/20160428/f6370b98/attachment.html>
More information about the ghc-devs
mailing list