{-# LANGUAGE Rank2Types, MagicHash, UnboxedTuples #-}
module Data.RangeMin.Common.ST (ST, inlineRunST, runST) where

import GHC.ST (ST (..), runST)
import GHC.Base (realWorld#)

{-# INLINE inlineRunST #-}
inlineRunST :: (forall s . ST s a) -> a
inlineRunST m = case m of
	ST f -> case f realWorld# of
		(# _, x #) -> x