A function with absent demand on syntactically used argument?

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.

Am Mittwoch, den 03.08.2016, 10:10 +0000 schrieb Ömer Sinan Ağacan:
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
its argument even though the argument is syntactically used in the body?
here is a simple example: printFst :: (a,b) -> IO () -- printFst (a,b) = print a callPrintFirst :: b -> IO () -- <A> callPrintFirst b = printFst ("see it?", b)
I think we should add some examples to `Note [Absent errors]` in WwLib.hs.
*shrug* Not sure if it is worth it.
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.
undefined as signature "b", indicating „even if given no arguments, I
will bottom out“. The demand analyzer treats that as „
participants (2)
-
Joachim Breitner
-
Ömer Sinan Ağacan