persistent-test-2.13.1.3: Tests for Persistent
Safe HaskellNone
LanguageHaskell2010

Init

Description

This will hopefully be the only module with CPP in it.

Synopsis

Documentation

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

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

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

asIO :: IO a -> IO a Source #

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

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

data MkPersistSettings #

Settings to be passed to the mkPersist function.

data family BackendKey backend #

Instances

Instances details
PersistStore backend => Arbitrary (BackendKey backend) Source # 
Instance details

Defined in Init

Methods

arbitrary :: Gen (BackendKey backend) #

shrink :: BackendKey backend -> [BackendKey backend] #

newtype BackendKey SqlReadBackend 
Instance details

Defined in Database.Persist.Sql.Orphan.PersistStore

newtype BackendKey SqlWriteBackend 
Instance details

Defined in Database.Persist.Sql.Orphan.PersistStore

newtype BackendKey SqlBackend 
Instance details

Defined in Database.Persist.Sql.Orphan.PersistStore

type Rep (BackendKey SqlReadBackend) 
Instance details

Defined in Database.Persist.Sql.Orphan.PersistStore

type Rep (BackendKey SqlReadBackend) = D1 ('MetaData "BackendKey" "Database.Persist.Sql.Orphan.PersistStore" "persistent-2.14.0.0-7UtOmfWImwl7HAs7HqmDQs" 'True) (C1 ('MetaCons "SqlReadBackendKey" 'PrefixI 'True) (S1 ('MetaSel ('Just "unSqlReadBackendKey") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Int64)))
type Rep (BackendKey SqlWriteBackend) 
Instance details

Defined in Database.Persist.Sql.Orphan.PersistStore

type Rep (BackendKey SqlWriteBackend) = D1 ('MetaData "BackendKey" "Database.Persist.Sql.Orphan.PersistStore" "persistent-2.14.0.0-7UtOmfWImwl7HAs7HqmDQs" 'True) (C1 ('MetaCons "SqlWriteBackendKey" 'PrefixI 'True) (S1 ('MetaSel ('Just "unSqlWriteBackendKey") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Int64)))
type Rep (BackendKey SqlBackend) 
Instance details

Defined in Database.Persist.Sql.Orphan.PersistStore

type Rep (BackendKey SqlBackend) = D1 ('MetaData "BackendKey" "Database.Persist.Sql.Orphan.PersistStore" "persistent-2.14.0.0-7UtOmfWImwl7HAs7HqmDQs" 'True) (C1 ('MetaCons "SqlBackendKey" 'PrefixI 'True) (S1 ('MetaSel ('Just "unSqlBackendKey") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Int64)))

class GenerateKey backend where Source #

Methods

generateKey :: IO (BackendKey backend) Source #

Instances

Instances details
GenerateKey SqlBackend Source # 
Instance details

Defined in Init

type RunDb backend m = ReaderT backend m () -> IO () Source #

module Test.Hspec

(@?=) infix 1 #

Arguments

:: (HasCallStack, Eq a, Show a) 
=> a

The actual value

-> a

The expected value

-> Assertion 

Asserts that the specified actual value is equal to the expected value (with the actual value on the left-hand side).

(@=?) infix 1 #

Arguments

:: (HasCallStack, Eq a, Show a) 
=> a

The expected value

-> a

The actual value

-> Assertion 

Asserts that the specified actual value is equal to the expected value (with the expected value on the left-hand side).

assertBool #

Arguments

:: HasCallStack 
=> String

The message that is displayed if the assertion fails

-> Bool

The condition

-> Assertion 

Asserts that the specified condition holds.

assertFailure #

Arguments

:: HasCallStack 
=> String

A message that is displayed with the assertion failure

-> IO a 

Unconditionally signals that a failure has occurred.

type Assertion = IO () #

When an assertion is evaluated, it will output a message if and only if the assertion fails.

Test cases are composed of a sequence of one or more assertions.

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

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

mkMigrate :: String -> [UnboundEntityDef] -> 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.

In persistent-2.13.0.0, this was changed to *ignore* the input entity def list, and instead defer to mkEntityDefList to get the correct entities. This avoids problems where the QuasiQuoter is unable to know what the right reference types are. This sets mkPersist to be the "single source of truth" for entity definitions.

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

Apply the given list of functions to the same EntityDefs.

This function is useful for cases such as:

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

sqlSettings :: MkPersistSettings #

Use the SqlPersist backend.

data Int32 #

32-bit signed integer type

Instances

Instances details
Bounded Int32

Since: base-2.1

Instance details

Defined in GHC.Int

Enum Int32

Since: base-2.1

Instance details

Defined in GHC.Int

Eq Int32

Since: base-2.1

Instance details

Defined in GHC.Int

Methods

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

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

Integral Int32

Since: base-2.1

Instance details

Defined in GHC.Int

Num Int32

Since: base-2.1

Instance details

Defined in GHC.Int

Ord Int32

Since: base-2.1

Instance details

Defined in GHC.Int

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: base-2.1

Instance details

Defined in GHC.Int

Real Int32

Since: base-2.1

Instance details

Defined in GHC.Int

Methods

toRational :: Int32 -> Rational #

Show Int32

Since: base-2.1

Instance details

Defined in GHC.Int

Methods

showsPrec :: Int -> Int32 -> ShowS #

show :: Int32 -> String #

showList :: [Int32] -> ShowS #

Ix Int32

Since: base-2.1

Instance details

Defined in GHC.Int

Function Int32 
Instance details

Defined in Test.QuickCheck.Function

Methods

function :: (Int32 -> b) -> Int32 :-> b #

Arbitrary Int32 
Instance details

Defined in Test.QuickCheck.Arbitrary

Methods

arbitrary :: Gen Int32 #

shrink :: Int32 -> [Int32] #

CoArbitrary Int32 
Instance details

Defined in Test.QuickCheck.Arbitrary

Methods

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

Hashable Int32 
Instance details

Defined in Data.Hashable.Class

Methods

hashWithSalt :: Int -> Int32 -> Int #

hash :: Int32 -> Int #

ToJSON Int32 
Instance details

Defined in Data.Aeson.Types.ToJSON

ToJSONKey Int32 
Instance details

Defined in Data.Aeson.Types.ToJSON

FromJSON Int32 
Instance details

Defined in Data.Aeson.Types.FromJSON

FromJSONKey Int32 
Instance details

Defined in Data.Aeson.Types.FromJSON

Storable Int32

Since: base-2.1

Instance details

Defined in Foreign.Storable

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: base-2.1

Instance details

Defined in GHC.Int

FiniteBits Int32

Since: base-4.6.0.0

Instance details

Defined in GHC.Int

ToValue Int32 
Instance details

Defined in Text.Blaze

ToMarkup Int32 
Instance details

Defined in Text.Blaze

ToHttpApiData Int32 
Instance details

Defined in Web.Internal.HttpApiData

FromHttpApiData Int32 
Instance details

Defined in Web.Internal.HttpApiData

PathPiece Int32 
Instance details

Defined in Web.PathPieces

PersistFieldSql Int32 
Instance details

Defined in Database.Persist.Sql.Class

Methods

sqlType :: Proxy Int32 -> SqlType #

PersistField Int32 
Instance details

Defined in Database.Persist.Class.PersistField

Prim Int32 
Instance details

Defined in Data.Primitive.Types

Random Int32 
Instance details

Defined in System.Random

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] #

Uniform Int32 
Instance details

Defined in System.Random.Internal

Methods

uniformM :: StatefulGen g m => g -> m Int32 #

UniformRange Int32 
Instance details

Defined in System.Random.Internal

Methods

uniformRM :: StatefulGen g m => (Int32, Int32) -> g -> m Int32 #

Unbox Int32 
Instance details

Defined in Data.Vector.Unboxed.Base

Lift Int32 
Instance details

Defined in Language.Haskell.TH.Syntax

Methods

lift :: Int32 -> Q Exp #

liftTyped :: Int32 -> Q (TExp Int32) #

Vector Vector Int32 
Instance details

Defined in Data.Vector.Unboxed.Base

MVector MVector Int32 
Instance details

Defined in Data.Vector.Unboxed.Base

SymbolToField "field8" Idempotency Int32 Source # 
Instance details

Defined in MigrationIdempotencyTest

SymbolToField "int32" (NumberGeneric backend) Int32 Source # 
Instance details

Defined in LargeNumberTest

newtype Vector Int32 
Instance details

Defined in Data.Vector.Unboxed.Base

newtype MVector s Int32 
Instance details

Defined in Data.Vector.Unboxed.Base

data Int64 #

64-bit signed integer type

Instances

Instances details
Bounded Int64

Since: base-2.1

Instance details

Defined in GHC.Int

Enum Int64

Since: base-2.1

Instance details

Defined in GHC.Int

Eq Int64

Since: base-2.1

Instance details

Defined in GHC.Int

Methods

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

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

Integral Int64

Since: base-2.1

Instance details

Defined in GHC.Int

Num Int64

Since: base-2.1

Instance details

Defined in GHC.Int

Ord Int64

Since: base-2.1

Instance details

Defined in GHC.Int

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: base-2.1

Instance details

Defined in GHC.Int

Real Int64

Since: base-2.1

Instance details

Defined in GHC.Int

Methods

toRational :: Int64 -> Rational #

Show Int64

Since: base-2.1

Instance details

Defined in GHC.Int

Methods

showsPrec :: Int -> Int64 -> ShowS #

show :: Int64 -> String #

showList :: [Int64] -> ShowS #

Ix Int64

Since: base-2.1

Instance details

Defined in GHC.Int

Function Int64 
Instance details

Defined in Test.QuickCheck.Function

Methods

function :: (Int64 -> b) -> Int64 :-> b #

Arbitrary Int64 
Instance details

Defined in Test.QuickCheck.Arbitrary

Methods

arbitrary :: Gen Int64 #

shrink :: Int64 -> [Int64] #

CoArbitrary Int64 
Instance details

Defined in Test.QuickCheck.Arbitrary

Methods

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

Hashable Int64 
Instance details

Defined in Data.Hashable.Class

Methods

hashWithSalt :: Int -> Int64 -> Int #

hash :: Int64 -> Int #

ToJSON Int64 
Instance details

Defined in Data.Aeson.Types.ToJSON

ToJSONKey Int64 
Instance details

Defined in Data.Aeson.Types.ToJSON

FromJSON Int64 
Instance details

Defined in Data.Aeson.Types.FromJSON

FromJSONKey Int64 
Instance details

Defined in Data.Aeson.Types.FromJSON

Storable Int64

Since: base-2.1

Instance details

Defined in Foreign.Storable

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: base-2.1

Instance details

Defined in GHC.Int

FiniteBits Int64

Since: base-4.6.0.0

Instance details

Defined in GHC.Int

ToValue Int64 
Instance details

Defined in Text.Blaze

ToMarkup Int64 
Instance details

Defined in Text.Blaze

ToHttpApiData Int64 
Instance details

Defined in Web.Internal.HttpApiData

FromHttpApiData Int64 
Instance details

Defined in Web.Internal.HttpApiData

PathPiece Int64 
Instance details

Defined in Web.PathPieces

PersistFieldSql Int64 
Instance details

Defined in Database.Persist.Sql.Class

Methods

sqlType :: Proxy Int64 -> SqlType #

PersistField Int64 
Instance details

Defined in Database.Persist.Class.PersistField

Prim Int64 
Instance details

Defined in Data.Primitive.Types

Random Int64 
Instance details

Defined in System.Random

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] #

Uniform Int64 
Instance details

Defined in System.Random.Internal

Methods

uniformM :: StatefulGen g m => g -> m Int64 #

UniformRange Int64 
Instance details

Defined in System.Random.Internal

Methods

uniformRM :: StatefulGen g m => (Int64, Int64) -> g -> m Int64 #

Unbox Int64 
Instance details

Defined in Data.Vector.Unboxed.Base

Lift Int64 
Instance details

Defined in Language.Haskell.TH.Syntax

Methods

lift :: Int64 -> Q Exp #

liftTyped :: Int64 -> Q (TExp Int64) #

Vector Vector Int64 
Instance details

Defined in Data.Vector.Unboxed.Base

MVector MVector Int64 
Instance details

Defined in Data.Vector.Unboxed.Base

SymbolToField "field1" Idempotency Int64 Source # 
Instance details

Defined in MigrationIdempotencyTest

SymbolToField "int64" (NumberGeneric backend) Int64 Source # 
Instance details

Defined in LargeNumberTest

newtype Vector Int64 
Instance details

Defined in Data.Vector.Unboxed.Base

newtype MVector s Int64 
Instance details

Defined in Data.Vector.Unboxed.Base

data Text #

A space efficient, packed, unboxed Unicode text type.

Instances

Instances details
Hashable Text 
Instance details

Defined in Data.Hashable.Class

Methods

hashWithSalt :: Int -> Text -> Int #

hash :: Text -> Int #

ToJSON Text 
Instance details

Defined in Data.Aeson.Types.ToJSON

ToJSONKey Text 
Instance details

Defined in Data.Aeson.Types.ToJSON

FromJSON Text 
Instance details

Defined in Data.Aeson.Types.FromJSON

FromJSONKey Text 
Instance details

Defined in Data.Aeson.Types.FromJSON

Chunk Text 
Instance details

Defined in Data.Attoparsec.Internal.Types

Associated Types

type ChunkElem Text #

ToValue Text 
Instance details

Defined in Text.Blaze

ToMarkup Text 
Instance details

Defined in Text.Blaze

ToHttpApiData Text 
Instance details

Defined in Web.Internal.HttpApiData

FromHttpApiData Text 
Instance details

Defined in Web.Internal.HttpApiData

SemiSequence Text 
Instance details

Defined in Data.Sequences

Associated Types

type Index Text #

IsSequence Text 
Instance details

Defined in Data.Sequences

Methods

fromList :: [Element Text] -> Text #

lengthIndex :: Text -> Index Text #

break :: (Element Text -> Bool) -> Text -> (Text, Text) #

span :: (Element Text -> Bool) -> Text -> (Text, Text) #

dropWhile :: (Element Text -> Bool) -> Text -> Text #

takeWhile :: (Element Text -> Bool) -> Text -> Text #

splitAt :: Index Text -> Text -> (Text, Text) #

unsafeSplitAt :: Index Text -> Text -> (Text, Text) #

take :: Index Text -> Text -> Text #

unsafeTake :: Index Text -> Text -> Text #

drop :: Index Text -> Text -> Text #

unsafeDrop :: Index Text -> Text -> Text #

dropEnd :: Index Text -> Text -> Text #

partition :: (Element Text -> Bool) -> Text -> (Text, Text) #

uncons :: Text -> Maybe (Element Text, Text) #

unsnoc :: Text -> Maybe (Text, Element Text) #

filter :: (Element Text -> Bool) -> Text -> Text #

filterM :: Monad m => (Element Text -> m Bool) -> Text -> m Text #

replicate :: Index Text -> Element Text -> Text #

replicateM :: Monad m => Index Text -> m (Element Text) -> m Text #

groupBy :: (Element Text -> Element Text -> Bool) -> Text -> [Text] #

groupAllOn :: Eq b => (Element Text -> b) -> Text -> [Text] #

subsequences :: Text -> [Text] #

permutations :: Text -> [Text] #

tailEx :: Text -> Text #

tailMay :: Text -> Maybe Text #

initEx :: Text -> Text #

initMay :: Text -> Maybe Text #

unsafeTail :: Text -> Text #

unsafeInit :: Text -> Text #

index :: Text -> Index Text -> Maybe (Element Text) #

indexEx :: Text -> Index Text -> Element Text #

unsafeIndex :: Text -> Index Text -> Element Text #

splitWhen :: (Element Text -> Bool) -> Text -> [Text] #

Textual Text 
Instance details

Defined in Data.Sequences

Methods

words :: Text -> [Text] #

unwords :: (Element seq ~ Text, MonoFoldable seq) => seq -> Text #

lines :: Text -> [Text] #

unlines :: (Element seq ~ Text, MonoFoldable seq) => seq -> Text #

toLower :: Text -> Text #

toUpper :: Text -> Text #

toCaseFold :: Text -> Text #

breakWord :: Text -> (Text, Text) #

breakLine :: Text -> (Text, Text) #

MonoFunctor Text 
Instance details

Defined in Data.MonoTraversable

Methods

omap :: (Element Text -> Element Text) -> Text -> Text #

MonoFoldable Text 
Instance details

Defined in Data.MonoTraversable

Methods

ofoldMap :: Monoid m => (Element Text -> m) -> Text -> m #

ofoldr :: (Element Text -> b -> b) -> b -> Text -> b #

ofoldl' :: (a -> Element Text -> a) -> a -> Text -> a #

otoList :: Text -> [Element Text] #

oall :: (Element Text -> Bool) -> Text -> Bool #

oany :: (Element Text -> Bool) -> Text -> Bool #

onull :: Text -> Bool #

olength :: Text -> Int #

olength64 :: Text -> Int64 #

ocompareLength :: Integral i => Text -> i -> Ordering #

otraverse_ :: Applicative f => (Element Text -> f b) -> Text -> f () #

ofor_ :: Applicative f => Text -> (Element Text -> f b) -> f () #

omapM_ :: Applicative m => (Element Text -> m ()) -> Text -> m () #

oforM_ :: Applicative m => Text -> (Element Text -> m ()) -> m () #

ofoldlM :: Monad m => (a -> Element Text -> m a) -> a -> Text -> m a #

ofoldMap1Ex :: Semigroup m => (Element Text -> m) -> Text -> m #

ofoldr1Ex :: (Element Text -> Element Text -> Element Text) -> Text -> Element Text #

ofoldl1Ex' :: (Element Text -> Element Text -> Element Text) -> Text -> Element Text #

headEx :: Text -> Element Text #

lastEx :: Text -> Element Text #

unsafeHead :: Text -> Element Text #

unsafeLast :: Text -> Element Text #

maximumByEx :: (Element Text -> Element Text -> Ordering) -> Text -> Element Text #

minimumByEx :: (Element Text -> Element Text -> Ordering) -> Text -> Element Text #

oelem :: Element Text -> Text -> Bool #

onotElem :: Element Text -> Text -> Bool #

MonoTraversable Text 
Instance details

Defined in Data.MonoTraversable

Methods

otraverse :: Applicative f => (Element Text -> f (Element Text)) -> Text -> f Text #

omapM :: Applicative m => (Element Text -> m (Element Text)) -> Text -> m Text #

MonoPointed Text 
Instance details

Defined in Data.MonoTraversable

Methods

opoint :: Element Text -> Text #

GrowingAppend Text 
Instance details

Defined in Data.MonoTraversable

PathPiece Text 
Instance details

Defined in Web.PathPieces

PersistFieldSql Text 
Instance details

Defined in Database.Persist.Sql.Class

Methods

sqlType :: Proxy Text -> SqlType #

PersistField Text 
Instance details

Defined in Database.Persist.Class.PersistField

LazySequence Text Text 
Instance details

Defined in Data.Sequences

Utf8 Text ByteString 
Instance details

Defined in Data.Sequences

SymbolToField "field2" VaryingLengths Text Source # 
Instance details

Defined in MigrationColumnLengthTest

SymbolToField "field2" Idempotency Text Source # 
Instance details

Defined in MigrationIdempotencyTest

SymbolToField "field2" Target Text Source # 
Instance details

Defined in MigrationTest

SymbolToField "field2" Target1 Text Source # 
Instance details

Defined in MigrationTest

SymbolToField "field3" Idempotency Text Source # 
Instance details

Defined in MigrationIdempotencyTest

SymbolToField "field4" Idempotency Text Source # 
Instance details

Defined in MigrationIdempotencyTest

SymbolToField "field5" Idempotency Text Source # 
Instance details

Defined in MigrationIdempotencyTest

SymbolToField "field6" Idempotency Text Source # 
Instance details

Defined in MigrationIdempotencyTest

SymbolToField "name" Wombat Text Source # 
Instance details

Defined in TransactionLevelTest

SymbolToField "name" Tree Text Source # 
Instance details

Defined in TreeTest

SymbolToField "name" TestCheckmark Text Source # 
Instance details

Defined in UniqueTest

SymbolToField "statusText" Tweet Text Source # 
Instance details

Defined in CustomPrimaryKeyReferenceTest

SymbolToField "tweetUrl" TweetUrl Text Source # 
Instance details

Defined in CustomPrimaryKeyReferenceTest

SymbolToField "value" TestCheckmark Text Source # 
Instance details

Defined in UniqueTest

SymbolToField "finalUrl" TweetUrl (Maybe Text) Source # 
Instance details

Defined in CustomPrimaryKeyReferenceTest

SymbolToField "parent" Tree (Maybe Text) Source # 
Instance details

Defined in TreeTest

SymbolToField "attr" (UpsertByGeneric backend) Text Source # 
Instance details

Defined in PersistentTestModels

SymbolToField "attr" (UpsertGeneric backend) Text Source # 
Instance details

Defined in PersistentTestModels

SymbolToField "city" (UpsertByGeneric backend) Text Source # 
Instance details

Defined in PersistentTestModels

SymbolToField "email" (UpsertByGeneric backend) Text Source # 
Instance details

Defined in PersistentTestModels

SymbolToField "email" (UpsertGeneric backend) Text Source # 
Instance details

Defined in PersistentTestModels

SymbolToField "email" (EmailPTGeneric backend) Text Source # 
Instance details

Defined in PersistentTestModels

SymbolToField "extra" (UpsertGeneric backend) Text Source # 
Instance details

Defined in PersistentTestModels

SymbolToField "fullName" (LowerCaseTableGeneric backend) Text Source # 
Instance details

Defined in RenameTest

SymbolToField "ident" (UserPTGeneric backend) Text Source # 
Instance details

Defined in PersistentTestModels

SymbolToField "key" (KeyTableGeneric backend) Text Source # 
Instance details

Defined in RenameTest

SymbolToField "name" (ARecordGeneric backend) Text Source # 
Instance details

Defined in EntityEmbedTest

SymbolToField "name" (DudeWeirdColumnsGeneric backend) Text Source # 
Instance details

Defined in PersistentTestModels

SymbolToField "name" (MaybeOwnedPetGeneric backend) Text Source # 
Instance details

Defined in PersistentTestModels

SymbolToField "name" (PetGeneric backend) Text Source # 
Instance details

Defined in PersistentTestModels

SymbolToField "name" (PersonMaybeAgeGeneric backend) Text Source # 
Instance details

Defined in PersistentTestModels

SymbolToField "name" (Person1Generic backend) Text Source # 
Instance details

Defined in PersistentTestModels

SymbolToField "name" (PersonGeneric backend) Text Source # 
Instance details

Defined in PersistentTestModels

SymbolToField "name" (IdTableGeneric backend) Text Source # 
Instance details

Defined in RenameTest

SymbolToField "text" (RefTableGeneric backend) TextId Source # 
Instance details

Defined in RenameTest

SymbolToField "color" (PersonMayGeneric backend) (Maybe Text) Source # 
Instance details

Defined in PersistentTestModels

SymbolToField "color" (PersonGeneric backend) (Maybe Text) Source # 
Instance details

Defined in PersistentTestModels

SymbolToField "name" (PersonMayGeneric backend) (Maybe Text) Source # 
Instance details

Defined in PersistentTestModels

SymbolToField "password" (UserPTGeneric backend) (Maybe Text) Source # 
Instance details

Defined in PersistentTestModels

SymbolToField "verkey" (EmailPTGeneric backend) (Maybe Text) Source # 
Instance details

Defined in PersistentTestModels

PersistFieldSql v => PersistFieldSql (Map Text v) 
Instance details

Defined in Database.Persist.Sql.Class

Methods

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

PersistField v => PersistField (Map Text v) 
Instance details

Defined in Database.Persist.Class.PersistField

type State Text 
Instance details

Defined in Data.Attoparsec.Internal.Types

type State Text = Buffer
type ChunkElem Text 
Instance details

Defined in Data.Attoparsec.Internal.Types

type Item Text 
Instance details

Defined in Data.Text

type Item Text = Char
type Index Text 
Instance details

Defined in Data.Sequences

type Index Text = Int
type Element Text 
Instance details

Defined in Data.MonoTraversable

forM_ :: (Foldable t, Monad m) => t a -> (a -> m b) -> m () #

forM_ is mapM_ with its arguments flipped. For a version that doesn't ignore the results see forM.

As of base 4.8.0.0, forM_ is just for_, specialized to Monad.

unless :: Applicative f => Bool -> f () -> f () #

The reverse of when.

replicateM :: Applicative m => Int -> m a -> m [a] #

replicateM n act performs the action n times, gathering the results.

Using ApplicativeDo: 'replicateM 5 as' can be understood as the do expression

do a1 <- as
   a2 <- as
   a3 <- as
   a4 <- as
   a5 <- as
   pure [a1,a2,a3,a4,a5]

Note the Applicative constraint.

(>=>) :: Monad m => (a -> m b) -> (b -> m c) -> a -> m c infixr 1 #

Left-to-right composition of Kleisli arrows.

'(bs >=> cs) a' can be understood as the do expression

do b <- bs a
   cs b

void :: Functor f => f a -> f () #

void value discards or ignores the result of evaluation, such as the return value of an IO action.

Using ApplicativeDo: 'void as' can be understood as the do expression

do as
   pure ()

with an inferred Functor constraint.

Examples

Expand

Replace the contents of a Maybe Int with unit:

>>> void Nothing
Nothing
>>> void (Just 3)
Just ()

Replace the contents of an Either Int Int with unit, resulting in an Either Int ():

>>> void (Left 8675309)
Left 8675309
>>> void (Right 8675309)
Right ()

Replace every element of a list with unit:

>>> void [1,2,3]
[(),(),()]

Replace the second element of a pair with unit:

>>> void (1,2)
(1,())

Discard the result of an IO action:

>>> mapM print [1,2]
1
2
[(),()]
>>> void $ mapM print [1,2]
1
2

liftM :: Monad m => (a1 -> r) -> m a1 -> m r #

Promote a function to a monad.

when :: Applicative f => Bool -> f () -> f () #

Conditional execution of Applicative expressions. For example,

when debug (putStrLn "Debugging")

will output the string Debugging if the Boolean value debug is True, and otherwise do nothing.

class Monad m => MonadIO (m :: Type -> Type) 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:

Methods

liftIO :: IO a -> m a #

Lift a computation from the IO monad.

Instances

Instances details
MonadIO IO

Since: base-4.9.0.0

Instance details

Defined in Control.Monad.IO.Class

Methods

liftIO :: IO a -> IO a #

MonadIO Q 
Instance details

Defined in Language.Haskell.TH.Syntax

Methods

liftIO :: IO a -> Q a #

MonadIO m => MonadIO (MaybeT m) 
Instance details

Defined in Control.Monad.Trans.Maybe

Methods

liftIO :: IO a -> MaybeT m a #

MonadIO m => MonadIO (ResourceT m) 
Instance details

Defined in Control.Monad.Trans.Resource.Internal

Methods

liftIO :: IO a -> ResourceT m a #

MonadIO m => MonadIO (ListT m) 
Instance details

Defined in Control.Monad.Trans.List

Methods

liftIO :: IO a -> ListT m a #

MonadIO m => MonadIO (NoLoggingT m) 
Instance details

Defined in Control.Monad.Logger

Methods

liftIO :: IO a -> NoLoggingT m a #

MonadIO m => MonadIO (WriterLoggingT m) 
Instance details

Defined in Control.Monad.Logger

Methods

liftIO :: IO a -> WriterLoggingT m a #

MonadIO m => MonadIO (LoggingT m) 
Instance details

Defined in Control.Monad.Logger

Methods

liftIO :: IO a -> LoggingT m a #

MonadIO m => MonadIO (IdentityT m) 
Instance details

Defined in Control.Monad.Trans.Identity

Methods

liftIO :: IO a -> IdentityT m a #

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

Defined in Control.Monad.Trans.Writer.Strict

Methods

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

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

Defined in Control.Monad.Trans.Writer.Lazy

Methods

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

MonadIO m => MonadIO (StateT s m) 
Instance details

Defined in Control.Monad.Trans.State.Strict

Methods

liftIO :: IO a -> StateT s m a #

MonadIO m => MonadIO (StateT s m) 
Instance details

Defined in Control.Monad.Trans.State.Lazy

Methods

liftIO :: IO a -> StateT s m a #

MonadIO m => MonadIO (ReaderT r m) 
Instance details

Defined in Control.Monad.Trans.Reader

Methods

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

MonadIO m => MonadIO (ExceptT e m) 
Instance details

Defined in Control.Monad.Trans.Except

Methods

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

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

Defined in Control.Monad.Trans.Error

Methods

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

(Monoid w, Functor m, MonadIO m) => MonadIO (AccumT w m) 
Instance details

Defined in Control.Monad.Trans.Accum

Methods

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

MonadIO m => MonadIO (WriterT w m) 
Instance details

Defined in Control.Monad.Trans.Writer.CPS

Methods

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

MonadIO m => MonadIO (SelectT r m) 
Instance details

Defined in Control.Monad.Trans.Select

Methods

liftIO :: IO a -> SelectT r m a #

MonadIO m => MonadIO (ConduitT i o m) 
Instance details

Defined in Data.Conduit.Internal.Conduit

Methods

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

MonadIO m => MonadIO (ContT r m) 
Instance details

Defined in Control.Monad.Trans.Cont

Methods

liftIO :: IO a -> ContT r m a #

(Monoid w, MonadIO m) => MonadIO (RWST r w s m) 
Instance details

Defined in Control.Monad.Trans.RWS.Strict

Methods

liftIO :: IO a -> RWST r w s m a #

(Monoid w, MonadIO m) => MonadIO (RWST r w s m) 
Instance details

Defined in Control.Monad.Trans.RWS.Lazy

Methods

liftIO :: IO a -> RWST r w s m a #

MonadIO m => MonadIO (RWST r w s m) 
Instance details

Defined in Control.Monad.Trans.RWS.CPS

Methods

liftIO :: IO a -> RWST r w s m a #

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

Defined in Data.Conduit.Internal.Pipe

Methods

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

class MonadIO m => MonadUnliftIO (m :: Type -> Type) where #

Monads which allow their actions to be run in IO.

While MonadIO allows an IO action to be lifted into another monad, this class captures the opposite concept: allowing you to capture the monadic context. Note that, in order to meet the laws given below, the intuition is that a monad must have no monadic state, but may have monadic context. This essentially limits MonadUnliftIO to ReaderT and IdentityT transformers on top of IO.

Laws. For any value u returned by askUnliftIO, it must meet the monad transformer laws as reformulated for MonadUnliftIO:

  • unliftIO u . return = return
  • unliftIO u (m >>= f) = unliftIO u m >>= unliftIO u . f

Instances of MonadUnliftIO must also satisfy the idempotency law:

  • askUnliftIO >>= \u -> (liftIO . unliftIO u) m = m

This law showcases two properties. First, askUnliftIO doesn't change the monadic context, and second, liftIO . unliftIO u is equivalent to id IF called in the same monadic context as askUnliftIO.

Since: unliftio-core-0.1.0.0

Methods

withRunInIO :: ((forall a. m a -> IO a) -> IO b) -> m b #

Convenience function for capturing the monadic context and running an IO action with a runner function. The runner function is used to run a monadic action m in IO.

Since: unliftio-core-0.1.0.0

Instances

Instances details
MonadUnliftIO IO 
Instance details

Defined in Control.Monad.IO.Unlift

Methods

withRunInIO :: ((forall a. IO a -> IO a) -> IO b) -> IO b #

MonadUnliftIO m => MonadUnliftIO (ResourceT m)

Since: resourcet-1.1.10

Instance details

Defined in Control.Monad.Trans.Resource.Internal

Methods

withRunInIO :: ((forall a. ResourceT m a -> IO a) -> IO b) -> ResourceT m b #

MonadUnliftIO m => MonadUnliftIO (NoLoggingT m)

Since: monad-logger-0.3.26

Instance details

Defined in Control.Monad.Logger

Methods

withRunInIO :: ((forall a. NoLoggingT m a -> IO a) -> IO b) -> NoLoggingT m b #

MonadUnliftIO m => MonadUnliftIO (LoggingT m)

Since: monad-logger-0.3.26

Instance details

Defined in Control.Monad.Logger

Methods

withRunInIO :: ((forall a. LoggingT m a -> IO a) -> IO b) -> LoggingT m b #

MonadUnliftIO m => MonadUnliftIO (IdentityT m) 
Instance details

Defined in Control.Monad.IO.Unlift

Methods

withRunInIO :: ((forall a. IdentityT m a -> IO a) -> IO b) -> IdentityT m b #

MonadUnliftIO m => MonadUnliftIO (ReaderT r m) 
Instance details

Defined in Control.Monad.IO.Unlift

Methods

withRunInIO :: ((forall a. ReaderT r m a -> IO a) -> IO b) -> ReaderT r m b #

newtype UnliftIO (m :: Type -> Type) #

The ability to run any monadic action m a as IO a.

This is more precisely a natural transformation. We need to new datatype (instead of simply using a forall) due to lack of support in GHC for impredicative types.

Since: unliftio-core-0.1.0.0

Constructors

UnliftIO 

Fields

askUnliftIO :: MonadUnliftIO m => m (UnliftIO m) #

Capture the current monadic context, providing the ability to run monadic actions in IO.

See UnliftIO for an explanation of why we need a helper datatype here.

Prior to version 0.2.0.0 of this library, this was a method in the MonadUnliftIO type class. It was moved out due to https://github.com/fpco/unliftio/issues/55.

Since: unliftio-core-0.1.0.0

askRunInIO :: MonadUnliftIO m => m (m a -> IO a) #

Same as askUnliftIO, but returns a monomorphic function instead of a polymorphic newtype wrapper. If you only need to apply the transformation on one concrete type, this function can be more convenient.

Since: unliftio-core-0.1.0.0

withUnliftIO :: MonadUnliftIO m => (UnliftIO m -> IO a) -> m a #

Convenience function for capturing the monadic context and running an IO action. The UnliftIO newtype wrapper is rarely needed, so prefer withRunInIO to this function.

Since: unliftio-core-0.1.0.0

toIO :: MonadUnliftIO m => m a -> m (IO a) #

Convert an action in m to an action in IO.

Since: unliftio-core-0.1.0.0

wrappedWithRunInIO #

Arguments

:: MonadUnliftIO n 
=> (n b -> m b)

The wrapper, for instance IdentityT.

-> (forall a. m a -> n a)

The inverse, for instance runIdentityT.

-> ((forall a. m a -> IO a) -> IO b)

The actual function to invoke withRunInIO with.

-> m b 

A helper function for implementing MonadUnliftIO instances. Useful for the common case where you want to simply delegate to the underlying transformer.

Example

Expand
newtype AppT m a = AppT { unAppT :: ReaderT Int (ResourceT m) a }
  deriving (Functor, Applicative, Monad, MonadIO)
  -- Unfortunately, deriving MonadUnliftIO does not work.

instance MonadUnliftIO m => MonadUnliftIO (AppT m) where
  withRunInIO = wrappedWithRunInIO AppT unAppT

Since: unliftio-core-0.1.2.0

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

Instances details
Eq ByteString 
Instance details

Defined in Data.ByteString.Internal

Data ByteString 
Instance details

Defined in Data.ByteString.Internal

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 :: forall r r'. (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 
Instance details

Defined in Data.ByteString.Internal

Read ByteString 
Instance details

Defined in Data.ByteString.Internal

Show ByteString 
Instance details

Defined in Data.ByteString.Internal

IsString ByteString 
Instance details

Defined in Data.ByteString.Internal

Semigroup ByteString 
Instance details

Defined in Data.ByteString.Internal

Monoid ByteString 
Instance details

Defined in Data.ByteString.Internal

Hashable ByteString 
Instance details

Defined in Data.Hashable.Class

Chunk ByteString 
Instance details

Defined in Data.Attoparsec.Internal.Types

Associated Types

type ChunkElem ByteString #

NFData ByteString 
Instance details

Defined in Data.ByteString.Internal

Methods

rnf :: ByteString -> () #

SemiSequence ByteString 
Instance details

Defined in Data.Sequences

Associated Types

type Index ByteString #

IsSequence ByteString 
Instance details

Defined in Data.Sequences

Methods

fromList :: [Element ByteString] -> ByteString #

lengthIndex :: ByteString -> Index ByteString #

break :: (Element ByteString -> Bool) -> ByteString -> (ByteString, ByteString) #

span :: (Element ByteString -> Bool) -> ByteString -> (ByteString, ByteString) #

dropWhile :: (Element ByteString -> Bool) -> ByteString -> ByteString #

takeWhile :: (Element ByteString -> Bool) -> ByteString -> ByteString #

splitAt :: Index ByteString -> ByteString -> (ByteString, ByteString) #

unsafeSplitAt :: Index ByteString -> ByteString -> (ByteString, ByteString) #

take :: Index ByteString -> ByteString -> ByteString #

unsafeTake :: Index ByteString -> ByteString -> ByteString #

drop :: Index ByteString -> ByteString -> ByteString #

unsafeDrop :: Index ByteString -> ByteString -> ByteString #

dropEnd :: Index ByteString -> ByteString -> ByteString #

partition :: (Element ByteString -> Bool) -> ByteString -> (ByteString, ByteString) #

uncons :: ByteString -> Maybe (Element ByteString, ByteString) #

unsnoc :: ByteString -> Maybe (ByteString, Element ByteString) #

filter :: (Element ByteString -> Bool) -> ByteString -> ByteString #

filterM :: Monad m => (Element ByteString -> m Bool) -> ByteString -> m ByteString #

replicate :: Index ByteString -> Element ByteString -> ByteString #

replicateM :: Monad m => Index ByteString -> m (Element ByteString) -> m ByteString #

groupBy :: (Element ByteString -> Element ByteString -> Bool) -> ByteString -> [ByteString] #

groupAllOn :: Eq b => (Element ByteString -> b) -> ByteString -> [ByteString] #

subsequences :: ByteString -> [ByteString] #

permutations :: ByteString -> [ByteString] #

tailEx :: ByteString -> ByteString #

tailMay :: ByteString -> Maybe ByteString #

initEx :: ByteString -> ByteString #

initMay :: ByteString -> Maybe ByteString #

unsafeTail :: ByteString -> ByteString #

unsafeInit :: ByteString -> ByteString #

index :: ByteString -> Index ByteString -> Maybe (Element ByteString) #

indexEx :: ByteString -> Index ByteString -> Element ByteString #

unsafeIndex :: ByteString -> Index ByteString -> Element ByteString #

splitWhen :: (Element ByteString -> Bool) -> ByteString -> [ByteString] #

MonoFunctor ByteString 
Instance details

Defined in Data.MonoTraversable

MonoFoldable ByteString 
Instance details

Defined in Data.MonoTraversable

Methods

ofoldMap :: Monoid m => (Element ByteString -> m) -> ByteString -> m #

ofoldr :: (Element ByteString -> b -> b) -> b -> ByteString -> b #

ofoldl' :: (a -> Element ByteString -> a) -> a -> ByteString -> a #

otoList :: ByteString -> [Element ByteString] #

oall :: (Element ByteString -> Bool) -> ByteString -> Bool #

oany :: (Element ByteString -> Bool) -> ByteString -> Bool #

onull :: ByteString -> Bool #

olength :: ByteString -> Int #

olength64 :: ByteString -> Int64 #

ocompareLength :: Integral i => ByteString -> i -> Ordering #

otraverse_ :: Applicative f => (Element ByteString -> f b) -> ByteString -> f () #

ofor_ :: Applicative f => ByteString -> (Element ByteString -> f b) -> f () #

omapM_ :: Applicative m => (Element ByteString -> m ()) -> ByteString -> m () #

oforM_ :: Applicative m => ByteString -> (Element ByteString -> m ()) -> m () #

ofoldlM :: Monad m => (a -> Element ByteString -> m a) -> a -> ByteString -> m a #

ofoldMap1Ex :: Semigroup m => (Element ByteString -> m) -> ByteString -> m #

ofoldr1Ex :: (Element ByteString -> Element ByteString -> Element ByteString) -> ByteString -> Element ByteString #

ofoldl1Ex' :: (Element ByteString -> Element ByteString -> Element ByteString) -> ByteString -> Element ByteString #

headEx :: ByteString -> Element ByteString #

lastEx :: ByteString -> Element ByteString #

unsafeHead :: ByteString -> Element ByteString #

unsafeLast :: ByteString -> Element ByteString #

maximumByEx :: (Element ByteString -> Element ByteString -> Ordering) -> ByteString -> Element ByteString #

minimumByEx :: (Element ByteString -> Element ByteString -> Ordering) -> ByteString -> Element ByteString #

oelem :: Element ByteString -> ByteString -> Bool #

onotElem :: Element ByteString -> ByteString -> Bool #

MonoTraversable ByteString 
Instance details

Defined in Data.MonoTraversable

MonoPointed ByteString 
Instance details

Defined in Data.MonoTraversable

GrowingAppend ByteString 
Instance details

Defined in Data.MonoTraversable

PersistFieldSql ByteString 
Instance details

Defined in Database.Persist.Sql.Class

PersistField ByteString 
Instance details

Defined in Database.Persist.Class.PersistField

LazySequence ByteString ByteString 
Instance details

Defined in Data.Sequences

Utf8 Text ByteString 
Instance details

Defined in Data.Sequences

type State ByteString 
Instance details

Defined in Data.Attoparsec.Internal.Types

type State ByteString = Buffer
type ChunkElem ByteString 
Instance details

Defined in Data.Attoparsec.Internal.Types

type Index ByteString 
Instance details

Defined in Data.Sequences

type Element ByteString 
Instance details

Defined in Data.MonoTraversable

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.

Instances

Instances details
Show SomeException

Since: base-3.0

Instance details

Defined in GHC.Exception.Type

Exception SomeException

Since: base-3.0

Instance details

Defined in GHC.Exception.Type

class Monad m => MonadFail (m :: Type -> Type) #

When a value is bound in do-notation, the pattern on the left hand side of <- might not match. In this case, this class provides a function to recover.

A Monad without a MonadFail instance may only be used in conjunction with pattern that always match, such as newtypes, tuples, data types with only a single data constructor, and irrefutable patterns (~pat).

Instances of MonadFail should satisfy the following law: fail s should be a left zero for >>=,

fail s >>= f  =  fail s

If your Monad is also MonadPlus, a popular definition is

fail _ = mzero

Since: base-4.9.0.0

Minimal complete definition

fail

Instances

Instances details
MonadFail []

Since: base-4.9.0.0

Instance details

Defined in Control.Monad.Fail

Methods

fail :: String -> [a] #

MonadFail Maybe

Since: base-4.9.0.0

Instance details

Defined in Control.Monad.Fail

Methods

fail :: String -> Maybe a #

MonadFail IO

Since: base-4.9.0.0

Instance details

Defined in Control.Monad.Fail

Methods

fail :: String -> IO a #

MonadFail Q 
Instance details

Defined in Language.Haskell.TH.Syntax

Methods

fail :: String -> Q a #

MonadFail IResult 
Instance details

Defined in Data.Aeson.Types.Internal

Methods

fail :: String -> IResult a #

MonadFail Result 
Instance details

Defined in Data.Aeson.Types.Internal

Methods

fail :: String -> Result a #

MonadFail Parser 
Instance details

Defined in Data.Aeson.Types.Internal

Methods

fail :: String -> Parser a #

MonadFail ReadPrec

Since: base-4.9.0.0

Instance details

Defined in Text.ParserCombinators.ReadPrec

Methods

fail :: String -> ReadPrec a #

MonadFail ReadP

Since: base-4.9.0.0

Instance details

Defined in Text.ParserCombinators.ReadP

Methods

fail :: String -> ReadP a #

MonadFail DList 
Instance details

Defined in Data.DList.Internal

Methods

fail :: String -> DList a #

MonadFail SmallArray 
Instance details

Defined in Data.Primitive.SmallArray

Methods

fail :: String -> SmallArray a #

MonadFail Array 
Instance details

Defined in Data.Primitive.Array

Methods

fail :: String -> Array a #

MonadFail Vector

Since: vector-0.12.1.0

Instance details

Defined in Data.Vector

Methods

fail :: String -> Vector a #

MonadFail P

Since: base-4.9.0.0

Instance details

Defined in Text.ParserCombinators.ReadP

Methods

fail :: String -> P a #

MonadFail (ST s)

Since: base-4.11.0.0

Instance details

Defined in GHC.ST

Methods

fail :: String -> ST s a #

MonadFail (Parser i) 
Instance details

Defined in Data.Attoparsec.Internal.Types

Methods

fail :: String -> Parser i a #

MonadFail (ST s)

Since: base-4.10

Instance details

Defined in Control.Monad.ST.Lazy.Imp

Methods

fail :: String -> ST s a #

Monad m => MonadFail (MaybeT m) 
Instance details

Defined in Control.Monad.Trans.Maybe

Methods

fail :: String -> MaybeT m a #

MonadFail m => MonadFail (ResourceT m)

Since: resourcet-1.2.2

Instance details

Defined in Control.Monad.Trans.Resource.Internal

Methods

fail :: String -> ResourceT m a #

Monad m => MonadFail (ListT m) 
Instance details

Defined in Control.Monad.Trans.List

Methods

fail :: String -> ListT m a #

MonadFail m => MonadFail (NoLoggingT m)

Since: monad-logger-0.3.30

Instance details

Defined in Control.Monad.Logger

Methods

fail :: String -> NoLoggingT m a #

MonadFail m => MonadFail (LoggingT m)

Since: monad-logger-0.3.30

Instance details

Defined in Control.Monad.Logger

Methods

fail :: String -> LoggingT m a #

MonadFail f => MonadFail (Ap f)

Since: base-4.12.0.0

Instance details

Defined in Data.Monoid

Methods

fail :: String -> Ap f a #

MonadFail m => MonadFail (IdentityT m) 
Instance details

Defined in Control.Monad.Trans.Identity

Methods

fail :: String -> IdentityT m a #

(Monoid w, MonadFail m) => MonadFail (WriterT w m) 
Instance details

Defined in Control.Monad.Trans.Writer.Strict

Methods

fail :: String -> WriterT w m a #

(Monoid w, MonadFail m) => MonadFail (WriterT w m) 
Instance details

Defined in Control.Monad.Trans.Writer.Lazy

Methods

fail :: String -> WriterT w m a #

MonadFail m => MonadFail (StateT s m) 
Instance details

Defined in Control.Monad.Trans.State.Strict

Methods

fail :: String -> StateT s m a #

MonadFail m => MonadFail (StateT s m) 
Instance details

Defined in Control.Monad.Trans.State.Lazy

Methods

fail :: String -> StateT s m a #

MonadFail m => MonadFail (ReaderT r m) 
Instance details

Defined in Control.Monad.Trans.Reader

Methods

fail :: String -> ReaderT r m a #

MonadFail m => MonadFail (ExceptT e m) 
Instance details

Defined in Control.Monad.Trans.Except

Methods

fail :: String -> ExceptT e m a #

(Monad m, Error e) => MonadFail (ErrorT e m) 
Instance details

Defined in Control.Monad.Trans.Error

Methods

fail :: String -> ErrorT e m a #

(Monoid w, MonadFail m) => MonadFail (AccumT w m) 
Instance details

Defined in Control.Monad.Trans.Accum

Methods

fail :: String -> AccumT w m a #

MonadFail m => MonadFail (WriterT w m) 
Instance details

Defined in Control.Monad.Trans.Writer.CPS

Methods

fail :: String -> WriterT w m a #

MonadFail m => MonadFail (SelectT r m) 
Instance details

Defined in Control.Monad.Trans.Select

Methods

fail :: String -> SelectT r m a #

MonadFail m => MonadFail (ConduitT i o m)

Since: conduit-1.3.1

Instance details

Defined in Data.Conduit.Internal.Conduit

Methods

fail :: String -> ConduitT i o m a #

MonadFail m => MonadFail (ContT r m) 
Instance details

Defined in Control.Monad.Trans.Cont

Methods

fail :: String -> ContT r m a #

(Monoid w, MonadFail m) => MonadFail (RWST r w s m) 
Instance details

Defined in Control.Monad.Trans.RWS.Strict

Methods

fail :: String -> RWST r w s m a #

(Monoid w, MonadFail m) => MonadFail (RWST r w s m) 
Instance details

Defined in Control.Monad.Trans.RWS.Lazy

Methods

fail :: String -> RWST r w s m a #

MonadFail m => MonadFail (RWST r w s m) 
Instance details

Defined in Control.Monad.Trans.RWS.CPS

Methods

fail :: String -> RWST r w s m a #

data TestFn entity where Source #

A datatype that wraps a function on entity that can has testable results.

Allows us to write:

foo :: entity -> entity -> [TestFn entity] -> Bool
foo e0 e1 = all ((TestFn msg f) -> f e0 == f e1)

Constructors

TestFn :: (Show a, Eq a) => String -> (entity -> a) -> TestFn entity 

liftA2 :: Applicative f => (a -> b -> c) -> f a -> f b -> f c #

Lift a binary function to actions.

Some functors support an implementation of liftA2 that is more efficient than the default one. In particular, if fmap is an expensive operation, it is likely better to use liftA2 than to fmap over the structure and then use <*>.

This became a typeclass method in 4.10.0.0. Prior to that, it was a function defined in terms of <*> and fmap.

Using ApplicativeDo: 'liftA2 f as bs' can be understood as the do expression

do a <- as
   b <- bs
   pure (f a b)

changeBackend :: forall backend backend' m. MonadUnliftIO m => (backend -> backend') -> RunDb backend m -> RunDb backend' m Source #

data Proxy (t :: k) #

Proxy is a type that holds no data, but has a phantom parameter of arbitrary type (or even kind). Its use is to provide type information, even though there is no value available of that type (or it may be too costly to create one).

Historically, Proxy :: Proxy a is a safer alternative to the undefined :: a idiom.

>>> Proxy :: Proxy (Void, Int -> Int)
Proxy

Proxy can even hold types of higher kinds,

>>> Proxy :: Proxy Either
Proxy
>>> Proxy :: Proxy Functor
Proxy
>>> Proxy :: Proxy complicatedStructure
Proxy

Constructors

Proxy 

Instances

Instances details
Generic1 (Proxy :: k -> Type)

Since: base-4.6.0.0

Instance details

Defined in GHC.Generics

Associated Types

type Rep1 Proxy :: k -> Type #

Methods

from1 :: forall (a :: k0). Proxy a -> Rep1 Proxy a #

to1 :: forall (a :: k0). Rep1 Proxy a -> Proxy a #

Monad (Proxy :: Type -> Type)

Since: base-4.7.0.0

Instance details

Defined in Data.Proxy

Methods

(>>=) :: Proxy a -> (a -> Proxy b) -> Proxy b #

(>>) :: Proxy a -> Proxy b -> Proxy b #

return :: a -> Proxy a #

Functor (Proxy :: Type -> Type)

Since: base-4.7.0.0

Instance details

Defined in Data.Proxy

Methods

fmap :: (a -> b) -> Proxy a -> Proxy b #

(<$) :: a -> Proxy b -> Proxy a #

Applicative (Proxy :: Type -> Type)

Since: base-4.7.0.0

Instance details

Defined in Data.Proxy

Methods

pure :: a -> Proxy a #

(<*>) :: Proxy (a -> b) -> Proxy a -> Proxy b #

liftA2 :: (a -> b -> c) -> Proxy a -> Proxy b -> Proxy c #

(*>) :: Proxy a -> Proxy b -> Proxy b #

(<*) :: Proxy a -> Proxy b -> Proxy a #

Foldable (Proxy :: Type -> Type)

Since: base-4.7.0.0

Instance details

Defined in Data.Foldable

Methods

fold :: Monoid m => Proxy m -> m #

foldMap :: Monoid m => (a -> m) -> Proxy a -> m #

foldMap' :: Monoid m => (a -> m) -> Proxy a -> m #

foldr :: (a -> b -> b) -> b -> Proxy a -> b #

foldr' :: (a -> b -> b) -> b -> Proxy a -> b #

foldl :: (b -> a -> b) -> b -> Proxy a -> b #

foldl' :: (b -> a -> b) -> b -> Proxy a -> b #

foldr1 :: (a -> a -> a) -> Proxy a -> a #

foldl1 :: (a -> a -> a) -> Proxy a -> a #

toList :: Proxy a -> [a] #

null :: Proxy a -> Bool #

length :: Proxy a -> Int #

elem :: Eq a => a -> Proxy a -> Bool #

maximum :: Ord a => Proxy a -> a #

minimum :: Ord a => Proxy a -> a #

sum :: Num a => Proxy a -> a #

product :: Num a => Proxy a -> a #

Traversable (Proxy :: Type -> Type)

Since: base-4.7.0.0

Instance details

Defined in Data.Traversable

Methods

traverse :: Applicative f => (a -> f b) -> Proxy a -> f (Proxy b) #

sequenceA :: Applicative f => Proxy (f a) -> f (Proxy a) #

mapM :: Monad m => (a -> m b) -> Proxy a -> m (Proxy b) #

sequence :: Monad m => Proxy (m a) -> m (Proxy a) #

ToJSON1 (Proxy :: Type -> Type) 
Instance details

Defined in Data.Aeson.Types.ToJSON

Methods

liftToJSON :: (a -> Value) -> ([a] -> Value) -> Proxy a -> Value #

liftToJSONList :: (a -> Value) -> ([a] -> Value) -> [Proxy a] -> Value #

liftToEncoding :: (a -> Encoding) -> ([a] -> Encoding) -> Proxy a -> Encoding #

liftToEncodingList :: (a -> Encoding) -> ([a] -> Encoding) -> [Proxy a] -> Encoding #

FromJSON1 (Proxy :: Type -> Type) 
Instance details

Defined in Data.Aeson.Types.FromJSON

Methods

liftParseJSON :: (Value -> Parser a) -> (Value -> Parser [a]) -> Value -> Parser (Proxy a) #

liftParseJSONList :: (Value -> Parser a) -> (Value -> Parser [a]) -> Value -> Parser [Proxy a] #

Alternative (Proxy :: Type -> Type)

Since: base-4.9.0.0

Instance details

Defined in Data.Proxy

Methods

empty :: Proxy a #

(<|>) :: Proxy a -> Proxy a -> Proxy a #

some :: Proxy a -> Proxy [a] #

many :: Proxy a -> Proxy [a] #

MonadPlus (Proxy :: Type -> Type)

Since: base-4.9.0.0

Instance details

Defined in Data.Proxy

Methods

mzero :: Proxy a #

mplus :: Proxy a -> Proxy a -> Proxy a #

Eq1 (Proxy :: Type -> Type)

Since: base-4.9.0.0

Instance details

Defined in Data.Functor.Classes

Methods

liftEq :: (a -> b -> Bool) -> Proxy a -> Proxy b -> Bool #

Ord1 (Proxy :: Type -> Type)

Since: base-4.9.0.0

Instance details

Defined in Data.Functor.Classes

Methods

liftCompare :: (a -> b -> Ordering) -> Proxy a -> Proxy b -> Ordering #

Read1 (Proxy :: Type -> Type)

Since: base-4.9.0.0

Instance details

Defined in Data.Functor.Classes

Methods

liftReadsPrec :: (Int -> ReadS a) -> ReadS [a] -> Int -> ReadS (Proxy a) #

liftReadList :: (Int -> ReadS a) -> ReadS [a] -> ReadS [Proxy a] #

liftReadPrec :: ReadPrec a -> ReadPrec [a] -> ReadPrec (Proxy a) #

liftReadListPrec :: ReadPrec a -> ReadPrec [a] -> ReadPrec [Proxy a] #

Show1 (Proxy :: Type -> Type)

Since: base-4.9.0.0

Instance details

Defined in Data.Functor.Classes

Methods

liftShowsPrec :: (Int -> a -> ShowS) -> ([a] -> ShowS) -> Int -> Proxy a -> ShowS #

liftShowList :: (Int -> a -> ShowS) -> ([a] -> ShowS) -> [Proxy a] -> ShowS #

Hashable1 (Proxy :: Type -> Type) 
Instance details

Defined in Data.Hashable.Class

Methods

liftHashWithSalt :: (Int -> a -> Int) -> Int -> Proxy a -> Int #

Bounded (Proxy t)

Since: base-4.7.0.0

Instance details

Defined in Data.Proxy

Methods

minBound :: Proxy t #

maxBound :: Proxy t #

Enum (Proxy s)

Since: base-4.7.0.0

Instance details

Defined in Data.Proxy

Methods

succ :: Proxy s -> Proxy s #

pred :: Proxy s -> Proxy s #

toEnum :: Int -> Proxy s #

fromEnum :: Proxy s -> Int #

enumFrom :: Proxy s -> [Proxy s] #

enumFromThen :: Proxy s -> Proxy s -> [Proxy s] #

enumFromTo :: Proxy s -> Proxy s -> [Proxy s] #

enumFromThenTo :: Proxy s -> Proxy s -> Proxy s -> [Proxy s] #

Eq (Proxy s)

Since: base-4.7.0.0

Instance details

Defined in Data.Proxy

Methods

(==) :: Proxy s -> Proxy s -> Bool #

(/=) :: Proxy s -> Proxy s -> Bool #

Ord (Proxy s)

Since: base-4.7.0.0

Instance details

Defined in Data.Proxy

Methods

compare :: Proxy s -> Proxy s -> Ordering #

(<) :: Proxy s -> Proxy s -> Bool #

(<=) :: Proxy s -> Proxy s -> Bool #

(>) :: Proxy s -> Proxy s -> Bool #

(>=) :: Proxy s -> Proxy s -> Bool #

max :: Proxy s -> Proxy s -> Proxy s #

min :: Proxy s -> Proxy s -> Proxy s #

Read (Proxy t)

Since: base-4.7.0.0

Instance details

Defined in Data.Proxy

Show (Proxy s)

Since: base-4.7.0.0

Instance details

Defined in Data.Proxy

Methods

showsPrec :: Int -> Proxy s -> ShowS #

show :: Proxy s -> String #

showList :: [Proxy s] -> ShowS #

Ix (Proxy s)

Since: base-4.7.0.0

Instance details

Defined in Data.Proxy

Methods

range :: (Proxy s, Proxy s) -> [Proxy s] #

index :: (Proxy s, Proxy s) -> Proxy s -> Int #

unsafeIndex :: (Proxy s, Proxy s) -> Proxy s -> Int #

inRange :: (Proxy s, Proxy s) -> Proxy s -> Bool #

rangeSize :: (Proxy s, Proxy s) -> Int #

unsafeRangeSize :: (Proxy s, Proxy s) -> Int #

Generic (Proxy t)

Since: base-4.6.0.0

Instance details

Defined in GHC.Generics

Associated Types

type Rep (Proxy t) :: Type -> Type #

Methods

from :: Proxy t -> Rep (Proxy t) x #

to :: Rep (Proxy t) x -> Proxy t #

Semigroup (Proxy s)

Since: base-4.9.0.0

Instance details

Defined in Data.Proxy

Methods

(<>) :: Proxy s -> Proxy s -> Proxy s #

sconcat :: NonEmpty (Proxy s) -> Proxy s #

stimes :: Integral b => b -> Proxy s -> Proxy s #

Monoid (Proxy s)

Since: base-4.7.0.0

Instance details

Defined in Data.Proxy

Methods

mempty :: Proxy s #

mappend :: Proxy s -> Proxy s -> Proxy s #

mconcat :: [Proxy s] -> Proxy s #

Hashable (Proxy a) 
Instance details

Defined in Data.Hashable.Class

Methods

hashWithSalt :: Int -> Proxy a -> Int #

hash :: Proxy a -> Int #

ToJSON (Proxy a) 
Instance details

Defined in Data.Aeson.Types.ToJSON

FromJSON (Proxy a) 
Instance details

Defined in Data.Aeson.Types.FromJSON

MonoFunctor (Proxy a)

Since: mono-traversable-1.0.11.0

Instance details

Defined in Data.MonoTraversable

Methods

omap :: (Element (Proxy a) -> Element (Proxy a)) -> Proxy a -> Proxy a #

MonoFoldable (Proxy a)

Since: mono-traversable-1.0.11.0

Instance details

Defined in Data.MonoTraversable

Methods

ofoldMap :: Monoid m => (Element (Proxy a) -> m) -> Proxy a -> m #

ofoldr :: (Element (Proxy a) -> b -> b) -> b -> Proxy a -> b #

ofoldl' :: (a0 -> Element (Proxy a) -> a0) -> a0 -> Proxy a -> a0 #

otoList :: Proxy a -> [Element (Proxy a)] #

oall :: (Element (Proxy a) -> Bool) -> Proxy a -> Bool #

oany :: (Element (Proxy a) -> Bool) -> Proxy a -> Bool #

onull :: Proxy a -> Bool #

olength :: Proxy a -> Int #

olength64 :: Proxy a -> Int64 #

ocompareLength :: Integral i => Proxy a -> i -> Ordering #

otraverse_ :: Applicative f => (Element (Proxy a) -> f b) -> Proxy a -> f () #

ofor_ :: Applicative f => Proxy a -> (Element (Proxy a) -> f b) -> f () #

omapM_ :: Applicative m => (Element (Proxy a) -> m ()) -> Proxy a -> m () #

oforM_ :: Applicative m => Proxy a -> (Element (Proxy a) -> m ()) -> m () #

ofoldlM :: Monad m => (a0 -> Element (Proxy a) -> m a0) -> a0 -> Proxy a -> m a0 #

ofoldMap1Ex :: Semigroup m => (Element (Proxy a) -> m) -> Proxy a -> m #

ofoldr1Ex :: (Element (Proxy a) -> Element (Proxy a) -> Element (Proxy a)) -> Proxy a -> Element (Proxy a) #

ofoldl1Ex' :: (Element (Proxy a) -> Element (Proxy a) -> Element (Proxy a)) -> Proxy a -> Element (Proxy a) #

headEx :: Proxy a -> Element (Proxy a) #

lastEx :: Proxy a -> Element (Proxy a) #

unsafeHead :: Proxy a -> Element (Proxy a) #

unsafeLast :: Proxy a -> Element (Proxy a) #

maximumByEx :: (Element (Proxy a) -> Element (Proxy a) -> Ordering) -> Proxy a -> Element (Proxy a) #

minimumByEx :: (Element (Proxy a) -> Element (Proxy a) -> Ordering) -> Proxy a -> Element (Proxy a) #

oelem :: Element (Proxy a) -> Proxy a -> Bool #

onotElem :: Element (Proxy a) -> Proxy a -> Bool #

MonoTraversable (Proxy a)

Since: mono-traversable-1.0.11.0

Instance details

Defined in Data.MonoTraversable

Methods

otraverse :: Applicative f => (Element (Proxy a) -> f (Element (Proxy a))) -> Proxy a -> f (Proxy a) #

omapM :: Applicative m => (Element (Proxy a) -> m (Element (Proxy a))) -> Proxy a -> m (Proxy a) #

MonoPointed (Proxy a)

Since: mono-traversable-1.0.11.0

Instance details

Defined in Data.MonoTraversable

Methods

opoint :: Element (Proxy a) -> Proxy a #

type Rep1 (Proxy :: k -> Type) 
Instance details

Defined in GHC.Generics

type Rep1 (Proxy :: k -> Type) = D1 ('MetaData "Proxy" "Data.Proxy" "base" 'False) (C1 ('MetaCons "Proxy" 'PrefixI 'False) (U1 :: k -> Type))
type Rep (Proxy t) 
Instance details

Defined in GHC.Generics

type Rep (Proxy t) = D1 ('MetaData "Proxy" "Data.Proxy" "base" 'False) (C1 ('MetaCons "Proxy" 'PrefixI 'False) (U1 :: Type -> Type))
type Element (Proxy a) 
Instance details

Defined in Data.MonoTraversable

type Element (Proxy a) = a

newtype UUID Source #

Constructors

UUID 

Fields

Instances

Instances details
Eq UUID Source # 
Instance details

Defined in Init

Methods

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

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

Ord UUID Source # 
Instance details

Defined in Init

Methods

compare :: UUID -> UUID -> Ordering #

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

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

(>) :: UUID -> UUID -> Bool #

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

max :: UUID -> UUID -> UUID #

min :: UUID -> UUID -> UUID #

Read UUID Source # 
Instance details

Defined in Init

Show UUID Source # 
Instance details

Defined in Init

Methods

showsPrec :: Int -> UUID -> ShowS #

show :: UUID -> String #

showList :: [UUID] -> ShowS #

ToJSON UUID Source # 
Instance details

Defined in Init

FromJSON UUID Source # 
Instance details

Defined in Init

ToHttpApiData UUID Source # 
Instance details

Defined in Init

FromHttpApiData UUID Source # 
Instance details

Defined in Init

PathPiece UUID Source # 
Instance details

Defined in Init

PersistFieldSql UUID Source # 
Instance details

Defined in Init

Methods

sqlType :: Proxy UUID -> SqlType #

PersistField UUID Source # 
Instance details

Defined in Init

Orphan instances

Arbitrary PersistValue Source # 
Instance details

MonadBase b m => MonadBase b (ResourceT m) Source # 
Instance details

Methods

liftBase :: b α -> ResourceT m α #

MonadBaseControl b m => MonadBaseControl b (ResourceT m) Source # 
Instance details

Associated Types

type StM (ResourceT m) a #

Methods

liftBaseWith :: (RunInBase (ResourceT m) b -> b a) -> ResourceT m a #

restoreM :: StM (ResourceT m) a -> ResourceT m a #

PersistStore backend => Arbitrary (BackendKey backend) Source # 
Instance details

Methods

arbitrary :: Gen (BackendKey backend) #

shrink :: BackendKey backend -> [BackendKey backend] #