module Data.Text.ICU.Collate.Internal
(
MCollator(..)
, Collator(..)
, UCollator
, withCollator
, wrap
) where
import Data.Typeable (Typeable)
import Foreign.ForeignPtr (ForeignPtr, newForeignPtr, withForeignPtr)
import Foreign.Ptr (FunPtr, Ptr)
data UCollator
data MCollator = MCollator !(ForeignPtr UCollator)
deriving (Typeable)
newtype Collator = C MCollator
deriving (Typeable)
withCollator :: MCollator -> (Ptr UCollator -> IO a) -> IO a
withCollator (MCollator col) action = withForeignPtr col action
wrap :: Ptr UCollator -> IO MCollator
wrap = fmap MCollator . newForeignPtr ucol_close
foreign import ccall unsafe "hs_text_icu.h &__hs_ucol_close" ucol_close
:: FunPtr (Ptr UCollator -> IO ())