{-# LANGUAGE CPP #-}
{-# OPTIONS_GHC -Wno-orphans #-}

module IsomorphismClass.Relations.TextArrayAndWord8List where

#if !MIN_VERSION_text(2,1,0)

import qualified Data.ByteString.Short
import qualified Data.Text.Array
import IsomorphismClass.Classes
import IsomorphismClass.Prelude
import qualified IsomorphismClass.TextCompat.Array

instance IsomorphicTo Data.Text.Array.Array [Word8] where
  to :: [Word8] -> Array
to = ShortByteString -> Array
IsomorphismClass.TextCompat.Array.fromShortByteString (ShortByteString -> Array)
-> ([Word8] -> ShortByteString) -> [Word8] -> Array
forall b c a. (b -> c) -> (a -> b) -> a -> c
forall {k} (cat :: k -> k -> *) (b :: k) (c :: k) (a :: k).
Category cat =>
cat b c -> cat a b -> cat a c
. [Word8] -> ShortByteString
Data.ByteString.Short.pack

instance IsomorphicTo [Word8] Data.Text.Array.Array where
  to :: Array -> [Word8]
to = ShortByteString -> [Word8]
Data.ByteString.Short.unpack (ShortByteString -> [Word8])
-> (Array -> ShortByteString) -> Array -> [Word8]
forall b c a. (b -> c) -> (a -> b) -> a -> c
forall {k} (cat :: k -> k -> *) (b :: k) (c :: k) (a :: k).
Category cat =>
cat b c -> cat a b -> cat a c
. Array -> ShortByteString
IsomorphismClass.TextCompat.Array.toShortByteString

#endif