legacy-old-hercules icon indicating copy to clipboard operation
legacy-old-hercules copied to clipboard

Split code that's not generated in Hercules.Database

Open domenkozar opened this issue 9 years ago • 6 comments

For example:

instance ElmType Project where

Or check if upstream provides a way to add extra instances for each type.

domenkozar avatar Nov 10 '16 10:11 domenkozar

@expipiplus1 do you think we could use something like https://github.com/ndmitchell/derive to separate deriving things?

domenkozar avatar Dec 31 '16 19:12 domenkozar

I think all that we need to derive can be done with template Haskell or ghc-mod at the moment. Was their anything you had in mind?

expipiplus1 avatar Jan 03 '17 18:01 expipiplus1

Yes, deriving Generic, ToJSON and others could be done with template Haskell. I'm not sure what other changes we did, but we can diff :)

domenkozar avatar Jan 03 '17 18:01 domenkozar

Oh, do you mean the deriving in the generated Database files?

On Tue, 3 Jan 2017 at 18:17 Domen Kožar [email protected] wrote:

Yes, deriving Generic, ToJSON and others could be done with template Haskell. I'm not sure what other changes we did, but we can diff :)

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/hercules-ci/hercules/issues/1#issuecomment-270183151, or mute the thread https://github.com/notifications/unsubscribe-auth/AA0U3B1f4UO4Nw0wgocZRJVp18oRudZfks5rOpCzgaJpZM4KufeF .

expipiplus1 avatar Jan 03 '17 18:01 expipiplus1

Yes, since opaleye-gen does add Generic instances, we'd have to derive them in separate file. Seems like https://github.com/ndmitchell/derive can do that for use using TH.

domenkozar avatar Jan 03 '17 18:01 domenkozar

the documentation for opaleye-gen recommends using it as a starting point for further modification, and not as a tool to be run on every db update. Just putting that here, we don't have to do it that way.

expipiplus1 avatar Jan 21 '17 16:01 expipiplus1