mirror of
https://github.com/postgres-haskell/postgres-wire.git
synced 2024-11-21 20:20:16 +03:00
build for 8.2.2 & 8.4.4 with cpp
This commit is contained in:
parent
2a10e6c21a
commit
1a8c40e505
@ -1,3 +1,4 @@
|
||||
{-# LANGUAGE CPP #-}
|
||||
module Database.PostgreSQL.Protocol.Store.Encode
|
||||
( Encode
|
||||
, getEncodeLen
|
||||
@ -26,15 +27,21 @@ import Data.ByteString.Internal (toForeignPtr)
|
||||
import Data.Store.Core (Poke(..), unsafeEncodeWith, pokeStatePtr,
|
||||
pokeFromForeignPtr)
|
||||
|
||||
import qualified Data.Semigroup as Sem
|
||||
|
||||
data Encode = Encode {-# UNPACK #-} !Int !(Poke ())
|
||||
|
||||
instance Semigroup Encode where
|
||||
instance Sem.Semigroup Encode where
|
||||
{-# INLINE (<>) #-}
|
||||
(Encode len1 f1) <> (Encode len2 f2) = Encode (len1 + len2) (f1 *> f2)
|
||||
|
||||
instance Monoid Encode where
|
||||
{-# INLINE mempty #-}
|
||||
mempty = Encode 0 . Poke $ \_ offset -> pure (offset, ())
|
||||
#if !(MIN_VERSION_base(4,11,0))
|
||||
mappend = (Sem.<>)
|
||||
#endif
|
||||
|
||||
|
||||
instance Show Encode where
|
||||
show (Encode len _) = "Encode instance of length " ++ show len
|
||||
|
22
stack-ghc8.2.2.yaml
Normal file
22
stack-ghc8.2.2.yaml
Normal 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
22
stack-ghc8.4.4.yaml
Normal 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: []
|
Loading…
Reference in New Issue
Block a user