| Safe Haskell | None |
|---|---|
| Language | Haskell2010 |
Hpgsql.Encoding.RowDecoderMonadic
Synopsis
- newtype RowDecoderMonadic a = RowDecoderMonadic {
- fullRowDecoder :: ConversionState -> Parser (a, Int)
- newtype ConversionState = ConversionState {
- colsLeftToParse :: [FieldInfo]
- toMonadicRowDecoder :: RowDecoder a -> RowDecoderMonadic a
Documentation
newtype RowDecoderMonadic a Source #
Unlike Hpgsql.Encoding.RowDecoder, this has a Monad instance.
You should prefer to use Hpgsql.Encoding.RowDecoder (through FromPgRow instances)
instead of this, and use this only if your row decoder is complex enough that
decoded fields can change the behaviour of other decoded fields.
The regular RowDecoder can even type-check queries that return no results, while
this can't.
Look for the query and pipeline functions with an M in them for ways to query
with this kind of row decoder.
Constructors
| RowDecoderMonadic | |
Fields
| |
Instances
| Applicative RowDecoderMonadic Source # | |
Defined in Hpgsql.Encoding.RowDecoderMonadic Methods pure :: a -> RowDecoderMonadic a # (<*>) :: RowDecoderMonadic (a -> b) -> RowDecoderMonadic a -> RowDecoderMonadic b # liftA2 :: (a -> b -> c) -> RowDecoderMonadic a -> RowDecoderMonadic b -> RowDecoderMonadic c # (*>) :: RowDecoderMonadic a -> RowDecoderMonadic b -> RowDecoderMonadic b # (<*) :: RowDecoderMonadic a -> RowDecoderMonadic b -> RowDecoderMonadic a # | |
| Functor RowDecoderMonadic Source # | |
Defined in Hpgsql.Encoding.RowDecoderMonadic Methods fmap :: (a -> b) -> RowDecoderMonadic a -> RowDecoderMonadic b # (<$) :: a -> RowDecoderMonadic b -> RowDecoderMonadic a # | |
| Monad RowDecoderMonadic Source # | |
Defined in Hpgsql.Encoding.RowDecoderMonadic Methods (>>=) :: RowDecoderMonadic a -> (a -> RowDecoderMonadic b) -> RowDecoderMonadic b # (>>) :: RowDecoderMonadic a -> RowDecoderMonadic b -> RowDecoderMonadic b # return :: a -> RowDecoderMonadic a # | |
newtype ConversionState Source #
Constructors
| ConversionState | |
Fields
| |
toMonadicRowDecoder :: RowDecoder a -> RowDecoderMonadic a Source #
Takes an Applicative row parser (which can type-check result rows before even fetching any rows from the response) and transforms it into a Monadic row parser, which has no such type-checking.