typed holes inferring very polymorphic types

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

typed holes inferring very polymorphic types

Sreenidhi Nair
Hello,

We tried the following code with ghc-8.6.1

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

which gave the following suggestion

/home/sreenidhi/Work/typeql/typeql-dbrecord/test/Test/Database/Postgres/Read/Combinator.hs:83:22: error:
    • Found hole: _ :: a
      Where: ‘a’ is a rigid type variable bound by
               the inferred type of x :: a
               at /home/sreenidhi/Work/typeql/typeql-dbrecord/test/Test/Database/Postgres/Read/Combinator.hs:83:7-22

And then this

testSuccess :: Char
testSuccess = _

which gave a much better suggestion

/home/sreenidhi/Work/typeql/typeql-dbrecord/test/Test/Database/Postgres/Read/Combinator.hs:87:15: error:
    • Found hole: _ :: Char
    • In the expression: _
      In an equation for ‘testSuccess’: testSuccess = _

Is there any way to get better suggestions with 'let' version?




_______________________________________________
ghc-devs mailing list
[hidden email]
http://mail.haskell.org/cgi-bin/mailman/listinfo/ghc-devs
Reply | Threaded
Open this post in threaded view
|

Re: typed holes inferring very polymorphic types

Artem Pelenitsyn
Hello Sreenidhi,

This looks like a valid Trac ticket to me. Maybe, open one?

--
Best, Artem

On Mon, 1 Oct 2018 at 13:25 Sreenidhi Nair <[hidden email]> wrote:
Hello,

We tried the following code with ghc-8.6.1

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

which gave the following suggestion

/home/sreenidhi/Work/typeql/typeql-dbrecord/test/Test/Database/Postgres/Read/Combinator.hs:83:22: error:
    • Found hole: _ :: a
      Where: ‘a’ is a rigid type variable bound by
               the inferred type of x :: a
               at /home/sreenidhi/Work/typeql/typeql-dbrecord/test/Test/Database/Postgres/Read/Combinator.hs:83:7-22

And then this

testSuccess :: Char
testSuccess = _

which gave a much better suggestion

/home/sreenidhi/Work/typeql/typeql-dbrecord/test/Test/Database/Postgres/Read/Combinator.hs:87:15: error:
    • Found hole: _ :: Char
    • In the expression: _
      In an equation for ‘testSuccess’: testSuccess = _

Is there any way to get better suggestions with 'let' version?



_______________________________________________
ghc-devs mailing list
[hidden email]
http://mail.haskell.org/cgi-bin/mailman/listinfo/ghc-devs

_______________________________________________
ghc-devs mailing list
[hidden email]
http://mail.haskell.org/cgi-bin/mailman/listinfo/ghc-devs