Copyright | (c) Marcin Mrotek, 2015 |
---|---|
License | BSD3 |
Maintainer | marcin.jan.mrotek@gmail.com |
Stability | experimental |
Safe Haskell | Safe |
Language | Haskell2010 |
Extensions |
|
Count the number of columns in a data type.
- data ColumnIndexException
- class CountFields t where
- countFields :: sing t -> Int
- class GCountFields f where
- gCountFields :: f a -> Int
Documentation
data ColumnIndexException Source
Exception thrown when QML tries to acces a column that is not available. Shouldn't really happen.
ColumnIndexNegative Int | QML called for a negative column index. |
ColumnIndexOutOfBounds Int Int | QML called for a column index that is too high. |
class CountFields t where Source
A class of types that have a specific number of fields. Generic implementation is provided for all purely product types.
Nothing
countFields :: sing t -> Int Source
class GCountFields f where Source
Generic implementation of the CountFields
class.
gCountFields :: f a -> Int Source
GCountFields * (K1 i c) Source | A container type has a single column. |
(GCountFields * a, GCountFields * b) => GCountFields * ((:*:) a b) Source | A product type's number of columns is a sum of the terms' column numbers. |
GCountFields * f => GCountFields * (M1 i t f) Source | Meta information is skipped, and the recursion proceeds further down. |