# Deriving instances for GADTs

Eq, Ord, Show can be derived using the

`StandaloneDeriving`

extension (implicitly using the`stock`

deriving strategy).To derive instances for

`Some f`

(where`f`

is your GADT), as well as`DSum f g`

, you will need to use the following libraries :`some`

and`dependent-sum`

- for deriving GEq, GShow, GCompare`aeson-gadt-th`

- for deriving JSON instances- Use this in conjunction with
`dependent-sum-aeson-orphans`

to get instances for`ToJSON (Some f)`

- Use this in conjunction with

The

`kind-generics`

package generalizes the approach of`GHC.Generics`

to GADTs.