File tree Expand file tree Collapse file tree 2 files changed +20
-2
lines changed
Expand file tree Collapse file tree 2 files changed +20
-2
lines changed Original file line number Diff line number Diff line change 1+ ## 0.2.2
2+
3+ - Add instances for base and primitive's ` ByteArray ` s.
4+
15## 0.2.1.1
26
37- Support ` base-4.16 ` (GHC-9.2)
Original file line number Diff line number Diff line change @@ -106,7 +106,11 @@ import qualified Data.Strict as Strict
106106import Data.These (These (.. ))
107107
108108-- primitive
109- -- import qualified Data.Primitive as Prim
109+ import qualified Data.Primitive as Prim
110+
111+ #if MIN_VERSION_base(4,17,0)
112+ import Data.Array.Byte (ByteArray (.. ))
113+ #endif
110114
111115-- $setup
112116-- >>> :set -XDeriveGeneric
@@ -593,4 +597,14 @@ instance (ToExpr a, ToExpr b) => ToExpr (These a b) where
593597-- primitive
594598-------------------------------------------------------------------------------
595599
596- -- TODO: add instances
600+ -- | @since 0.2.2
601+ instance ToExpr Prim. ByteArray where
602+ toExpr ba = App " Prim.byteArrayFromList" [toExpr (Prim. foldrByteArray (:) [] ba :: [Word8 ])]
603+
604+ #if MIN_VERSION_base(4,17,0)
605+ -- | @since 0.2.2
606+ instance ToExpr ByteArray where
607+ toExpr (ByteArray ba) = App " byteArrayFromList" [toExpr (Prim. foldrByteArray (:) [] (Prim. ByteArray ba) :: [Word8 ])]
608+ #endif
609+
610+ -- TODO: add more instances
You can’t perform that action at this time.
0 commit comments