optimiseInKernelStm (Let pat aux e) =
  addStm =<< (Let pat aux <$> mapExpM optimise e)
  where optimise = identityMapper
          { mapOnBody = \scope -> localScope scope . optimiseInBody }
optimiseInKernelStm (Let pat aux e) =
  addStm =<< (Let pat aux <$> mapExpM optimise e)
  where optimise = identityMapper
          { mapOnBody = \scope -> localScope scope . optimiseInBody }
optimiseInKernelStm (Let pat aux e) =
  addStm =<< (Let pat aux <$> mapExpM optimise e)
  where optimise = identityMapper
          { mapOnBody = \scope -> localScope scope . optimiseInBody }