trapping code: transition from native to haskell rts