derive-storable-0.3.1.0: Derive Storable instances with GHC.Generics.
Safe HaskellSafe-Inferred
LanguageHaskell2010

Foreign.Storable.Generic.Tools.TypeFuns

Documentation

type family SumArity (arg :: * -> *) where ... Source #

Equations

SumArity (M1 C _ t) = 1 
SumArity (M1 _ _ t) = SumArity t 
SumArity (f :+: g) = SumArity f + SumArity g 
SumArity (f :*: g) = SumArity f + SumArity g 
SumArity _ = 0 

type family NoFields (arg :: * -> *) where ... Source #

Equations

NoFields (M1 _ _ t) = NoFields t 
NoFields (f :+: g) = NoFields f + NoFields g 
NoFields (f :*: g) = NoFields f + NoFields g 
NoFields (K1 _ _) = 1 
NoFields _ = 0 

type IsSumType (arg :: * -> *) = IsSumType' (CmpNat (SumArity arg) 1) Source #

type family IsSumType' (ret :: Ordering) :: Bool where ... Source #

Equations

IsSumType' GT = True 
IsSumType' _ = False