persistent-test-2.0.0.3: Tests for Persistent

Safe HaskellNone
LanguageHaskell2010

Init

Contents

Synopsis

Documentation

(@/=) :: (Eq a, Show a, MonadIO m) => a -> a -> m () infix 1 Source #

(@==) :: (Eq a, Show a, MonadIO m) => a -> a -> m () infix 1 Source #

(==@) :: (Eq a, Show a, MonadIO m) => a -> a -> m () infix 1 Source #

assertNotEqual :: (Eq a, Show a) => String -> a -> a -> Assertion Source #

assertNotEmpty :: (Monad m, MonadIO m) => [a] -> m () Source #

assertEmpty :: (Monad m, MonadIO m) => [a] -> m () Source #

class Monad m => MonadIO (m :: * -> *) where #

Monads in which IO computations may be embedded. Any monad built by applying a sequence of monad transformers to the IO monad will be an instance of this class.

Instances should satisfy the following laws, which state that liftIO is a transformer of monads:

Minimal complete definition

liftIO

Methods

liftIO :: IO a -> m a #

Lift a computation from the IO monad.

Instances

MonadIO IO

Since: 4.9.0.0

Methods

liftIO :: IO a -> IO a #

MonadIO m => MonadIO (ResourceT m) 

Methods

liftIO :: IO a -> ResourceT m a #

MonadIO m => MonadIO (NoLoggingT m) 

Methods

liftIO :: IO a -> NoLoggingT m a #

MonadIO m => MonadIO (WriterLoggingT m) 

Methods

liftIO :: IO a -> WriterLoggingT m a #

MonadIO m => MonadIO (LoggingT m) 

Methods

liftIO :: IO a -> LoggingT m a #

(Monoid w, MonadIO m) => MonadIO (WriterT w m) 

Methods

liftIO :: IO a -> WriterT w m a #

(Error e, MonadIO m) => MonadIO (ErrorT e m) 

Methods

liftIO :: IO a -> ErrorT e m a #

MonadIO m => MonadIO (IdentityT * m) 

Methods

liftIO :: IO a -> IdentityT * m a #

MonadIO m => MonadIO (ReaderT * r m) 

Methods

liftIO :: IO a -> ReaderT * r m a #

MonadIO m => MonadIO (ConduitT i o m) 

Methods

liftIO :: IO a -> ConduitT i o m a #

MonadIO m => MonadIO (Pipe l i o u m) 

Methods

liftIO :: IO a -> Pipe l i o u m a #

data MkPersistSettings :: * #

Settings to be passed to the mkPersist function.

(<$>) :: Functor f => (a -> b) -> f a -> f b infixl 4 #

An infix synonym for fmap.

The name of this operator is an allusion to $. Note the similarities between their types:

 ($)  ::              (a -> b) ->   a ->   b
(<$>) :: Functor f => (a -> b) -> f a -> f b

Whereas $ is function application, <$> is function application lifted over a Functor.

Examples

Convert from a Maybe Int to a Maybe String using show:

>>> show <$> Nothing
Nothing
>>> show <$> Just 3
Just "3"

Convert from an Either Int Int to an Either Int String using show:

>>> show <$> Left 17
Left 17
>>> show <$> Right 17
Right "17"

Double each element of a list:

>>> (*2) <$> [1,2,3]
[2,4,6]

Apply even to the second element of a pair:

>>> even <$> (2,2)
(2,True)

(<*>) :: Applicative f => forall a b. f (a -> b) -> f a -> f b infixl 4 #

Sequential application.

A few functors support an implementation of <*> that is more efficient than the default one.

module Test.Hspec

module Test.HUnit

liftIO :: MonadIO m => forall a. IO a -> m a #

Lift a computation from the IO monad.

mkPersist :: MkPersistSettings -> [EntityDef] -> Q [Dec] #

Create data types and appropriate PersistEntity instances for the given EntityDefs. Works well with the persist quasi-quoter.

mkMigrate :: String -> [EntityDef] -> Q [Dec] #

Creates a single function to perform all migrations for the entities defined here. One thing to be aware of is dependencies: if you have entities with foreign references, make sure to place those definitions after the entities they reference.

share :: [[EntityDef] -> Q [Dec]] -> [EntityDef] -> Q [Dec] #

Apply the given list of functions to the same EntityDefs.

This function is useful for cases such as:

>>> share [mkSave "myDefs", mkPersist sqlSettings] [persistLowerCase|...|]

sqlSettings :: MkPersistSettings #

Use the SqlPersist backend.

data Int32 :: * #

32-bit signed integer type

Instances

Bounded Int32

Since: 2.1

Enum Int32

Since: 2.1

Eq Int32

Since: 2.1

Methods

(==) :: Int32 -> Int32 -> Bool #

(/=) :: Int32 -> Int32 -> Bool #

Integral Int32

Since: 2.1

Num Int32

Since: 2.1

Ord Int32

Since: 2.1

Methods

compare :: Int32 -> Int32 -> Ordering #

(<) :: Int32 -> Int32 -> Bool #

(<=) :: Int32 -> Int32 -> Bool #

(>) :: Int32 -> Int32 -> Bool #

(>=) :: Int32 -> Int32 -> Bool #

max :: Int32 -> Int32 -> Int32 #

min :: Int32 -> Int32 -> Int32 #

Read Int32

Since: 2.1

Real Int32

Since: 2.1

Methods

toRational :: Int32 -> Rational #

Show Int32

Since: 2.1

Methods

showsPrec :: Int -> Int32 -> ShowS #

show :: Int32 -> String #

showList :: [Int32] -> ShowS #

Ix Int32

Since: 2.1

Lift Int32 

Methods

lift :: Int32 -> Q Exp #

Arbitrary Int32 

Methods

arbitrary :: Gen Int32 #

shrink :: Int32 -> [Int32] #

CoArbitrary Int32 

Methods

coarbitrary :: Int32 -> Gen b -> Gen b #

Hashable Int32 

Methods

hashWithSalt :: Int -> Int32 -> Int #

hash :: Int32 -> Int #

ToJSON Int32 
ToJSONKey Int32 
FromJSON Int32 
FromJSONKey Int32 
Storable Int32

Since: 2.1

Methods

sizeOf :: Int32 -> Int #

alignment :: Int32 -> Int #

peekElemOff :: Ptr Int32 -> Int -> IO Int32 #

pokeElemOff :: Ptr Int32 -> Int -> Int32 -> IO () #

peekByteOff :: Ptr b -> Int -> IO Int32 #

pokeByteOff :: Ptr b -> Int -> Int32 -> IO () #

peek :: Ptr Int32 -> IO Int32 #

poke :: Ptr Int32 -> Int32 -> IO () #

Bits Int32

Since: 2.1

FiniteBits Int32

Since: 4.6.0.0

ToValue Int32 
ToMarkup Int32 
ToHttpApiData Int32 
FromHttpApiData Int32 
PathPiece Int32 
PersistFieldSql Int32 

Methods

sqlType :: Proxy * Int32 -> SqlType #

PersistField Int32 
Prim Int32 
Random Int32 

Methods

randomR :: RandomGen g => (Int32, Int32) -> g -> (Int32, g) #

random :: RandomGen g => g -> (Int32, g) #

randomRs :: RandomGen g => (Int32, Int32) -> g -> [Int32] #

randoms :: RandomGen g => g -> [Int32] #

randomRIO :: (Int32, Int32) -> IO Int32 #

randomIO :: IO Int32 #

Unbox Int32 
Vector Vector Int32 
MVector MVector Int32 
data Vector Int32 
data MVector s Int32 

data Int64 :: * #

64-bit signed integer type

Instances

Bounded Int64

Since: 2.1

Enum Int64

Since: 2.1

Eq Int64

Since: 2.1

Methods

(==) :: Int64 -> Int64 -> Bool #

(/=) :: Int64 -> Int64 -> Bool #

Integral Int64

Since: 2.1

Num Int64

Since: 2.1

Ord Int64

Since: 2.1

Methods

compare :: Int64 -> Int64 -> Ordering #

(<) :: Int64 -> Int64 -> Bool #

(<=) :: Int64 -> Int64 -> Bool #

(>) :: Int64 -> Int64 -> Bool #

(>=) :: Int64 -> Int64 -> Bool #

max :: Int64 -> Int64 -> Int64 #

min :: Int64 -> Int64 -> Int64 #

Read Int64

Since: 2.1

Real Int64

Since: 2.1

Methods

toRational :: Int64 -> Rational #

Show Int64

Since: 2.1

Methods

showsPrec :: Int -> Int64 -> ShowS #

show :: Int64 -> String #

showList :: [Int64] -> ShowS #

Ix Int64

Since: 2.1

Lift Int64 

Methods

lift :: Int64 -> Q Exp #

Arbitrary Int64 

Methods

arbitrary :: Gen Int64 #

shrink :: Int64 -> [Int64] #

CoArbitrary Int64 

Methods

coarbitrary :: Int64 -> Gen b -> Gen b #

Hashable Int64 

Methods

hashWithSalt :: Int -> Int64 -> Int #

hash :: Int64 -> Int #

ToJSON Int64 
ToJSONKey Int64 
FromJSON Int64 
FromJSONKey Int64 
Storable Int64

Since: 2.1

Methods

sizeOf :: Int64 -> Int #

alignment :: Int64 -> Int #

peekElemOff :: Ptr Int64 -> Int -> IO Int64 #

pokeElemOff :: Ptr Int64 -> Int -> Int64 -> IO () #

peekByteOff :: Ptr b -> Int -> IO Int64 #

pokeByteOff :: Ptr b -> Int -> Int64 -> IO () #

peek :: Ptr Int64 -> IO Int64 #

poke :: Ptr Int64 -> Int64 -> IO () #

Bits Int64

Since: 2.1

FiniteBits Int64

Since: 4.6.0.0

ToValue Int64 
ToMarkup Int64 
ToHttpApiData Int64 
FromHttpApiData Int64 
PathPiece Int64 
PersistFieldSql Int64 

Methods

sqlType :: Proxy * Int64 -> SqlType #

PersistField Int64 
Prim Int64 
Random Int64 

Methods

randomR :: RandomGen g => (Int64, Int64) -> g -> (Int64, g) #

random :: RandomGen g => g -> (Int64, g) #

randomRs :: RandomGen g => (Int64, Int64) -> g -> [Int64] #

randoms :: RandomGen g => g -> [Int64] #

randomRIO :: (Int64, Int64) -> IO Int64 #

randomIO :: IO Int64 #

Unbox Int64 
Vector Vector Int64 
MVector MVector Int64 
data Vector Int64 
data MVector s Int64 

data Text :: * #

A space efficient, packed, unboxed Unicode text type.

Instances

Hashable Text 

Methods

hashWithSalt :: Int -> Text -> Int #

hash :: Text -> Int #

ToJSON Text 
KeyValue Pair 

Methods

(.=) :: ToJSON v => Text -> v -> Pair #

ToJSONKey Text 
FromJSON Text 
FromJSONKey Text 
Chunk Text 
ToValue Text 
ToMarkup Text 
ToLogStr Text 

Methods

toLogStr :: Text -> LogStr #

ToHttpApiData Text 
FromHttpApiData Text 
PathPiece Text 
PersistFieldSql Text 

Methods

sqlType :: Proxy * Text -> SqlType #

PersistField Text 
Lift' Text 

Methods

lift' :: Text -> Q Exp

FromPairs Value (DList Pair) 

Methods

fromPairs :: DList Pair -> Value

ToJSON v => GKeyValue v (DList Pair) 

Methods

gPair :: String -> v -> DList Pair

PersistFieldSql v => PersistFieldSql (Map Text v) 

Methods

sqlType :: Proxy * (Map Text v) -> SqlType #

PersistField v => PersistField (Map Text v) 
type State Text 
type State Text = Buffer
type ChunkElem Text 
type Item Text 
type Item Text = Char

data ByteString :: * #

A space-efficient representation of a Word8 vector, supporting many efficient operations.

A ByteString contains 8-bit bytes, or by using the operations from Data.ByteString.Char8 it can be interpreted as containing 8-bit characters.

Instances

Eq ByteString 
Data ByteString 

Methods

gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> ByteString -> c ByteString #

gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c ByteString #

toConstr :: ByteString -> Constr #

dataTypeOf :: ByteString -> DataType #

dataCast1 :: Typeable (* -> *) t => (forall d. Data d => c (t d)) -> Maybe (c ByteString) #

dataCast2 :: Typeable (* -> * -> *) t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c ByteString) #

gmapT :: (forall b. Data b => b -> b) -> ByteString -> ByteString #

gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> ByteString -> r #

gmapQr :: (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> ByteString -> r #

gmapQ :: (forall d. Data d => d -> u) -> ByteString -> [u] #

gmapQi :: Int -> (forall d. Data d => d -> u) -> ByteString -> u #

gmapM :: Monad m => (forall d. Data d => d -> m d) -> ByteString -> m ByteString #

gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> ByteString -> m ByteString #

gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> ByteString -> m ByteString #

Ord ByteString 
Read ByteString 
Show ByteString 
IsString ByteString 
Semigroup ByteString 
Monoid ByteString 
Hashable ByteString 
Chunk ByteString 
NFData ByteString 

Methods

rnf :: ByteString -> () #

ToLogStr ByteString 
PersistFieldSql ByteString 
PersistField ByteString 
type State ByteString 
type State ByteString = Buffer
type ChunkElem ByteString 

data SomeException :: * #

The SomeException type is the root of the exception type hierarchy. When an exception of type e is thrown, behind the scenes it is encapsulated in a SomeException.

Orphan instances