Safe Haskell | None |
---|---|
Language | Haskell2010 |
- data RowParser backend :: Nat -> * -> *
- pmap :: (a -> b) -> RowParser backend n a -> RowParser backend n b
- ppure :: a -> RowParser backend Zero a
- preturn :: a -> RowParser backend Zero a
- papply :: RowParser backend n (a -> b) -> RowParser backend m a -> RowParser backend (n :+ m) b
- pbind :: RowParser backend n a -> (a -> RowParser backend m b) -> RowParser backend (n :+ m) b
- pfail :: String -> RowParser backend n a
- pempty :: RowParser backend n a
- por :: RowParser backend n a -> RowParser backend n a -> RowParser backend n a
- pbackend :: RowParser backend Zero backend
- pconsume :: RowParser backend One (ColumnInfo backend, Field backend)
- class FromRow backend n a | a -> n where
- parseRows :: RowParser backend n a -> backend -> [ColumnInfo backend] -> [Row backend] -> Either String [a]
- parseRow :: RowParser backend n a -> backend -> [ColumnInfo backend] -> Row backend -> Either String a
- maybeParser :: forall backend k a. FromRow backend k (Vector k Null) => RowParser backend k a -> RowParser backend k (Maybe a)
Documentation
data RowParser backend :: Nat -> * -> * Source #
A pseudo-monad in which parsing of rows is done. Because it is counting the number of fields consumed, it can't be made an instance of Monad.
papply :: RowParser backend n (a -> b) -> RowParser backend m a -> RowParser backend (n :+ m) b Source #
Equivalent of '(*)'
pbind :: RowParser backend n a -> (a -> RowParser backend m b) -> RowParser backend (n :+ m) b Source #
Equivalent of '(>>=)'.
por :: RowParser backend n a -> RowParser backend n a -> RowParser backend n a Source #
Equivalent of '(|)' from Alternative
.
pconsume :: RowParser backend One (ColumnInfo backend, Field backend) Source #
Return the next column.
class FromRow backend n a | a -> n where Source #
fromRow :: RowParser backend n a Source #
fromRow :: (Generic a, GFromRow backend ReadCon n (Rep a)) => RowParser backend (n :+ Zero) a Source #
FromRow backend One Float Source # | |
FromRow backend One Double Source # | |
FromRow backend One Integer Source # | |
FromRow backend One Int64 Source # | |
FromRow backend One Int32 Source # | |
FromRow backend One Int16 Source # | |
FromRow backend One Int8 Source # | |
FromRow backend One Int Source # | |
FromRow backend One Text Source # | |
FromRow backend One Text Source # | |
FromRow backend One ByteString Source # | |
FromRow backend One ByteString Source # | |
Backend backend => FromRow backend Zero () Source # | |
FromRow backend One Null Source # | |
(FromRow backend k a, FromRow backend k (Vector k Null)) => FromRow backend k (Maybe a) Source # | |
(FromRow backend k (EntityID a), FromRow backend l a, (~) Nat ((:+) k l) i) => FromRow backend i (Entity a) Source # | |
(FromRow backend k (Maybe (EntityID a)), FromRow backend l (Maybe (EntityID b)), (~) Nat ((:+) k l) i) => FromRow backend i (EntityID (FullJoin a b)) Source # | |
(FromRow backend k (EntityID a), FromRow backend l (EntityID b), (~) Nat ((:+) k l) i) => FromRow backend i (EntityID (InnerJoin a b)) Source # | |
(FromRow backend k (Maybe (EntityID a)), FromRow backend l (EntityID b), (~) Nat ((:+) k l) i) => FromRow backend i (EntityID (RightJoin a b)) Source # | |
(FromRow backend k (EntityID a), FromRow backend l (Maybe (EntityID b)), (~) Nat ((:+) k l) i) => FromRow backend i (EntityID (LeftJoin a b)) Source # | |
(FromRow backend k a, FromRow backend l b, (~) Nat ((:+) k l) i) => FromRow backend i (a, b) Source # | |
FromRow backend Zero (Vector Zero a) Source # | |
(FromRow backend k (Maybe a), FromRow backend l (Maybe b), (~) Nat ((:+) k l) i) => FromRow backend i (FullJoin a b) Source # | |
(FromRow backend k a, FromRow backend l b, (~) Nat ((:+) k l) i) => FromRow backend i (InnerJoin a b) Source # | |
(FromRow backend k (Maybe a), FromRow backend l b, (~) Nat ((:+) k l) i) => FromRow backend i (RightJoin a b) Source # | |
(FromRow backend k a, FromRow backend l (Maybe b), (~) Nat ((:+) k l) i) => FromRow backend i (LeftJoin a b) Source # | |
(FromRow backend k a, FromRow backend l b, FromRow backend i c, (~) Nat ((:+) ((:+) k l) i) j) => FromRow backend j (a, b, c) Source # | |
(FromRow backend One a, FromRow backend n (Vector n a)) => FromRow backend (S n) (Vector (S n) a) Source # | |
parseRows :: RowParser backend n a -> backend -> [ColumnInfo backend] -> [Row backend] -> Either String [a] Source #
Try to parse rows given a row parser and the SQL backend.