1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37
|
{-# LANGUAGE DeriveDataTypeable, EmptyDataDecls #-}
-- |
-- Module : Data.Text.ICU.Bidi.Internal
-- Copyright : (c) Ondrej Palkovsky 2018
--
-- License : BSD-style
-- Maintainer : bos@serpentine.com
-- Stability : experimental
-- Portability : GHC
--
-- Internal types for Unicode bidirectional algorithm
module Data.Text.ICU.BiDi.Internal
(
BiDi(..)
, UBiDi
, withBiDi
) where
import Data.Typeable (Typeable)
import Foreign.ForeignPtr (ForeignPtr, withForeignPtr)
import Foreign.Ptr (Ptr)
data UBiDi
-- | BiDi object. /Note/: this structure is not
-- thread safe. It is /not/ safe to use value of this type
-- simultaneously from multiple threads.
newtype BiDi = BiDi (ForeignPtr UBiDi)
deriving (Eq, Typeable)
instance Show BiDi where
show _ = "BiDi"
withBiDi :: BiDi -> (Ptr UBiDi -> IO a) -> IO a
{-# INLINE withBiDi #-}
withBiDi (BiDi cnv) = withForeignPtr cnv
|