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
+
1
5
## 0.2.1.1
2
6
3
7
- 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
106
106
import Data.These (These (.. ))
107
107
108
108
-- 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
110
114
111
115
-- $setup
112
116
-- >>> :set -XDeriveGeneric
@@ -593,4 +597,14 @@ instance (ToExpr a, ToExpr b) => ToExpr (These a b) where
593
597
-- primitive
594
598
-------------------------------------------------------------------------------
595
599
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