Safe Haskell | None |
---|

- Referring to persistent tables
- toQ
- Unit
- Boolean logic
- Equality and Ordering
- Conditionals
- Maybe
- Either
- List Construction
- List Operations
- Special folds
- Sublists
- Searching Lists
- Zipping and Unzipping Lists
- Set-oriented operations
- Tuple Projection Functions
- Conversions between numeric types
- Rebind Monadic Combinators
- Construction of tuples
- Missing functions

This module is intended to be imported `qualified`

, to avoid name clashes
with Prelude functions. For example:

import qualified Database.DSH as Q import Database.DSH (Q)

Alternatively you can hide Prelude and import this module like this:

import Prelude () import Database.DSH

In this case you still get Prelude definitions that are not provided by Database.DSH.

- table :: (QA a, TA a) => String -> Q [a]
- tableDB :: (QA a, TA a) => String -> Q [a]
- tableWithKeys :: (QA a, TA a) => String -> [[String]] -> Q [a]
- tableCSV :: (QA a, TA a) => String -> Q [a]
- toQ :: QA a => a -> Q a
- unit :: Q ()
- false :: Q Bool
- true :: Q Bool
- not :: Q Bool -> Q Bool
- (&&) :: Q Bool -> Q Bool -> Q Bool
- (||) :: Q Bool -> Q Bool -> Q Bool
- eq :: (QA a, Eq a) => Q a -> Q a -> Q Bool
- (==) :: (QA a, Eq a) => Q a -> Q a -> Q Bool
- neq :: (QA a, Eq a) => Q a -> Q a -> Q Bool
- (/=) :: (QA a, Eq a) => Q a -> Q a -> Q Bool
- lt :: (QA a, Ord a) => Q a -> Q a -> Q Bool
- (<) :: (QA a, Ord a) => Q a -> Q a -> Q Bool
- lte :: (QA a, Ord a) => Q a -> Q a -> Q Bool
- (<=) :: (QA a, Ord a) => Q a -> Q a -> Q Bool
- gte :: (QA a, Ord a) => Q a -> Q a -> Q Bool
- (>=) :: (QA a, Ord a) => Q a -> Q a -> Q Bool
- gt :: (QA a, Ord a) => Q a -> Q a -> Q Bool
- (>) :: (QA a, Ord a) => Q a -> Q a -> Q Bool
- min :: (QA a, Ord a) => Q a -> Q a -> Q a
- max :: (QA a, Ord a) => Q a -> Q a -> Q a
- bool :: QA a => Q a -> Q a -> Q Bool -> Q a
- cond :: QA a => Q Bool -> Q a -> Q a -> Q a
- ifThenElse :: QA a => Q Bool -> Q a -> Q a -> Q a
- (?) :: QA a => Q Bool -> (Q a, Q a) -> Q a
- listToMaybe :: QA a => Q [a] -> Q (Maybe a)
- maybeToList :: QA a => Q (Maybe a) -> Q [a]
- nothing :: QA a => Q (Maybe a)
- just :: QA a => Q a -> Q (Maybe a)
- isNothing :: QA a => Q (Maybe a) -> Q Bool
- isJust :: QA a => Q (Maybe a) -> Q Bool
- fromJust :: QA a => Q (Maybe a) -> Q a
- maybe :: (QA a, QA b) => Q b -> (Q a -> Q b) -> Q (Maybe a) -> Q b
- fromMaybe :: QA a => Q a -> Q (Maybe a) -> Q a
- catMaybes :: QA a => Q [Maybe a] -> Q [a]
- mapMaybe :: (QA a, QA b) => (Q a -> Q (Maybe b)) -> Q [a] -> Q [b]
- pairToEither :: (QA a, QA b) => Q ([a], [b]) -> Q (Either a b)
- eitherToPair :: (QA a, QA b) => Q (Either a b) -> Q ([a], [b])
- left :: (QA a, QA b) => Q a -> Q (Either a b)
- right :: (QA a, QA b) => Q b -> Q (Either a b)
- isLeft :: (QA a, QA b) => Q (Either a b) -> Q Bool
- isRight :: (QA a, QA b) => Q (Either a b) -> Q Bool
- either :: (QA a, QA b, QA c) => (Q a -> Q c) -> (Q b -> Q c) -> Q (Either a b) -> Q c
- lefts :: (QA a, QA b) => Q [Either a b] -> Q [a]
- rights :: (QA a, QA b) => Q [Either a b] -> Q [b]
- partitionEithers :: (QA a, QA b) => Q [Either a b] -> Q ([a], [b])
- nil :: QA a => Q [a]
- empty :: QA a => Q [a]
- cons :: QA a => Q a -> Q [a] -> Q [a]
- (<|) :: QA a => Q a -> Q [a] -> Q [a]
- snoc :: QA a => Q [a] -> Q a -> Q [a]
- (|>) :: QA a => Q [a] -> Q a -> Q [a]
- singleton :: QA a => Q a -> Q [a]
- head :: QA a => Q [a] -> Q a
- tail :: QA a => Q [a] -> Q [a]
- take :: QA a => Q Integer -> Q [a] -> Q [a]
- drop :: QA a => Q Integer -> Q [a] -> Q [a]
- map :: (QA a, QA b) => (Q a -> Q b) -> Q [a] -> Q [b]
- append :: QA a => Q [a] -> Q [a] -> Q [a]
- (++) :: QA a => Q [a] -> Q [a] -> Q [a]
- filter :: QA a => (Q a -> Q Bool) -> Q [a] -> Q [a]
- groupWithKey :: (QA a, QA b, Ord b) => (Q a -> Q b) -> Q [a] -> Q [(b, [a])]
- groupWith :: (QA a, QA b, Ord b) => (Q a -> Q b) -> Q [a] -> Q [[a]]
- sortWith :: (QA a, QA b, Ord b) => (Q a -> Q b) -> Q [a] -> Q [a]
- last :: QA a => Q [a] -> Q a
- init :: QA a => Q [a] -> Q [a]
- null :: QA a => Q [a] -> Q Bool
- length :: QA a => Q [a] -> Q Integer
- index :: QA a => Q [a] -> Q Integer -> Q a
- (!!) :: QA a => Q [a] -> Q Integer -> Q a
- reverse :: QA a => Q [a] -> Q [a]
- and :: Q [Bool] -> Q Bool
- or :: Q [Bool] -> Q Bool
- any :: QA a => (Q a -> Q Bool) -> Q [a] -> Q Bool
- all :: QA a => (Q a -> Q Bool) -> Q [a] -> Q Bool
- sum :: (QA a, Num a) => Q [a] -> Q a
- concat :: QA a => Q [[a]] -> Q [a]
- concatMap :: (QA a, QA b) => (Q a -> Q [b]) -> Q [a] -> Q [b]
- maximum :: (QA a, Ord a) => Q [a] -> Q a
- minimum :: (QA a, Ord a) => Q [a] -> Q a
- splitAt :: QA a => Q Integer -> Q [a] -> Q ([a], [a])
- takeWhile :: QA a => (Q a -> Q Bool) -> Q [a] -> Q [a]
- dropWhile :: QA a => (Q a -> Q Bool) -> Q [a] -> Q [a]
- span :: QA a => (Q a -> Q Bool) -> Q [a] -> Q ([a], [a])
- break :: QA a => (Q a -> Q Bool) -> Q [a] -> Q ([a], [a])
- elem :: (QA a, Eq a) => Q a -> Q [a] -> Q Bool
- notElem :: (QA a, Eq a) => Q a -> Q [a] -> Q Bool
- lookup :: (QA a, QA b, Eq a) => Q a -> Q [(a, b)] -> Q (Maybe b)
- zip :: (QA a, QA b) => Q [a] -> Q [b] -> Q [(a, b)]
- zipWith :: (QA a, QA b, QA c) => (Q a -> Q b -> Q c) -> Q [a] -> Q [b] -> Q [c]
- unzip :: (QA a, QA b) => Q [(a, b)] -> Q ([a], [b])
- zip3 :: (QA a, QA b, QA c) => Q [a] -> Q [b] -> Q [c] -> Q [(a, b, c)]
- zipWith3 :: (QA a, QA b, QA c, QA d) => (Q a -> Q b -> Q c -> Q d) -> Q [a] -> Q [b] -> Q [c] -> Q [d]
- unzip3 :: (QA a, QA b, QA c) => Q [(a, b, c)] -> Q ([a], [b], [c])
- nub :: (QA a, Eq a) => Q [a] -> Q [a]
- fst :: (QA a, QA b) => Q (a, b) -> Q a
- snd :: (QA a, QA b) => Q (a, b) -> Q b
- integerToDouble :: Q Integer -> Q Double
- return :: QA a => Q a -> Q [a]
- (>>=) :: (QA a, QA b) => Q [a] -> (Q a -> Q [b]) -> Q [b]
- (>>) :: (QA a, QA b) => Q [a] -> Q [b] -> Q [b]
- mzip :: (QA a, QA b) => Q [a] -> Q [b] -> Q [(a, b)]
- guard :: Q Bool -> Q [()]
- pair :: (QA a, QA b) => Q a -> Q b -> Q (a, b)
- triple :: (QA a, QA b, QA c) => Q a -> Q b -> Q c -> Q (a, b, c)
- tuple7 :: forall a b c d e f g. (QA a, QA b, QA c, QA d, QA e, QA f, QA g) => Q a -> Q b -> Q c -> Q d -> Q e -> Q f -> Q g -> Q ((,,,,,,) a b c d e f g)
- tuple6 :: forall a b c d e f. (QA a, QA b, QA c, QA d, QA e, QA f) => Q a -> Q b -> Q c -> Q d -> Q e -> Q f -> Q ((,,,,,) a b c d e f)
- tuple5 :: forall a b c d e. (QA a, QA b, QA c, QA d, QA e) => Q a -> Q b -> Q c -> Q d -> Q e -> Q ((,,,,) a b c d e)
- tuple4 :: forall a b c d. (QA a, QA b, QA c, QA d) => Q a -> Q b -> Q c -> Q d -> Q ((,,,) a b c d)
- tuple3 :: forall a b c. (QA a, QA b, QA c) => Q a -> Q b -> Q c -> Q ((,,) a b c)
- tuple2 :: forall a b. (QA a, QA b) => Q a -> Q b -> Q ((,) a b)
- data Q a
- class Reify (Rep a) => QA a
- class (QA a, QA r) => Elim a r where
- class View a where
- view :: a -> ToView a

- deriveDSH :: Name -> Q [Dec]
- deriveQA :: Name -> Q [Dec]
- deriveTupleRangeQA :: Int -> Int -> Q [Dec]
- deriveView :: Name -> Q [Dec]
- deriveTupleRangeView :: Int -> Int -> Q [Dec]
- deriveElim :: Name -> Q [Dec]
- deriveSmartConstructors :: Name -> Q [Dec]
- deriveTupleRangeSmartConstructors :: Int -> Int -> Q [Dec]
- module Data.String
- module Data.Text
- module Database.HDBC
- module Prelude

# Referring to persistent tables

# toQ

# Unit

# Boolean logic

# Equality and Ordering

# Conditionals

# Maybe

# Either

# List Construction

# List Operations

# Special folds

# Sublists

# Searching Lists

# Zipping and Unzipping Lists

zipWith3 :: (QA a, QA b, QA c, QA d) => (Q a -> Q b -> Q c -> Q d) -> Q [a] -> Q [b] -> Q [c] -> Q [d]Source

# Set-oriented operations

# Tuple Projection Functions

# Conversions between numeric types

# Rebind Monadic Combinators

# Construction of tuples

tuple7 :: forall a b c d e f g. (QA a, QA b, QA c, QA d, QA e, QA f, QA g) => Q a -> Q b -> Q c -> Q d -> Q e -> Q f -> Q g -> Q ((,,,,,,) a b c d e f g)Source

tuple6 :: forall a b c d e f. (QA a, QA b, QA c, QA d, QA e, QA f) => Q a -> Q b -> Q c -> Q d -> Q e -> Q f -> Q ((,,,,,) a b c d e f)Source

tuple5 :: forall a b c d e. (QA a, QA b, QA c, QA d, QA e) => Q a -> Q b -> Q c -> Q d -> Q e -> Q ((,,,,) a b c d e)Source

tuple4 :: forall a b c d. (QA a, QA b, QA c, QA d) => Q a -> Q b -> Q c -> Q d -> Q ((,,,) a b c d)Source

# Missing functions

This module offers most of the functions on lists given in PreludeList for the
`Q`

type. Missing functions are:

General folds:

foldl foldl1 scanl scanl1 foldr foldr1 scanr scanr1

Infinit lists:

iterate repeat cycle

String functions:

lines words unlines unwords

Fractional (Q Double) | |

Num (Q Double) | |

Num (Q Integer) | |

IsString (Q Text) | |

View (Q Bool) | |

View (Q Char) | |

View (Q Double) | |

View (Q Integer) | |

View (Q ()) | |

(QA a, QA b) => View (Q (a, b)) | |

(QA a, QA b, QA c) => View (Q (a, b, c)) | |

(QA a0, QA b0, QA c0, QA d0) => View (Q (a0, b0, c0, d0)) | |

(QA a0, QA b0, QA c0, QA d0, QA e0) => View (Q (a0, b0, c0, d0, e0)) | |

(QA a0, QA b0, QA c0, QA d0, QA e0, QA f0) => View (Q (a0, b0, c0, d0, e0, f0)) | |

(QA a0, QA b0, QA c0, QA d0, QA e0, QA f0, QA g0) => View (Q (a0, b0, c0, d0, e0, f0, g0)) | |

View (Q Text) |

class Reify (Rep a) => QA a Source

QA Bool | |

QA Char | |

QA Double | |

QA Integer | |

QA () | |

QA Text | |

(Reify (Rep [a]), QA a) => QA [a] | |

(Reify (Rep (Maybe a)), QA a) => QA (Maybe a) | |

(Reify (Rep (Either a b)), QA a, QA b) => QA (Either a b) | |

(Reify (Rep (a, b)), QA a, QA b) => QA (a, b) | |

(Reify (Rep (a, b, c)), QA a, QA b, QA c) => QA (a, b, c) | |

(Reify (Rep (a0, b0, c0, d0)), QA a0, QA b0, QA c0, QA d0) => QA (a0, b0, c0, d0) | |

(Reify (Rep (a0, b0, c0, d0, e0)), QA a0, QA b0, QA c0, QA d0, QA e0) => QA (a0, b0, c0, d0, e0) | |

(Reify (Rep (a0, b0, c0, d0, e0, f0)), QA a0, QA b0, QA c0, QA d0, QA e0, QA f0) => QA (a0, b0, c0, d0, e0, f0) | |

(Reify (Rep (a0, b0, c0, d0, e0, f0, g0)), QA a0, QA b0, QA c0, QA d0, QA e0, QA f0, QA g0) => QA (a0, b0, c0, d0, e0, f0, g0) |

class (QA a, QA r) => Elim a r whereSource

(QA Bool, QA r) => Elim Bool r | |

(QA Char, QA r) => Elim Char r | |

(QA Double, QA r) => Elim Double r | |

(QA Integer, QA r) => Elim Integer r | |

(QA (), QA r) => Elim () r | |

(QA Text, QA r) => Elim Text r | |

(QA (Maybe a), QA a, QA r) => Elim (Maybe a) r | |

(QA (Either a b), QA a, QA b, QA r) => Elim (Either a b) r | |

(QA (a, b), QA a, QA b, QA r) => Elim (a, b) r |

View (Q Bool) | |

View (Q Char) | |

View (Q Double) | |

View (Q Integer) | |

View (Q ()) | |

(QA a, QA b) => View (Q (a, b)) | |

(QA a, QA b, QA c) => View (Q (a, b, c)) | |

(QA a0, QA b0, QA c0, QA d0) => View (Q (a0, b0, c0, d0)) | |

(QA a0, QA b0, QA c0, QA d0, QA e0) => View (Q (a0, b0, c0, d0, e0)) | |

(QA a0, QA b0, QA c0, QA d0, QA e0, QA f0) => View (Q (a0, b0, c0, d0, e0, f0)) | |

(QA a0, QA b0, QA c0, QA d0, QA e0, QA f0, QA g0) => View (Q (a0, b0, c0, d0, e0, f0, g0)) | |

View (Q Text) |

deriveView :: Name -> Q [Dec]Source

deriveElim :: Name -> Q [Dec]Source

deriveSmartConstructors :: Name -> Q [Dec]Source

module Data.String

module Data.Text

module Database.HDBC

module Prelude