module PostgreSQLBinary.Prelude
(
module Exports,
LazyByteString,
LazyText,
bug,
bottom,
partial,
)
where
import BasePrelude as Exports
import MTLPrelude as Exports hiding (shift)
import Data.Text as Exports (Text)
import Data.ByteString as Exports (ByteString)
import Data.Scientific as Exports (Scientific)
import Data.UUID as Exports (UUID)
import Data.Time as Exports
import Development.Placeholders as Exports
import qualified Debug.Trace.LocationTH
import qualified Data.Text.Lazy
import qualified Data.ByteString.Lazy
type LazyByteString = Data.ByteString.Lazy.ByteString
type LazyText = Data.Text.Lazy.Text
bug = [e| $(Debug.Trace.LocationTH.failure) . (msg <>) |]
where
msg = "A \"postgresql-binary\" package bug: " :: String
bottom = [e| $bug "Bottom evaluated" |]
partial :: Alternative f => (a -> Bool) -> a -> f a
partial p x =
if p x then pure x else empty