"Found hole"

htebalaka goodingm at gmail.com
Tue Jan 20 18:47:09 UTC 2015

They are described at these two links:

Essentially, identifiers that are not otherwise in scope and consist of an
underscore or that have a trailing underscore are treated as holes, for
which you wish to know which type was inferred. Previously you would need to
do something like add a wrong type signature, so that the compiler would
complain that the type you gave doesn't match what it inferred.

Though I get a different error message:

Found hole ‘_exit’ with type: a0 -> t
    Where: ‘a0’ is an ambiguous type variable
           ‘t’ is a rigid type variable bound by

There really should be a Num constraint as well, but at least in 7.8 it
doesn't seem to include those.

Volker Wysk-5 wrote
> Hello!
> What is a "hole"? 
> This program fails to compile:
> main = _exit 0
> I get this error message:
> ex.hs:1:8:
>     Found hole ‘_exit’ with type: t
>     Where: ‘t’ is a rigid type variable bound by
>                the inferred type of main :: t at ex.hs:1:1
>     Relevant bindings include main :: t (bound at ex.hs:1:1)
>     In the expression: _exit
>     In an equation for ‘main’: main = _exit
> When I replace "_exit" with "foo", it produces a "not in scope" error, as 
> expected. What is special about "_exit"? It doesn't occur in the Haskell 
> Hierarchical Libraries.
> Bye
> Volker
> _______________________________________________
> Glasgow-haskell-users mailing list

> Glasgow-haskell-users@

> http://www.haskell.org/mailman/listinfo/glasgow-haskell-users

View this message in context: http://haskell.1045720.n5.nabble.com/Found-hole-tp5764054p5764057.html
Sent from the Haskell - Glasgow-haskell-users mailing list archive at Nabble.com.

More information about the Glasgow-haskell-users mailing list