Safe Haskell | Safe-Inferred |
---|---|
Language | Haskell2010 |
Test if a data type is an enumeration (only zero-argument constructors) generically using GHC.Generics.
Documentation
isEnum :: forall a. (Generic a, GIsEnum (Rep a)) => Proxy a -> Bool Source #
Generically test if a data type is an enumeration.
class GIsEnum f where Source #
Class for testing if the functors from GHC.Generics are
enumerations. You generally don't need to give any custom
instances. Just call isEnum
.
Instances
GIsEnum Par1 Source # | |
GIsEnum (V1 :: Type -> Type) Source # | |
GIsEnum (U1 :: Type -> Type) Source # | |
GIsEnum (Rec1 f) Source # | |
GIsEnum (K1 i a :: Type -> Type) Source # | |
(GIsEnum f, GIsEnum g) => GIsEnum (f :+: g) Source # | |
(GIsEnum f, GIsEnum g) => GIsEnum (f :*: g) Source # | |
GIsEnum f => GIsEnum (M1 D c f) Source # | |
GIsEnum f => GIsEnum (M1 C c f) Source # | |
GIsEnum (M1 S c a) Source # | |