module Data.RangeMin.Common.Types (IP (..), LEq, RM, toRM, runRM, Index, Value, Length, RangeMin, PVector, VVector) where
import qualified Data.Vector.Primitive as P
import qualified Data.Vector as V
#if __GLASGOW_HASKELL__
import GHC.Exts (Int#, Int(..))
#endif
type PVector = P.Vector
type VVector = V.Vector
type Index = Int
type Value = Int
type Length = Int
type RangeMin = Index -> Length -> Index
type LEq a = a -> a -> Bool
data IP = IP !Int !Int
toRM :: (Index -> Length -> Index) -> RM
runRM :: RM -> Index -> Length -> Index
#if __GLASGOW_HASKELL__
type RM = (Int# -> Int# -> Int#)
toRM f = \ i# j# -> case f (I# i#) (I# j#) of
I# k# -> k#
runRM f (I# i#) (I# j#) = I# (f i# j#)
#else
type RM = Index -> Index -> Index
toRM = id
runRM = id
#endif