This function helps with optimizing performance when working with the
ReaderT transformer. If you have code like below, that is
called in a loop
step :: Instruction -> ReaderT Config IO Result
step instruction = case instruction of
Add -> do stuff ...
Del -> do stuff ...
you can improve performance of your Haskell applications by using
etaReaderT in the following way:
step :: Instruction -> ReaderT Config IO Result
step instruction = etaReaderT $ case instruction of
Add -> do stuff ...
Del -> do stuff ...
For a detailed explanation, refer to the following blog post: