"Found hole"

Edward Z. Yang ezyang at mit.edu
Tue Jan 20 18:46:32 UTC 2015


Hello Volker,

All identifiers prefixed with an underscore are "typed holes",
see:
https://downloads.haskell.org/~ghc/7.8.3/docs/html/users_guide/typed-holes.html

Edward

Excerpts from Volker Wysk's message of 2015-01-20 10:36:09 -0800:
> 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
> 


More information about the Glasgow-haskell-users mailing list