Open martijnbastiaan opened 1 month ago
The warning won’t help you if the primitive is already elided from the use-site by GHC.
Perhaps we should improve our documentation with regards to these “no-simulation” primitives. Given that custom primitives are an advanced topic, I suspect people only discover them by reading the documentation, so that seems like the right spot to handle this. Turning off strictness analysis for all code in the starter project seems like a ‘baby with the bath water’ kind of thing.
Say I've got a black box:
If this output is used:
GHC might conclude that, because
register
is strict in some of its arguments, that the result of the calculation is undefined. This is undesirable, because it will turn perfectly synthesizable code into non-synthesizable junk.If think we should:
-fno-strictness
in starter projectsWorkaround: