typed holes inferring very polymorphic types

Sreenidhi Nair nair.sreenidhi at gmail.com
Mon Oct 1 18:25:00 UTC 2018


We tried the following code with ghc-8.6.1

testFailure :: Char
testFailure =
  let x = Prelude.id _
  in  x

which gave the following suggestion

    • Found hole: _ :: a
      Where: ‘a’ is a rigid type variable bound by
               the inferred type of x :: a

And then this

testSuccess :: Char
testSuccess = _

which gave a much better suggestion

    • Found hole: _ :: Char
    • In the expression: _
      In an equation for ‘testSuccess’: testSuccess = _

Is there any way to get better suggestions with 'let' version?
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.haskell.org/pipermail/ghc-devs/attachments/20181001/6f840f2a/attachment.html>

More information about the ghc-devs mailing list