-- | Convert an 'RemoteRef' to the value it references directly.  This
-- only works when the interpreter is running in the same process as
-- the compiler, so it fails when @-fexternal-interpreter@ is on.
wormholeRef :: DynFlags -> RemoteRef a -> IO a
wormholeRef dflags _r
  | gopt Opt_ExternalInterpreter dflags
  = throwIO (InstallationError
      "this operation requires -fno-external-interpreter")
  | otherwise
  = throwIO (InstallationError
      "can't wormhole a value in the Eta compiler right now")
wormholeRef :: DynFlags -> RemoteRef a -> IO a
wormholeRef dflags _r
  | gopt Opt_ExternalInterpreter dflags
  = throwIO (InstallationError
      "this operation requires -fno-external-interpreter")
  | otherwise
  = throwIO (InstallationError
      "can't wormhole a value in the Eta compiler right now")
wormholeRef dflags _r
  | gopt Opt_ExternalInterpreter dflags
  = throwIO (InstallationError
      "this operation requires -fno-external-interpreter")
  | otherwise
  = throwIO (InstallationError
      "can't wormhole a value in the Eta compiler right now")