git.iko.soy/typeable/derive-api-th
on master help sign in
fix
0b4b226odr
src/Derive/API/TH.hs+16−2
@@ -149,5 +149,19 @@ deriveArbitrary t = do
149 tvars = datatypeVars tinfo
149 tvars = datatypeVars tinfo
150#endif
150#endif
151 ctx = AppT (ConT ''Arbitrary) <$> tvars
151 ctx = AppT (ConT ''Arbitrary) <$> tvars
152+ ba = VarE 'genericArbitrary
153+ bs = VarE 'genericShrink
154+ pure [InstanceD Nothing ctx (ConT ''Arbitrary `AppT` datatypeType tinfo)
155+ [ pure $ FunD 'arbitrary [Clause [] (NormalB ba) []]
156+ , pure $ FunD 'shrink [Clause [] (NormalB bs) []] ]
157+ -- (pure )
158+ -- (pure $ ConT ''ToSchema `AppT` datatypeType tinfo)
159+ -- [ funD 'declareNamedSchema $ pure $ clause [] (normalB body) [] ]
160+ -- -- body = AppE (VarE 'genericDeclareNamedSchema) <$>
161+ -- -- appE (pure $ VarE 'derivingOptionsToSchemaOptions) (lift opts)
162+ -- -- pure <$> instanceD
163+ -- -- (pure context)
164+ -- -- (pure $ ConT ''ToSchema `AppT` datatypeType tinfo)
165+ -- -- [ funD 'declareNamedSchema $ pure $ clause [] (normalB body) [] ]
152− decs <- [d| arbitrary = genericArbitrary; shrink = genericShrink |]
166+ -- decs <- [d| arbitrary = genericArbitrary; shrink = genericShrink |]
153− pure [InstanceD Nothing ctx (ConT ''Arbitrary `AppT` datatypeType tinfo) decs]
167+ -- pure [InstanceD Nothing ctx (ConT ''Arbitrary `AppT` datatypeType tinfo) decs]