| Safe Haskell | None |
|---|---|
| Language | Haskell2010 |
Init
Contents
Description
This will hopefully be the only module with CPP in it.
Synopsis
- (@/=) :: (HasCallStack, Eq a, Show a, MonadIO m) => a -> a -> m ()
- (@==) :: (HasCallStack, Eq a, Show a, MonadIO m) => a -> a -> m ()
- (==@) :: (HasCallStack, Eq a, Show a, MonadIO m) => a -> a -> m ()
- asIO :: IO a -> IO a
- assertNotEqual :: (Eq a, Show a, HasCallStack) => String -> a -> a -> Assertion
- assertNotEmpty :: MonadIO m => [a] -> m ()
- assertEmpty :: MonadIO m => [a] -> m ()
- isTravis :: IO Bool
- module Database.Persist.Sql
- persistSettings :: MkPersistSettings
- data MkPersistSettings
- data family BackendKey backend
- class GenerateKey backend where
- generateKey :: IO (BackendKey backend)
- type RunDb backend (m :: Type -> Type) = ReaderT backend m () -> IO ()
- type Runner backend (m :: Type -> Type) = (MonadIO m, MonadUnliftIO m, MonadFail m, MonadThrow m, MonadBaseControl IO m, PersistStoreWrite backend, PersistStoreWrite (BaseBackend backend), GenerateKey backend, HasPersistBackend backend, PersistUniqueWrite backend, PersistQueryWrite backend, backend ~ BaseBackend backend, PersistQueryRead backend)
- module Database.Persist
- module Test.Hspec
- type Assertion = IO ()
- assertFailure :: HasCallStack => String -> IO a
- assertBool :: HasCallStack => String -> Bool -> Assertion
- (@=?) :: (HasCallStack, Eq a, Show a) => a -> a -> Assertion
- (@?=) :: (HasCallStack, Eq a, Show a) => a -> a -> Assertion
- mkPersist :: MkPersistSettings -> [UnboundEntityDef] -> Q [Dec]
- mkMigrate :: String -> [UnboundEntityDef] -> Q [Dec]
- share :: [[a] -> Q [Dec]] -> [a] -> Q [Dec]
- sqlSettings :: MkPersistSettings
- persistLowerCase :: QuasiQuoter
- persistUpperCase :: QuasiQuoter
- data Int32
- data Int64
- data Text
- module Control.Monad.Reader
- unless :: Applicative f => Bool -> f () -> f ()
- void :: Functor f => f a -> f ()
- when :: Applicative f => Bool -> f () -> f ()
- liftM :: Monad m => (a1 -> r) -> m a1 -> m r
- forM_ :: (Foldable t, Monad m) => t a -> (a -> m b) -> m ()
- (>=>) :: Monad m => (a -> m b) -> (b -> m c) -> a -> m c
- replicateM :: Applicative m => Int -> m a -> m [a]
- module Control.Monad.IO.Unlift
- data ByteString
- data SomeException
- class Monad m => MonadFail (m :: Type -> Type)
- data TestFn entity where
- truncateTimeOfDay :: TimeOfDay -> Gen TimeOfDay
- truncateToMicro :: Pico -> Pico
- truncateUTCTime :: UTCTime -> Gen UTCTime
- arbText :: IsString s => Gen s
- liftA2 :: Applicative f => (a -> b -> c) -> f a -> f b -> f c
- changeBackend :: forall backend backend' (m :: Type -> Type). MonadUnliftIO m => (backend -> backend') -> RunDb backend m -> RunDb backend' m
- data Proxy (t :: k) = Proxy
- newtype UUID = UUID {}
- sqlSettingsUuid :: Text -> MkPersistSettings
Documentation
assertNotEqual :: (Eq a, Show a, HasCallStack) => String -> a -> a -> Assertion Source #
assertNotEmpty :: MonadIO m => [a] -> m () Source #
assertEmpty :: MonadIO m => [a] -> m () Source #
module Database.Persist.Sql
data MkPersistSettings #
Settings that can be passed to the mkPersist (mps) function to control what code is generated.
This is (just) the data type definition, so you will most likely want to use and adapt concrete values
like sqlSettings.
data family BackendKey backend #
Instances
class GenerateKey backend where Source #
Methods
generateKey :: IO (BackendKey backend) Source #
Instances
| GenerateKey SqlBackend Source # | |
Defined in Init Methods generateKey :: IO (BackendKey SqlBackend) Source # | |
type Runner backend (m :: Type -> Type) = (MonadIO m, MonadUnliftIO m, MonadFail m, MonadThrow m, MonadBaseControl IO m, PersistStoreWrite backend, PersistStoreWrite (BaseBackend backend), GenerateKey backend, HasPersistBackend backend, PersistUniqueWrite backend, PersistQueryWrite backend, backend ~ BaseBackend backend, PersistQueryRead backend) Source #
module Database.Persist
module Test.Hspec
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.
Arguments
| :: HasCallStack | |
| => String | A message that is displayed with the assertion failure |
| -> IO a |
Unconditionally signals that a failure has occurred.
Arguments
| :: HasCallStack | |
| => String | The message that is displayed if the assertion fails |
| -> Bool | The condition |
| -> Assertion |
Asserts that the specified condition holds.
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).
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).
mkPersist :: MkPersistSettings -> [UnboundEntityDef] -> Q [Dec] #
Create data types and appropriate PersistEntity instances for the given
UnboundEntityDefs.
This function should be used if you are only defining a single block of
Persistent models for the entire application. If you intend on defining
multiple blocks in different fiels, see mkPersistWith which allows you
to provide existing entity definitions so foreign key references work.
Example:
mkPersistsqlSettings[persistLowerCase| User name Text age Int Dog name Text owner UserId |]
Example from a file:
mkPersistsqlSettings$(persistFileWithlowerCaseSettings"models.persistentmodels")
For full information on the QuasiQuoter syntax, see
Database.Persist.Quasi documentation.
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",mkPersistsqlSettings] [persistLowerCase| -- ... |]
If you only have a single function, though, you don't need this. The following is redundant:
share[mkPersistsqlSettings] [persistLowerCase| -- ... |]
Most functions require a full [, which can be provided
using EntityDef]$( for all entites in scope, or defining
discoverEntities)mkEntityDefList to define a list of entities from the given block.
sqlSettings :: MkPersistSettings #
Use the SqlPersist backend.
persistLowerCase :: QuasiQuoter #
Apply persistWith to lowerCaseSettings.
persistUpperCase :: QuasiQuoter #
Apply persistWith to upperCaseSettings.
32-bit signed integer type
Instances
64-bit signed integer type
Instances
A space efficient, packed, unboxed Unicode text type.
Instances
module Control.Monad.Reader
unless :: Applicative f => Bool -> f () -> f () #
The reverse of when.
void :: Functor f => f a -> f () #
discards or ignores the result of evaluation, such
as the return value of an void valueIO action.
Examples
Replace the contents of a with unit:Maybe Int
>>>void NothingNothing>>>void (Just 3)Just ()
Replace the contents of an
with unit, resulting in an Either Int Int: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
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.
(>=>) :: Monad m => (a -> m b) -> (b -> m c) -> a -> m c infixr 1 #
Left-to-right composition of Kleisli arrows.
'(bs ' can be understood as the >=> cs) ado expression
do b <- bs a cs b
replicateM :: Applicative m => Int -> m a -> m [a] #
performs the action replicateM n actact n times,
and then returns the list of results:
Examples
>>>import Control.Monad.State>>>runState (replicateM 3 $ state $ \s -> (s, s + 1)) 1([1,2,3],4)
module Control.Monad.IO.Unlift
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
| Chunk ByteString | |||||||||
Defined in Data.Attoparsec.Internal.Types Associated Types
Methods nullChunk :: ByteString -> Bool # pappendChunk :: State ByteString -> ByteString -> State ByteString # atBufferEnd :: ByteString -> State ByteString -> Pos # bufferElemAt :: ByteString -> Pos -> State ByteString -> Maybe (ChunkElem ByteString, Int) # chunkElemToChar :: ByteString -> ChunkElem ByteString -> Char # | |||||||||
| Data ByteString | |||||||||
Defined in Data.ByteString.Internal.Type 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 # | |||||||||
| IsString ByteString | Beware: | ||||||||
Defined in Data.ByteString.Internal.Type Methods fromString :: String -> ByteString # | |||||||||
| Monoid ByteString | |||||||||
Defined in Data.ByteString.Internal.Type Methods mempty :: ByteString # mappend :: ByteString -> ByteString -> ByteString # mconcat :: [ByteString] -> ByteString # | |||||||||
| Semigroup ByteString | |||||||||
Defined in Data.ByteString.Internal.Type Methods (<>) :: ByteString -> ByteString -> ByteString # sconcat :: NonEmpty ByteString -> ByteString # stimes :: Integral b => b -> ByteString -> ByteString # | |||||||||
| IsList ByteString | Since: bytestring-0.10.12.0 | ||||||||
Defined in Data.ByteString.Internal.Type Associated Types
Methods fromList :: [Item ByteString] -> ByteString # fromListN :: Int -> [Item ByteString] -> ByteString # toList :: ByteString -> [Item ByteString] # | |||||||||
| Read ByteString | |||||||||
Defined in Data.ByteString.Internal.Type Methods readsPrec :: Int -> ReadS ByteString # readList :: ReadS [ByteString] # readPrec :: ReadPrec ByteString # readListPrec :: ReadPrec [ByteString] # | |||||||||
| Show ByteString | |||||||||
Defined in Data.ByteString.Internal.Type Methods showsPrec :: Int -> ByteString -> ShowS # show :: ByteString -> String # showList :: [ByteString] -> ShowS # | |||||||||
| NFData ByteString | |||||||||
Defined in Data.ByteString.Internal.Type Methods rnf :: ByteString -> () # | |||||||||
| Eq ByteString | |||||||||
Defined in Data.ByteString.Internal.Type | |||||||||
| Ord ByteString | |||||||||
Defined in Data.ByteString.Internal.Type Methods compare :: ByteString -> ByteString -> Ordering # (<) :: ByteString -> ByteString -> Bool # (<=) :: ByteString -> ByteString -> Bool # (>) :: ByteString -> ByteString -> Bool # (>=) :: ByteString -> ByteString -> Bool # max :: ByteString -> ByteString -> ByteString # min :: ByteString -> ByteString -> ByteString # | |||||||||
| Hashable ByteString | |||||||||
Defined in Data.Hashable.Class | |||||||||
| Stream ByteString | |||||||||
Defined in Text.Megaparsec.Stream Associated Types
Methods tokenToChunk :: Proxy ByteString -> Token ByteString -> Tokens ByteString # tokensToChunk :: Proxy ByteString -> [Token ByteString] -> Tokens ByteString # chunkToTokens :: Proxy ByteString -> Tokens ByteString -> [Token ByteString] # chunkLength :: Proxy ByteString -> Tokens ByteString -> Int # chunkEmpty :: Proxy ByteString -> Tokens ByteString -> Bool # take1_ :: ByteString -> Maybe (Token ByteString, ByteString) # takeN_ :: Int -> ByteString -> Maybe (Tokens ByteString, ByteString) # takeWhile_ :: (Token ByteString -> Bool) -> ByteString -> (Tokens ByteString, ByteString) # | |||||||||
| TraversableStream ByteString | |||||||||
Defined in Text.Megaparsec.Stream Methods reachOffset :: Int -> PosState ByteString -> (Maybe String, PosState ByteString) # reachOffsetNoLine :: Int -> PosState ByteString -> PosState ByteString # | |||||||||
| VisualStream ByteString | |||||||||
Defined in Text.Megaparsec.Stream Methods showTokens :: Proxy ByteString -> NonEmpty (Token ByteString) -> String # tokensLength :: Proxy ByteString -> NonEmpty (Token ByteString) -> Int # | |||||||||
| GrowingAppend ByteString | |||||||||
Defined in Data.MonoTraversable | |||||||||
| MonoFoldable ByteString | |||||||||
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 # | |||||||||
| MonoFunctor ByteString | |||||||||
Defined in Data.MonoTraversable Methods omap :: (Element ByteString -> Element ByteString) -> ByteString -> ByteString # | |||||||||
| MonoPointed ByteString | |||||||||
Defined in Data.MonoTraversable Methods opoint :: Element ByteString -> ByteString # | |||||||||
| MonoTraversable ByteString | |||||||||
Defined in Data.MonoTraversable Methods otraverse :: Applicative f => (Element ByteString -> f (Element ByteString)) -> ByteString -> f ByteString # omapM :: Applicative m => (Element ByteString -> m (Element ByteString)) -> ByteString -> m ByteString # | |||||||||
| IsSequence ByteString | |||||||||
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] # tails :: ByteString -> [ByteString] # inits :: ByteString -> [ByteString] # initTails :: ByteString -> [(ByteString, ByteString)] # | |||||||||
| SemiSequence ByteString | |||||||||
Defined in Data.Sequences Associated Types
Methods intersperse :: Element ByteString -> ByteString -> ByteString # reverse :: ByteString -> ByteString # find :: (Element ByteString -> Bool) -> ByteString -> Maybe (Element ByteString) # sortBy :: (Element ByteString -> Element ByteString -> Ordering) -> ByteString -> ByteString # cons :: Element ByteString -> ByteString -> ByteString # snoc :: ByteString -> Element ByteString -> ByteString # | |||||||||
| PersistField ByteString | |||||||||
Defined in Database.Persist.Class.PersistField Methods toPersistValue :: ByteString -> PersistValue # fromPersistValue :: PersistValue -> Either Text ByteString # | |||||||||
| PersistFieldSql ByteString | |||||||||
Defined in Database.Persist.Sql.Class Methods sqlType :: Proxy ByteString -> SqlType # | |||||||||
| LazySequence ByteString ByteString | |||||||||
Defined in Data.Sequences Methods toChunks :: ByteString -> [ByteString] # fromChunks :: [ByteString] -> ByteString # toStrict :: ByteString -> ByteString # fromStrict :: ByteString -> ByteString # | |||||||||
| Utf8 Text ByteString | |||||||||
Defined in Data.Sequences | |||||||||
| Lift ByteString | Since: bytestring-0.11.2.0 | ||||||||
Defined in Data.ByteString.Internal.Type Methods lift :: Quote m => ByteString -> m Exp # liftTyped :: forall (m :: Type -> Type). Quote m => ByteString -> Code m ByteString # | |||||||||
| Stream (NoShareInput ByteString) | |||||||||
Defined in Text.Megaparsec.Stream Associated Types
Methods tokenToChunk :: Proxy (NoShareInput ByteString) -> Token (NoShareInput ByteString) -> Tokens (NoShareInput ByteString) # tokensToChunk :: Proxy (NoShareInput ByteString) -> [Token (NoShareInput ByteString)] -> Tokens (NoShareInput ByteString) # chunkToTokens :: Proxy (NoShareInput ByteString) -> Tokens (NoShareInput ByteString) -> [Token (NoShareInput ByteString)] # chunkLength :: Proxy (NoShareInput ByteString) -> Tokens (NoShareInput ByteString) -> Int # chunkEmpty :: Proxy (NoShareInput ByteString) -> Tokens (NoShareInput ByteString) -> Bool # take1_ :: NoShareInput ByteString -> Maybe (Token (NoShareInput ByteString), NoShareInput ByteString) # takeN_ :: Int -> NoShareInput ByteString -> Maybe (Tokens (NoShareInput ByteString), NoShareInput ByteString) # takeWhile_ :: (Token (NoShareInput ByteString) -> Bool) -> NoShareInput ByteString -> (Tokens (NoShareInput ByteString), NoShareInput ByteString) # | |||||||||
| Stream (ShareInput ByteString) | |||||||||
Defined in Text.Megaparsec.Stream Associated Types
Methods tokenToChunk :: Proxy (ShareInput ByteString) -> Token (ShareInput ByteString) -> Tokens (ShareInput ByteString) # tokensToChunk :: Proxy (ShareInput ByteString) -> [Token (ShareInput ByteString)] -> Tokens (ShareInput ByteString) # chunkToTokens :: Proxy (ShareInput ByteString) -> Tokens (ShareInput ByteString) -> [Token (ShareInput ByteString)] # chunkLength :: Proxy (ShareInput ByteString) -> Tokens (ShareInput ByteString) -> Int # chunkEmpty :: Proxy (ShareInput ByteString) -> Tokens (ShareInput ByteString) -> Bool # take1_ :: ShareInput ByteString -> Maybe (Token (ShareInput ByteString), ShareInput ByteString) # takeN_ :: Int -> ShareInput ByteString -> Maybe (Tokens (ShareInput ByteString), ShareInput ByteString) # takeWhile_ :: (Token (ShareInput ByteString) -> Bool) -> ShareInput ByteString -> (Tokens (ShareInput ByteString), ShareInput ByteString) # | |||||||||
| type ChunkElem ByteString | |||||||||
Defined in Data.Attoparsec.Internal.Types | |||||||||
| type State ByteString | |||||||||
Defined in Data.Attoparsec.Internal.Types | |||||||||
| type Item ByteString | |||||||||
Defined in Data.ByteString.Internal.Type | |||||||||
| type Token ByteString | |||||||||
Defined in Text.Megaparsec.Stream | |||||||||
| type Tokens ByteString | |||||||||
Defined in Text.Megaparsec.Stream | |||||||||
| type Element ByteString | |||||||||
Defined in Data.MonoTraversable | |||||||||
| type Index ByteString | |||||||||
Defined in Data.Sequences | |||||||||
| type Token (NoShareInput ByteString) | |||||||||
Defined in Text.Megaparsec.Stream | |||||||||
| type Token (ShareInput ByteString) | |||||||||
Defined in Text.Megaparsec.Stream | |||||||||
| type Tokens (NoShareInput ByteString) | |||||||||
Defined in Text.Megaparsec.Stream | |||||||||
| type Tokens (ShareInput ByteString) | |||||||||
Defined in Text.Megaparsec.Stream | |||||||||
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
| Exception SomeException | Since: base-3.0 |
Defined in GHC.Exception.Type Methods toException :: SomeException -> SomeException # fromException :: SomeException -> Maybe SomeException # displayException :: SomeException -> String # | |
| Show SomeException | Since: base-3.0 |
Defined in GHC.Exception.Type Methods showsPrec :: Int -> SomeException -> ShowS # show :: SomeException -> String # showList :: [SomeException] -> ShowS # | |
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
fail s should be an action that runs in the monad itself, not an
exception (except in instances of MonadIO). In particular,
fail should not be implemented in terms of error.
Since: base-4.9.0.0
Minimal complete definition
Instances
| MonadFail IResult | |
Defined in Data.Aeson.Types.Internal | |
| MonadFail Parser | |
Defined in Data.Aeson.Types.Internal | |
| MonadFail Result | |
Defined in Data.Aeson.Types.Internal | |
| MonadFail P | Since: base-4.9.0.0 |
Defined in Text.ParserCombinators.ReadP | |
| MonadFail ReadP | Since: base-4.9.0.0 |
Defined in Text.ParserCombinators.ReadP | |
| MonadFail ReadPrec | Since: base-4.9.0.0 |
Defined in Text.ParserCombinators.ReadPrec | |
| MonadFail DList | |
Defined in Data.DList.Internal | |
| MonadFail IO | Since: base-4.9.0.0 |
Defined in Control.Monad.Fail | |
| MonadFail Parser | |
Defined in Database.Persist.Quasi.Internal.ModelParser | |
| MonadFail Array | |
Defined in Data.Primitive.Array | |
| MonadFail SmallArray | |
Defined in Data.Primitive.SmallArray Methods fail :: String -> SmallArray a # | |
| MonadFail Q | |
Defined in Language.Haskell.TH.Syntax | |
| MonadFail Vector | |
Defined in Data.Vector | |
| MonadFail Vector | |
Defined in Data.Vector.Strict | |
| MonadFail Maybe | Since: base-4.9.0.0 |
Defined in Control.Monad.Fail | |
| MonadFail [] | Since: base-4.9.0.0 |
Defined in Control.Monad.Fail | |
| Monad m => MonadFail (PropertyM m) | |
Defined in Test.QuickCheck.Monadic | |
| MonadFail (Parser i) | |
Defined in Data.Attoparsec.Internal.Types | |
| Monad m => MonadFail (CatchT m) | |
Defined in Control.Monad.Catch.Pure | |
| MonadFail m => MonadFail (LoggingT m) | Since: monad-logger-0.3.30 |
Defined in Control.Monad.Logger | |
| MonadFail m => MonadFail (NoLoggingT m) | Since: monad-logger-0.3.30 |
Defined in Control.Monad.Logger Methods fail :: String -> NoLoggingT m a # | |
| MonadFail m => MonadFail (ResourceT m) | Since: resourcet-1.2.2 |
Defined in Control.Monad.Trans.Resource.Internal | |
| Monad m => MonadFail (MaybeT m) | |
Defined in Control.Monad.Trans.Maybe | |
| MonadFail f => MonadFail (Ap f) | Since: base-4.12.0.0 |
Defined in Data.Monoid | |
| (Monoid w, MonadFail m) => MonadFail (AccumT w m) | |
Defined in Control.Monad.Trans.Accum | |
| MonadFail m => MonadFail (ExceptT e m) | |
Defined in Control.Monad.Trans.Except | |
| MonadFail m => MonadFail (IdentityT m) | |
Defined in Control.Monad.Trans.Identity | |
| MonadFail m => MonadFail (ReaderT r m) | |
Defined in Control.Monad.Trans.Reader | |
| MonadFail m => MonadFail (SelectT r m) | |
Defined in Control.Monad.Trans.Select | |
| MonadFail m => MonadFail (StateT s m) | |
Defined in Control.Monad.Trans.State.Lazy | |
| MonadFail m => MonadFail (StateT s m) | |
Defined in Control.Monad.Trans.State.Strict | |
| MonadFail m => MonadFail (WriterT w m) | |
Defined in Control.Monad.Trans.Writer.CPS | |
| (Monoid w, MonadFail m) => MonadFail (WriterT w m) | |
Defined in Control.Monad.Trans.Writer.Lazy | |
| (Monoid w, MonadFail m) => MonadFail (WriterT w m) | |
Defined in Control.Monad.Trans.Writer.Strict | |
| MonadFail m => MonadFail (Reverse m) | |
Defined in Data.Functor.Reverse | |
| MonadFail m => MonadFail (ConduitT i o m) | Since: conduit-1.3.1 |
Defined in Data.Conduit.Internal.Conduit | |
| MonadFail m => MonadFail (ContT r m) | |
Defined in Control.Monad.Trans.Cont | |
| MonadFail m => MonadFail (RWST r w s m) | |
Defined in Control.Monad.Trans.RWS.CPS | |
| (Monoid w, MonadFail m) => MonadFail (RWST r w s m) | |
Defined in Control.Monad.Trans.RWS.Lazy | |
| (Monoid w, MonadFail m) => MonadFail (RWST r w s m) | |
Defined in Control.Monad.Trans.RWS.Strict | |
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)
truncateToMicro :: Pico -> Pico Source #
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.
Example
>>>liftA2 (,) (Just 3) (Just 5)Just (3,5)
changeBackend :: forall backend backend' (m :: Type -> Type). MonadUnliftIO m => (backend -> backend') -> RunDb backend m -> RunDb backend' m Source #
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, is a safer alternative to the
Proxy :: Proxy a idiom.undefined :: a
>>>Proxy :: Proxy (Void, Int -> Int)Proxy
Proxy can even hold types of higher kinds,
>>>Proxy :: Proxy EitherProxy
>>>Proxy :: Proxy FunctorProxy
>>>Proxy :: Proxy complicatedStructureProxy
Constructors
| Proxy |
Instances
| Generic1 (Proxy :: k -> Type) | |
Defined in GHC.Generics | |
| FromJSON1 (Proxy :: Type -> Type) | |
Defined in Data.Aeson.Types.FromJSON | |
| ToJSON1 (Proxy :: Type -> Type) | |
Defined in Data.Aeson.Types.ToJSON Methods liftToJSON :: (a -> Bool) -> (a -> Value) -> ([a] -> Value) -> Proxy a -> Value # liftToJSONList :: (a -> Bool) -> (a -> Value) -> ([a] -> Value) -> [Proxy a] -> Value # liftToEncoding :: (a -> Bool) -> (a -> Encoding) -> ([a] -> Encoding) -> Proxy a -> Encoding # liftToEncodingList :: (a -> Bool) -> (a -> Encoding) -> ([a] -> Encoding) -> [Proxy a] -> Encoding # liftOmitField :: (a -> Bool) -> Proxy a -> Bool # | |
| MonadZip (Proxy :: Type -> Type) | Since: base-4.9.0.0 |
| Foldable (Proxy :: Type -> Type) | Since: base-4.7.0.0 |
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 # elem :: Eq a => a -> Proxy a -> Bool # maximum :: Ord a => Proxy a -> a # minimum :: Ord a => Proxy a -> a # | |
| Eq1 (Proxy :: Type -> Type) | Since: base-4.9.0.0 |
| Ord1 (Proxy :: Type -> Type) | Since: base-4.9.0.0 |
Defined in Data.Functor.Classes | |
| Read1 (Proxy :: Type -> Type) | Since: base-4.9.0.0 |
Defined in Data.Functor.Classes | |
| Show1 (Proxy :: Type -> Type) | Since: base-4.9.0.0 |
| Contravariant (Proxy :: Type -> Type) | |
| Traversable (Proxy :: Type -> Type) | Since: base-4.7.0.0 |
| Alternative (Proxy :: Type -> Type) | Since: base-4.9.0.0 |
| Applicative (Proxy :: Type -> Type) | Since: base-4.7.0.0 |
| Functor (Proxy :: Type -> Type) | Since: base-4.7.0.0 |
| Monad (Proxy :: Type -> Type) | Since: base-4.7.0.0 |
| MonadPlus (Proxy :: Type -> Type) | Since: base-4.9.0.0 |
| NFData1 (Proxy :: Type -> Type) | Since: deepseq-1.4.3.0 |
Defined in Control.DeepSeq | |
| Hashable1 (Proxy :: Type -> Type) | |
Defined in Data.Hashable.Class | |
| Apply (Proxy :: Type -> Type) | |
| Bind (Proxy :: Type -> Type) | |
| FromJSON (Proxy a) | |
Defined in Data.Aeson.Types.FromJSON | |
| ToJSON (Proxy a) | |
| Data t => Data (Proxy t) | Since: base-4.7.0.0 |
Defined in Data.Data Methods gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> Proxy t -> c (Proxy t) # gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c (Proxy t) # toConstr :: Proxy t -> Constr # dataTypeOf :: Proxy t -> DataType # dataCast1 :: Typeable t0 => (forall d. Data d => c (t0 d)) -> Maybe (c (Proxy t)) # dataCast2 :: Typeable t0 => (forall d e. (Data d, Data e) => c (t0 d e)) -> Maybe (c (Proxy t)) # gmapT :: (forall b. Data b => b -> b) -> Proxy t -> Proxy t # gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> Proxy t -> r # gmapQr :: forall r r'. (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> Proxy t -> r # gmapQ :: (forall d. Data d => d -> u) -> Proxy t -> [u] # gmapQi :: Int -> (forall d. Data d => d -> u) -> Proxy t -> u # gmapM :: Monad m => (forall d. Data d => d -> m d) -> Proxy t -> m (Proxy t) # gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> Proxy t -> m (Proxy t) # gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> Proxy t -> m (Proxy t) # | |
| Monoid (Proxy s) | Since: base-4.7.0.0 |
| Semigroup (Proxy s) | Since: base-4.9.0.0 |
| Bounded (Proxy t) | Since: base-4.7.0.0 |
| Enum (Proxy s) | Since: base-4.7.0.0 |
| Generic (Proxy t) | |
Defined in GHC.Generics | |
| Ix (Proxy s) | Since: base-4.7.0.0 |
Defined in Data.Proxy | |
| Read (Proxy t) | Since: base-4.7.0.0 |
| Show (Proxy s) | Since: base-4.7.0.0 |
| NFData (Proxy a) | Since: deepseq-1.4.0.0 |
Defined in Control.DeepSeq | |
| Eq (Proxy s) | Since: base-4.7.0.0 |
| Ord (Proxy s) | Since: base-4.7.0.0 |
| Hashable (Proxy a) | |
Defined in Data.Hashable.Class | |
| MonoFoldable (Proxy a) | Since: mono-traversable-1.0.11.0 |
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 # 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) # | |
| MonoFunctor (Proxy a) | Since: mono-traversable-1.0.11.0 |
| MonoPointed (Proxy a) | Since: mono-traversable-1.0.11.0 |
| MonoTraversable (Proxy a) | Since: mono-traversable-1.0.11.0 |
| type Rep1 (Proxy :: k -> Type) | Since: base-4.6.0.0 |
| type Rep (Proxy t) | Since: base-4.6.0.0 |
| type Element (Proxy a) | |
Defined in Data.MonoTraversable | |
Instances
| FromJSON UUID Source # | |
| ToJSON UUID Source # | |
| Read UUID Source # | |
| Show UUID Source # | |
| Eq UUID Source # | |
| Ord UUID Source # | |
| FromHttpApiData UUID Source # | |
Defined in Init | |
| ToHttpApiData UUID Source # | |
Defined in Init Methods toUrlPiece :: UUID -> Text # toEncodedUrlPiece :: UUID -> Builder # toHeader :: UUID -> ByteString # toQueryParam :: UUID -> Text # toEncodedQueryParam :: UUID -> Builder # | |
| PathPiece UUID Source # | |
Defined in Init | |
| PersistField UUID Source # | |
Defined in Init Methods toPersistValue :: UUID -> PersistValue # fromPersistValue :: PersistValue -> Either Text UUID # | |
| PersistFieldSql UUID Source # | |
Orphan instances
| Arbitrary PersistValue Source # | |
| MonadBaseControl b m => MonadBaseControl b (ResourceT m) Source # | |
| MonadBase b m => MonadBase b (ResourceT m) Source # | |
| PersistStore backend => Arbitrary (BackendKey backend) Source # | |
Methods arbitrary :: Gen (BackendKey backend) # shrink :: BackendKey backend -> [BackendKey backend] # | |