There are some magical identity functions in the GHC.Magic
module.
inline
will tell the compiler try to inline the function, but its definition need to be visible to the compiler (in the same module or have INLINE
or INLINABLE
pragma).
does the reverse to inline
.
I don’t quite understand this function.
It will tell the compiler the function will only be used at most once.
might be useful for improving the performance of code in continuation passing style.
It can cause the code that would otherwise be shared to be re-evaluated everytime they are used, otherwise safe.
This feature might be useful as well (although for some dirty purposes) use with unsafePerformIO
to get random numbers in pure functions, and prevent sharing.