A function with absent demand on syntactically used argument?

Ömer Sinan Ağacan omeragacan at gmail.com
Wed Aug 3 10:10:01 UTC 2016


I'm reading the code in WwLib that generates worker functions and I'm confused
about absent lets. Can anyone give an example function that has absent demand
on its argument even though the argument is syntactically used in the body?

I think we should add some examples to `Note [Absent errors]` in WwLib.hs.

One example came to my mind was something like

    f x = ... undefined x ...

I'm guessing that if we were to generate a worker for this, we'd need to
generate an absent let for x in the worker function. But "undefined" has a
weird (polymorphic over both function and non-function types) type and I don't
know what's the demand signature of it (maybe we should document this too), so
I'm not sure.


More information about the ghc-devs mailing list