yeshql-core-4.1.0.2: YesQL-style SQL database abstraction (core)

Safe HaskellNone
LanguageHaskell2010

Database.YeshQL.Util

Synopsis

Documentation

headMay :: [a] -> Maybe a Source #

withParsedQueries :: (MonadPerformIO m, Monad m) => ([ParsedQuery] -> m a) -> String -> m a Source #

withParsed :: (Monad m, Show e) => (s -> Either e a) -> (a -> m b) -> s -> m b Source #

class MonadPerformIO m where Source #

Monad in which we can perform IO and tag dependencies. Mostly needed because we cannot easily make a MonadIO instance for Q, and also because we want to avoid a dependency on mtl or transformers. For convenience, we also pull addDependentFile into this typeclass.

Minimal complete definition

performIO, addDependentFile

Methods

performIO :: IO a -> m a Source #

addDependentFile :: FilePath -> m () Source #

Instances
MonadPerformIO IO Source # 
Instance details

Defined in Database.YeshQL.Util

MonadPerformIO Q Source # 
Instance details

Defined in Database.YeshQL.Util

Methods

performIO :: IO a -> Q a Source #

addDependentFile :: FilePath -> Q () Source #

withParsedFile :: (MonadPerformIO m, Monad m, Show e) => (String -> Either e a) -> (a -> m b) -> FilePath -> m b Source #