@@ -25,6 +25,8 @@ module Tests.Deriving () where
25
25
import Control.DeepSeq
26
26
import qualified Data.Vector.Generic as VG
27
27
import qualified Data.Vector.Generic.Mutable as VGM
28
+ import qualified Data.Vector as V
29
+ import qualified Data.Vector.Strict as VV
28
30
import qualified Data.Vector.Storable as VS
29
31
import qualified Data.Vector.Primitive as VP
30
32
import qualified Data.Vector.Unboxed as VU
@@ -129,6 +131,39 @@ instance NFData a => VU.Unbox (FooNormalForm a)
129
131
130
132
131
133
134
+ data BoxedLazy = BoxedLazy Int
135
+ deriving (Eq , Ord , Show )
136
+
137
+ newtype instance VU. MVector s BoxedLazy = MV_BoxedLazy (V. MVector s BoxedLazy )
138
+ newtype instance VU. Vector BoxedLazy = V_BoxedLazy (V. Vector BoxedLazy )
139
+ deriving via (VU. DoNotUnboxLazy BoxedLazy ) instance VGM. MVector VU. MVector BoxedLazy
140
+ deriving via (VU. DoNotUnboxLazy BoxedLazy ) instance VG. Vector VU. Vector BoxedLazy
141
+ instance VU. Unbox BoxedLazy
142
+
143
+
144
+ data BoxedStrict = BoxedStrict Int
145
+ deriving (Eq , Ord , Show )
146
+
147
+ newtype instance VU. MVector s BoxedStrict = MV_BoxedStrict (VV. MVector s BoxedStrict )
148
+ newtype instance VU. Vector BoxedStrict = V_BoxedStrict (VV. Vector BoxedStrict )
149
+ deriving via (VU. DoNotUnboxStrict BoxedStrict ) instance VGM. MVector VU. MVector BoxedStrict
150
+ deriving via (VU. DoNotUnboxStrict BoxedStrict ) instance VG. Vector VU. Vector BoxedStrict
151
+ instance VU. Unbox BoxedStrict
152
+
153
+
154
+ data BoxedNormalForm = BoxedNormalForm Int
155
+ deriving (Eq , Ord , Show )
156
+
157
+ instance NFData BoxedNormalForm where
158
+ rnf (BoxedNormalForm i) = rnf i
159
+
160
+ newtype instance VU. MVector s BoxedNormalForm = MV_BoxedNormalForm (VV. MVector s BoxedNormalForm )
161
+ newtype instance VU. Vector BoxedNormalForm = V_BoxedNormalForm (VV. Vector BoxedNormalForm )
162
+ deriving via (VU. DoNotUnboxNormalForm BoxedNormalForm ) instance VGM. MVector VU. MVector BoxedNormalForm
163
+ deriving via (VU. DoNotUnboxNormalForm BoxedNormalForm ) instance VG. Vector VU. Vector BoxedNormalForm
164
+ instance VU. Unbox BoxedNormalForm
165
+
166
+
132
167
----------------------------------------------------------------
133
168
-- Unboxed
134
169
0 commit comments