Looking for the “Derive through newtype” proposal


Looking for the “Derive through newtype” proposal

I remember reading a GHC proposal for letting users derive instances by wrapping the type in a newtype. It would go something like this:

newtype Apply f a = Apply f a instance (Applicative f, Monoid a) => Monoid (Apply f a) ... data Foo a = ... deriving Monoid through Apply instance Applicative Foo ... 

I think that Icelandjack had made this proposal, but I cannot find it anywhere on the GHC proposals github. Does anyone know where this is?

Submitted August 10, 2017 at 09:51PM by andrewthad
via reddit http://ift.tt/2wxzZ0j

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s