Inlining Daml code

Asking for a friend, does Daml’s GHC portion respect the INLINE pragma? Ex.

lift : Action m => m a -> ContT r m a
lift m = ContT (m >>=)
{-# INLINE lift #-}

No it does not. There is very limited inlining for typeclass methods that are statically known but generally my recommendation is that you assume the Daml compiler does not optimizations on your code at all and what is being run is what you write.


Obviously, you’re Batman, I’m Robin.


I wouldn’t worry about optimising the CPU time of Daml interpretation too much. In the grand scheme of things, that does not tend to be the bottleneck unless your algorithmic complexity is out of whack.

1 Like


Bernhard’s Batman … I’m still Robin

1 Like