prolude 0.0.0.19 → 0.0.0.20
raw patch · 11 files changed
+124/−27 lines, 11 filesdep +esqueletodep +stmdep +witchdep ~servantPVP: minor bump suggested
API additions: PVP suggests at least a minor version bump
Dependencies added: esqueleto, stm, witch
Dependency ranges changed: servant
API changes (from Hackage documentation)
+ Prolude.Core: stm :: MonadIO m => STM a -> m a
+ Prolude.Esqueleto: (!=.) :: PersistField typ => SqlExpr (Value typ) -> SqlExpr (Value typ) -> SqlExpr (Value Bool)
+ Prolude.Esqueleto: (&&.) :: SqlExpr (Value Bool) -> SqlExpr (Value Bool) -> SqlExpr (Value Bool)
+ Prolude.Esqueleto: (<.) :: PersistField typ => SqlExpr (Value typ) -> SqlExpr (Value typ) -> SqlExpr (Value Bool)
+ Prolude.Esqueleto: (<=.) :: PersistField typ => SqlExpr (Value typ) -> SqlExpr (Value typ) -> SqlExpr (Value Bool)
+ Prolude.Esqueleto: (=.) :: (PersistEntity val, PersistField typ) => EntityField val typ -> SqlExpr (Value typ) -> SqlExpr (Entity val) -> SqlExpr Update
+ Prolude.Esqueleto: (==.) :: PersistField typ => SqlExpr (Value typ) -> SqlExpr (Value typ) -> SqlExpr (Value Bool)
+ Prolude.Esqueleto: (>.) :: PersistField typ => SqlExpr (Value typ) -> SqlExpr (Value typ) -> SqlExpr (Value Bool)
+ Prolude.Esqueleto: (>=.) :: PersistField typ => SqlExpr (Value typ) -> SqlExpr (Value typ) -> SqlExpr (Value Bool)
+ Prolude.Esqueleto: (?.) :: (PersistEntity val, PersistField typ) => SqlExpr (Maybe (Entity val)) -> EntityField val typ -> SqlExpr (Value (Maybe typ))
+ Prolude.Esqueleto: (^.) :: forall typ val. (PersistEntity val, PersistField typ) => SqlExpr (Entity val) -> EntityField val typ -> SqlExpr (Value typ)
+ Prolude.Esqueleto: (||.) :: SqlExpr (Value Bool) -> SqlExpr (Value Bool) -> SqlExpr (Value Bool)
+ Prolude.Esqueleto: data a :& b
+ Prolude.Esqueleto: infix 4 ==.
+ Prolude.Esqueleto: infixl 2 :&
+ Prolude.Esqueleto: infixl 9 ^.
+ Prolude.Esqueleto: infixr 2 ||.
+ Prolude.Esqueleto: infixr 3 &&.
+ Prolude.MongoDB: (!<-:) :: MongoVal v => MongoLabel -> [v] -> MongoField
+ Prolude.MongoDB: (!=:) :: MongoVal v => MongoLabel -> v -> MongoField
+ Prolude.MongoDB: (<-:) :: MongoVal v => MongoLabel -> [v] -> MongoField
+ Prolude.MongoDB: (<:) :: MongoVal v => MongoLabel -> v -> MongoField
+ Prolude.MongoDB: (<=:) :: MongoVal v => MongoLabel -> v -> MongoField
+ Prolude.MongoDB: (>:) :: MongoVal v => MongoLabel -> v -> MongoField
+ Prolude.MongoDB: (>=:) :: MongoVal v => MongoLabel -> v -> MongoField
+ Prolude.Persist: SqlBlob :: SqlType
+ Prolude.Persist: SqlBool :: SqlType
+ Prolude.Persist: SqlDay :: SqlType
+ Prolude.Persist: SqlDayTime :: SqlType
+ Prolude.Persist: SqlInt32 :: SqlType
+ Prolude.Persist: SqlInt64 :: SqlType
+ Prolude.Persist: SqlNumeric :: Word32 -> Word32 -> SqlType
+ Prolude.Persist: SqlOther :: Text -> SqlType
+ Prolude.Persist: SqlReal :: SqlType
+ Prolude.Persist: SqlString :: SqlType
+ Prolude.Persist: SqlTime :: SqlType
+ Prolude.Persist: class PersistField a
+ Prolude.Persist: class PersistField a => PersistFieldSql a
+ Prolude.Persist: data SqlType
+ Prolude.Persist: exists :: forall (m :: Type -> Type) record. (PersistQueryRead backend, MonadIO m, PersistRecordBackend record backend) => [Filter record] -> ReaderT backend m Bool
+ Prolude.Persist: fromPersistValue :: PersistField a => PersistValue -> Either Text a
+ Prolude.Persist: insert :: forall record (m :: Type -> Type). (PersistStoreWrite backend, MonadIO m, PersistRecordBackend record backend) => record -> ReaderT backend m (Key record)
+ Prolude.Persist: insertMany_ :: forall record (m :: Type -> Type). (PersistStoreWrite backend, MonadIO m, PersistRecordBackend record backend) => [record] -> ReaderT backend m ()
+ Prolude.Persist: selectList :: forall record backend (m :: Type -> Type). (MonadIO m, PersistQueryRead backend, PersistRecordBackend record backend) => [Filter record] -> [SelectOpt record] -> ReaderT backend m [Entity record]
+ Prolude.Persist: toPersistValue :: PersistField a => a -> PersistValue
+ Prolude.Persist: type SqlPersistT = ReaderT SqlBackend
Files
- Prolude.hs +2/−0
- Prolude/Core.hs +13/−1
- Prolude/Csv.hs +11/−11
- Prolude/Esqueleto.hs +25/−0
- Prolude/Maybe.hs +4/−4
- Prolude/Monad.hs +2/−2
- Prolude/MongoDB.hs +34/−0
- Prolude/Persist.hs +23/−5
- Prolude/Prim.hs +2/−1
- Prolude/Swagger.hs +2/−1
- prolude.cabal +6/−2
Prolude.hs view
@@ -11,6 +11,7 @@ , module Prolude.ByteString , module Prolude.Core , module Prolude.Csv+ , module Prolude.Esqueleto , module Prolude.Exception , module Prolude.Foldable , module Prolude.Json@@ -36,6 +37,7 @@ import Prolude.ByteString import Prolude.Core import Prolude.Csv+import Prolude.Esqueleto import Prolude.Exception import Prolude.Foldable import Prolude.Json
Prolude/Core.hs view
@@ -40,22 +40,28 @@ , module Data.Word -- * Tuple re-exports , module Data.Tuple+ -- * Witch re-exports+ , module Witch -- * Identity , identity+ , stm ) where import Control.Applicative (Applicative(pure, (*>), (<*), (<*>))) import Control.Monad (Monad((>>), (>>=))) import Control.Monad.Fail (MonadFail(fail))+import Control.Concurrent.STM (STM, atomically)+import Control.Monad.IO.Class (MonadIO, liftIO) import Data.Bool (Bool(False, True), not, otherwise, (&&), (||)) import Data.Bifunctor (Bifunctor(bimap, first, second)) import Data.Char (Char, chr, ord)+import Data.Coerce (coerce) import Data.Either (Either(Left, Right), either) import Data.Eq (Eq((/=), (==))) import Data.Foldable (Foldable(elem, foldMap, foldr, length, null, sum), all, and, any, concat, concatMap, mapM_, or)-import Data.Function ((&))+import Data.Function ((&), (.)) import Data.Functor (Functor(fmap, (<$)), (<$>)) import Data.Int (Int) import Data.Kind (Constraint, Type)@@ -110,9 +116,15 @@ , (^^) ) import GHC.Show (Show, show)+import GHC.Stack (HasCallStack)+import Numeric.Natural (Natural) import System.IO (FilePath, IO, print, putStr, putStrLn) import Text.Read (Read, read)+import Witch identity :: a -> a identity x = x {-# INLINE identity #-}++stm :: MonadIO m => STM a -> m a+stm = liftIO . atomically
Prolude/Csv.hs view
@@ -1,17 +1,17 @@ {-# LANGUAGE ConstraintKinds #-} module Prolude.Csv- ( -- * Csv re-exports- module Data.Csv- -- * Alias types- -- $alias- , FromCsvField- , ToCsvField- -- * Alias functions- -- $functions- , parseCsvField- , toCsvField- )+ ( -- * Csv re-exports+ module Data.Csv+ -- * Alias types+ -- $alias+ , FromCsvField+ , ToCsvField+ -- * Alias functions+ -- $functions+ , parseCsvField+ , toCsvField+ ) where import Data.Csv
+ Prolude/Esqueleto.hs view
@@ -0,0 +1,25 @@+module Prolude.Esqueleto + ( -- * Esqueleto re-exports+ -- $esqueleto+ module Database.Esqueleto.Experimental+ ) +where++import Database.Esqueleto.Experimental + ( (=.)+ , (==.)+ , (!=.)+ , (^.)+ , (?.)+ , (&&.)+ , (||.)+ , (<.)+ , (>.)+ , (>=.)+ , (<=.)+ , (:&)+ )++{- $esqueleto+These are our re-exports from Esqueleto. They include: (=.), (==.), (!=.), (^.), (?.), (&&.), (||.), (<.), (>.), (>=.), (<=.), and (:&)+-}
Prolude/Maybe.hs view
@@ -1,8 +1,8 @@ module Prolude.Maybe- ( module Data.Maybe- , note- , hush- )+ ( module Data.Maybe+ , note+ , hush+ ) where import Data.Maybe
Prolude/Monad.hs view
@@ -1,6 +1,6 @@ module Prolude.Monad - ( module Control.Monad - )+ ( module Control.Monad + ) where import Control.Monad
Prolude/MongoDB.hs view
@@ -44,6 +44,15 @@ , mongoModified , mongoSelect , mongoUpdateMany+ -- * Operators aliases+ -- $operators+ , (>=:)+ , (>:)+ , (<=:)+ , (<:)+ , (<-:)+ , (!<-:)+ , (!=:) ) where @@ -68,6 +77,10 @@ We created aliases for specific Mongo functions. These include: failed, insert_, nModified, select, and updateMany. -} +{- $operators+We created aliases for specific Mongo operators. These include: (>=:), (>:), (<=:), (<:), (<-:), (!<-:), and (!=:).+-}+ type MongoAction = Mongo.Action type MongoCollection = Mongo.Collection type MongoDatabase = Mongo.Database@@ -79,6 +92,27 @@ type MongoVal = Mongo.Val type MongoValue = Mongo.Value++(>=:) :: MongoVal v => MongoLabel -> v -> MongoField+f >=: x = f =: [(Text.pack "$gte") =: x]++(>:) :: MongoVal v => MongoLabel -> v -> MongoField+f >: x = f =: [(Text.pack "$gt") =: x]++(<=:) :: MongoVal v => MongoLabel -> v -> MongoField+f <=: x = f =: [(Text.pack "$lte") =: x]++(<:) :: MongoVal v => MongoLabel -> v -> MongoField+f <: x = f =: [(Text.pack "$lt") =: x]++(<-:) :: MongoVal v => MongoLabel -> [v] -> MongoField+f <-: x = f =: [(Text.pack "$in") =: x]++(!<-:) :: MongoVal v => MongoLabel -> [v] -> MongoField+f !<-: x = f =: [(Text.pack "$nin") =: x]++(!=:) :: MongoVal v => MongoLabel -> v -> MongoField+f !=: x = f =: [(Text.pack "$ne") =: x] pattern MongoFloat :: Double -> MongoValue pattern MongoFloat x = Mongo.Float x
Prolude/Persist.hs view
@@ -1,8 +1,26 @@ module Prolude.Persist - ( Entity(..)- , keyToOid- , oidToKey+ ( -- * Persist re-exports+ -- | These are our re-exports from Persist. They include: Entity(..), SqlType(..), exists, insert, insertMany_, and selectList+ module Database.Persist+ -- * Persist Field re-exports+ -- | This is our re-export of the PersistField class.+ , module Database.Persist.Class.PersistField+ -- * Persist MongoDB re-exports+ -- | These are our re-exports from Persist.MongoDB. They include: keyToOid and oidToKey+ , module Database.Persist.MongoDB+ -- * Persist Sql re-exports+ -- | These are our re-exports from Persist.Sql. They include: SqlPersistT and PersistFieldSql+ , module Database.Persist.Sql ) where -import Database.Persist-import Database.Persist.MongoDB+import Database.Persist + ( Entity(..)+ , SqlType(..)+ , exists+ , insert+ , insertMany_+ , selectList+ )+import Database.Persist.Class.PersistField (PersistField(fromPersistValue, toPersistValue))+import Database.Persist.MongoDB (keyToOid, oidToKey)+import Database.Persist.Sql (SqlPersistT, PersistFieldSql)
Prolude/Prim.hs view
@@ -7,7 +7,8 @@ , Int16 , Int32 , Int64- ) where+ ) +where import Data.Word (Word8, Word16, Word32, Word64) import Data.Int (Int8, Int16, Int32, Int64)
Prolude/Swagger.hs view
@@ -9,7 +9,8 @@ -- * Functions , defaultDeclareNamedSchema , nameSchema- ) where+ ) +where import qualified Data.Swagger as Swagger import qualified Data.Text as Text
prolude.cabal view
@@ -1,7 +1,7 @@ cabal-version: >= 1.10 name: prolude-version: 0.0.0.19+version: 0.0.0.20 synopsis: ITProTV's custom prelude description: Prolude is ITProTV's custom prelude.@@ -27,6 +27,7 @@ Prolude.ByteString Prolude.Core Prolude.Csv+ Prolude.Esqueleto Prolude.Exception Prolude.Foldable Prolude.Json@@ -52,6 +53,7 @@ , bytestring >= 0.10.10 && < 0.11 , cassava >= 0.5.2.0 && < 0.6 , containers >= 0.6.2 && < 0.7+ , esqueleto >= 3.5.3 && < 3.6 , generic-random >= 1.3.0 && < 1.5 , mongoDB >= 2.7.0 && < 2.8 , mtl >= 2.2.2 && < 2.3@@ -63,9 +65,11 @@ , persistent-mongoDB >= 2.8 && < 3 , safe-exceptions >= 0.1.7 && < 0.2 , scientific >= 0.3.6 && < 0.4- , servant >= 0.18.2 && < 0.19+ , servant >= 0.18.1 && < 0.19+ , stm >= 2.5.0 && < 2.6 , swagger2 >= 2.5 && < 2.7 , text >= 1.2.3 && < 1.3 , time >= 1.9.3 && < 1.10 , uuid >= 1.3.13 && < 1.4 , vector >= 0.12.1 && < 0.13+ , witch >= 0.3.4 && < 0.4