Conditional compilation based on interactive (GHCi) or compiled
You can use pragma
. They only fire when optimization is enabled. A simple pragma replacing one binding with another will only allow you to change the definition of something when you enable optimizations, although this still requires compiling both versions all the time.
This is not a great solution, but I think it is not a good thing to do either.
source to share