| Copyright | (c) Marcin Mrotek, 2015 |
|---|---|
| License | BSD3 |
| Maintainer | marcin.jan.mrotek@gmail.com |
| Stability | experimental |
| Safe Haskell | Safe |
| Language | Haskell2010 |
| Extensions |
|
Graphics.QML.DataModel.Internal.Generic.Count
Description
Count the number of columns in a data type.
- data ColumnIndexException
- class CountFields t where
- countFields :: proxy t -> Int
- class GCountFields f where
- gCountFields :: proxy f -> Int
Documentation
data ColumnIndexException Source
Exception thrown when QML tries to acces a column that is not available. Shouldn't really happen.
Constructors
| 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.
Minimal complete definition
Nothing
Methods
countFields :: proxy t -> Int Source
class GCountFields f where Source
Generic implementation of the CountFields class.
Methods
gCountFields :: proxy f -> Int Source
Instances
| GCountFields (* -> *) (K1 i c) Source | A container type has a proxyle 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. |