{-# LANGUAGE CPP #-}

module PtrPoker.Text where

import qualified Data.Text.Array as TextArray
import qualified Data.Text.Internal as Text
import PtrPoker.Prelude

{-# INLINE destruct #-}
destruct :: (ByteArray# -> Int -> Int -> x) -> Text -> x
#if MIN_VERSION_text(2,0,0)
destruct k (Text.Text (TextArray.ByteArray arr) off len) = k arr off len
#else
destruct :: (ByteArray# -> Int -> Int -> x) -> Text -> x
destruct ByteArray# -> Int -> Int -> x
k (Text.Text (Array -> ByteArray#
TextArray.aBA -> ByteArray#
arr) Int
off Int
len) = ByteArray# -> Int -> Int -> x
k ByteArray#
arr Int
off Int
len
#endif