on decrease-android-validity help sign in
17 lines 508 B history raw
1module Obelisk.Route.TH (deriveRouteComponent) where
3import Data.Constraint.Extras.TH
4import Data.GADT.Show.TH
5import Data.GADT.Compare.TH
6import Data.Universe.Some.TH
7import Language.Haskell.TH
9-- | Derive all the typeclasses needed for a RouteComponent type. The argument should be the name of a type of kind @k -> *@
10deriveRouteComponent :: Name -> Q [Dec]
11deriveRouteComponent x = concat <$> traverse ($ x)
12 [ deriveGShow
13 , deriveGEq
14 , deriveGCompare
15 , deriveUniverseSome
16 , deriveArgDict
17 ]