build for 8.2.2 & 8.4.4 with cpp

This commit is contained in:
qz 2019-01-24 01:43:06 +03:00
parent 2a10e6c21a
commit 1a8c40e505
3 changed files with 52 additions and 1 deletions

View File

@ -1,3 +1,4 @@
{-# LANGUAGE CPP #-}
module Database.PostgreSQL.Protocol.Store.Encode module Database.PostgreSQL.Protocol.Store.Encode
( Encode ( Encode
, getEncodeLen , getEncodeLen
@ -26,15 +27,21 @@ import Data.ByteString.Internal (toForeignPtr)
import Data.Store.Core (Poke(..), unsafeEncodeWith, pokeStatePtr, import Data.Store.Core (Poke(..), unsafeEncodeWith, pokeStatePtr,
pokeFromForeignPtr) pokeFromForeignPtr)
import qualified Data.Semigroup as Sem
data Encode = Encode {-# UNPACK #-} !Int !(Poke ()) data Encode = Encode {-# UNPACK #-} !Int !(Poke ())
instance Semigroup Encode where instance Sem.Semigroup Encode where
{-# INLINE (<>) #-} {-# INLINE (<>) #-}
(Encode len1 f1) <> (Encode len2 f2) = Encode (len1 + len2) (f1 *> f2) (Encode len1 f1) <> (Encode len2 f2) = Encode (len1 + len2) (f1 *> f2)
instance Monoid Encode where instance Monoid Encode where
{-# INLINE mempty #-} {-# INLINE mempty #-}
mempty = Encode 0 . Poke $ \_ offset -> pure (offset, ()) mempty = Encode 0 . Poke $ \_ offset -> pure (offset, ())
#if !(MIN_VERSION_base(4,11,0))
mappend = (Sem.<>)
#endif
instance Show Encode where instance Show Encode where
show (Encode len _) = "Encode instance of length " ++ show len show (Encode len _) = "Encode instance of length " ++ show len

22
stack-ghc8.2.2.yaml Normal file
View File

@ -0,0 +1,22 @@
# This file was automatically generated by 'stack init'
#
resolver: lts-11.22
packages:
- '.'
# Dependency packages to be pulled from upstream that are not in the resolver
# (e.g., acme-missiles-0.3)
extra-deps:
- socket-0.8.2.0
- socket-unix-0.2.0.0
# <<<<<<< HEAD
# =======
# - store-core-0.3
# - QuickCheck-2.9.2
# >>>>>>> QuickCheck tests for existing codecs
# Override default flag values for local packages and extra-deps
flags: {}
# Extra package databases containing global packages
extra-package-dbs: []

22
stack-ghc8.4.4.yaml Normal file
View File

@ -0,0 +1,22 @@
# This file was automatically generated by 'stack init'
#
resolver: lts-12.26
packages:
- '.'
# Dependency packages to be pulled from upstream that are not in the resolver
# (e.g., acme-missiles-0.3)
extra-deps:
- socket-0.8.2.0
- socket-unix-0.2.0.0
# <<<<<<< HEAD
# =======
# - store-core-0.3
# - QuickCheck-2.9.2
# >>>>>>> QuickCheck tests for existing codecs
# Override default flag values for local packages and extra-deps
flags: {}
# Extra package databases containing global packages
extra-package-dbs: []