| Copyright | (c) Dong Han 2017-2020 |
|---|---|
| License | BSD |
| Maintainer | winterland1989@gmail.com |
| Stability | experimental |
| Portability | non-portable |
| Safe Haskell | None |
| Language | Haskell2010 |
Z.Data.Generics.Utils
Description
This module provides a helper class to compute product size via Generic instance, e.g. This class is
useful during JSON deserializing, to decide the array length used to store record KVs.
Synopsis
- class KnownNat (PSize f) => ProductSize (f :: * -> *) where
- productSize :: forall f. KnownNat (PSize f) => Proxy# f -> Int
Documentation
class KnownNat (PSize f) => ProductSize (f :: * -> *) Source #
type class for calculating product size.
Instances
| (KnownNat (PSize a + PSize b), ProductSize a, ProductSize b) => ProductSize (a :*: b) Source # | |
| ProductSize (S1 s a) Source # | |