Skip to content

Commit

Permalink
add an instance for Solo
Browse files Browse the repository at this point in the history
  • Loading branch information
fumieval committed Nov 23, 2024
1 parent 82a22f5 commit 2d6976b
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 0 deletions.
1 change: 1 addition & 0 deletions ChangeLog.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
* Support GHC >= 9.6
* Use `buildVariantExtractor` in `Codec.Winery.Query.con`
* Require mtl >= 2.3
* Added an instance for `Solo`
* Added `deserialiseOnly`
* `extractConstructor`, `extractConstructorBy`, and `extractVoid` are now deprecated

Expand Down
11 changes: 11 additions & 0 deletions src/Codec/Winery/Class.hs
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,7 @@ import qualified Data.Vector.Unboxed as UV
import Prettyprinter hiding ((<>), SText, SChar)
import Data.Time.Clock
import Data.Time.Clock.POSIX
import Data.Tuple

Check warning on line 114 in src/Codec/Winery/Class.hs

View workflow job for this annotation

GitHub Actions / build (8.10.7)

The import of ‘Data.Tuple’ is redundant

Check warning on line 114 in src/Codec/Winery/Class.hs

View workflow job for this annotation

GitHub Actions / build (8.10.7)

The import of ‘Data.Tuple’ is redundant
import Data.Typeable
import Data.Void (Void)
import Unsafe.Coerce
Expand Down Expand Up @@ -1109,3 +1110,13 @@ buildRecordExtractor = buildExtractor . btraverse (fmap Identity)
bextractors :: forall b. (ConstraintsB b, AllB Serialise b, FieldNamesB b) => b Subextractor
bextractors = bmapC @Serialise (extractField . getConst) bfieldNames
{-# INLINABLE bextractors #-}

#if MIN_VERSION_base(4,15,0)
instance Serialise a => Serialise (Solo a) where

Check failure on line 1115 in src/Codec/Winery/Class.hs

View workflow job for this annotation

GitHub Actions / build (9.0.1)

Not in scope: type constructor or class ‘Solo’

Check failure on line 1115 in src/Codec/Winery/Class.hs

View workflow job for this annotation

GitHub Actions / build (9.0.1)

Not in scope: type constructor or class ‘Solo’
schemaGen = gschemaGenProduct
toBuilder = gtoBuilderProduct
extractor = gextractorProduct
decodeCurrent = gdecodeCurrentProduct
{-# INLINE toBuilder #-}
{-# INLINE decodeCurrent #-}
#endif
1 change: 1 addition & 0 deletions src/Codec/Winery/Internal.hs
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ import qualified Data.ByteString.Internal as B
import qualified Data.ByteString.Builder.Prim.Internal as BPI
import Data.Bits
import Data.String
import Data.Tuple

Check warning on line 56 in src/Codec/Winery/Internal.hs

View workflow job for this annotation

GitHub Actions / build (8.10.7)

The import of ‘Data.Tuple’ is redundant

Check warning on line 56 in src/Codec/Winery/Internal.hs

View workflow job for this annotation

GitHub Actions / build (9.0.1)

The import of ‘Data.Tuple’ is redundant

Check warning on line 56 in src/Codec/Winery/Internal.hs

View workflow job for this annotation

GitHub Actions / build (8.10.7)

The import of ‘Data.Tuple’ is redundant

Check warning on line 56 in src/Codec/Winery/Internal.hs

View workflow job for this annotation

GitHub Actions / build (9.0.1)

The import of ‘Data.Tuple’ is redundant

Check warning on line 56 in src/Codec/Winery/Internal.hs

View workflow job for this annotation

GitHub Actions / build (9.2.1)

The import of ‘Data.Tuple’ is redundant
import qualified Data.Vector.Unboxed as U
import qualified Data.Vector as V
import Data.Word
Expand Down

0 comments on commit 2d6976b

Please sign in to comment.