| Safe Haskell | None |
|---|---|
| Language | Haskell2010 |
Data.Record.Encode.Generics
Documentation
gindex :: SOP f xs -> Int Source #
Compute the structural index of a value of a sum type via its Generic representation e.g.:
>>>data S = Sa | Sb | Sc deriving (Eq, Show, G.Generic)>>>instance Generic S
>>>gindex $ from Sb1