Hoogle Search
Within LTS Haskell 24.51 (ghc-9.10.3)
Note that Stackage only displays results for the latest LTS and Nightly snapshot. Learn more.
adjustOption :: IsOption v => (v -> v) -> TestTree -> TestTreehledger-lib Hledger.Utils.Test Locally adjust the option value for the given test subtree.
-
parameterized-utils Data.Parameterized.Classes The isJust function returns True iff its argument is of the form Just _.
Examples
Basic usage:>>> isJust (Just 3) True
>>> isJust (Just ()) True
>>> isJust Nothing False
Only the outer constructor is taken into consideration:>>> isJust (Just Nothing) True
-
basic-prelude CorePrelude The isJust function returns True iff its argument is of the form Just _.
Examples
Basic usage:>>> isJust (Just 3) True
>>> isJust (Just ()) True
>>> isJust Nothing False
Only the outer constructor is taken into consideration:>>> isJust (Just Nothing) True
-
classy-prelude ClassyPrelude The isJust function returns True iff its argument is of the form Just _.
Examples
Basic usage:>>> isJust (Just 3) True
>>> isJust (Just ()) True
>>> isJust Nothing False
Only the outer constructor is taken into consideration:>>> isJust (Just Nothing) True
adjust :: (MonadIO m, MonadMask m) => Store ctx -> (ctx -> ctx) -> m a -> m acontext Context Adjust the calling thread's context in the specified Store for the duration of the specified action. Throws a NotFoundException when the calling thread has no registered context.
withAdjusted :: (MonadIO m, MonadMask m) => Store ctx -> (ctx -> ctx) -> (ctx -> m a) -> m acontext Context Convenience function to adjust the context then supply the adjusted context to the inner action. This function is equivalent to calling adjust and then immediately calling mine in the inner action of adjust, e.g.:
doStuff :: Store Thing -> (Thing -> Thing) -> IO () doStuff store f = do adjust store f do adjustedThing <- mine store ...
Throws a NotFoundException when the calling thread has no registered context.adjust :: (MonadIO m, MonadMask m, ?contextStore :: Store ctx) => (ctx -> ctx) -> m a -> m acontext Context.Implicit Adjust the calling thread's context in the implicit Store for the duration of the specified action. Throws a NotFoundException when the calling thread has no registered context.
-
context Context.Implicit Convenience function to adjust the context then supply the adjusted context to the inner action. This function is equivalent to calling adjust and then immediately calling mine in the inner action of adjust, e.g.:
doStuff :: Store Thing -> (Thing -> Thing) -> IO () doStuff store f = do adjust store f do adjustedThing <- mine store ...
Throws a NotFoundException when the calling thread has no registered context. -
esqueleto Database.Esqueleto Same as belongsTo, but uses getJust and therefore is similarly unsafe.
-
esqueleto Database.Esqueleto Same as get, but for a non-null (not Maybe) foreign key. Unsafe unless your database is enforcing that the foreign key is valid.
Example usage
With schema-1 and dataset-1,getJustSpj :: MonadIO m => ReaderT SqlBackend m User getJustSpj = getJust spjId
spj <- getJust spjId
The above query when applied on dataset-1, will get this record:+----+------+-----+ | id | name | age | +----+------+-----+ | 1 | SPJ | 40 | +----+------+-----+
getJustUnknown :: MonadIO m => ReaderT SqlBackend m User getJustUnknown = getJust unknownId
mrx <- getJustUnknown This just throws an error.