GHC Generics - VideoChat

Welcome to the Functional Programming Zulip Chat Archive. You can join the chat here.

TheMatten

Are you interested in having call today? Or maybe next weekend

Sridhar Ratnakumar

I missed yesterday's call. But I'd be interested in this. I don't know much about Generics (aside from deriving Generics you add to your types :P ).

TheMatten

@Sridhar Ratnakumar Cool! What time would work for you? (and for others of course)

Sridhar Ratnakumar

I'm free now, and for next 8 hours maybe (with exception of cooking). Let me know a bit ahead.

Lysxia

This sounds like fun. I might join in. (Anytime of the day EST.)

TheMatten

Great - @Avi Dessauer, @Georgi Lyubenov // googleson78, @Hazem, what do you think?

Hazem

I can join any time today, but I'm tuning in to Chris Penner's optics stream at 8 PM UTC
https://twitter.com/chrislpenner/status/1251587232869126144

TheMatten

@Hazem I'll have to end before 8PM anyway - it's pretty late there in CEST

TheMatten

I guess I would propose 4PM UTC - what do you think?

Sridhar Ratnakumar

I joined. Saw someone speak before they left.

TheMatten

@Sridhar Ratnakumar We'll probably create new call here

TheMatten

Click to join video call

Join a WebRTC video conference powered by the Jitsi Videobridge
Sridhar Ratnakumar

Very useful @TheMatten. I'm dropping now (heading out of home).

TheMatten

Thank you guys for great discussion!
Next time we can maybe look into actual use of information in M1 and implement some more interesting examples
@Lysxia you could maybe show us some of your work that uses Generics in real world libraries :slight_smile:
And maybe we can get @kcsongor to talk about generic-{optics, lens} too :big_smile:

TheMatten

Later, if anyone's interested, I guess we could look into Data and syb library for generic recursive transformations

TheMatten

@Asad Saeeduddin You mentioned that you have some question that you would like to discuss on Zulip if I remember right

Asad Saeeduddin

Yes. The question I had was how to deal with recursive structures and metadata. When we are writing typeclasses, should we "pattern match" on a metadata layer alongside whatever case the instance is currently dealing with all at once, or should we have separate instances for metadata layers and "structure" layers?

Asad Saeeduddin

btw, do you have the code snippets you discussed in the presentation online somewhere for future reference?

TheMatten

It depends on usecase I guess - In that example we did, we didn't actually care about any of the meta information, so we did one "catch-all" case for M1. If we cared about all D1, C1, S1, we could match them all separately, doing specific things in their instances. Though often you may only care about one of them - then it may make sense to e.g. have overlappable M1 instance and specific instance for case we care about.

TheMatten

(I'm currently annotating that example - will put link there once I finish it)

Sridhar Ratnakumar

TheMatten said:

Later, if anyone's interested, I guess we could look into Data and syb library for generic recursive transformations

How does that relate to the uniplate library? cf. https://haskell.zettel.page/2014101.html

TheMatten

They server similar purpose, just using different representation AFAIK - syb has advantage of being part of core libraries, but we can look into uniplate instead if you want

Sridhar Ratnakumar

Is this a correct assessment?

  • Generic for types of kind Type
  • Generic1 for types of kind Type -> Type
  • kind-generics for arbitrary kinds

kind-generics should handle GADTs; meanwhile we have to workaround it using something like https://github.com/obsidiansystems/aeson-gadt-th

Template Haskell for generating ToJSON and FromJSON instances for GADTs - obsidiansystems/aeson-gadt-th
Sridhar Ratnakumar

What's preventing us from using kind-generics today?

gilmi

Re uniplate: you might be interested in something I got working after getting help from some of the nice people here - generic-plate:
https://gitlab.com/gilmi/generic-plate
This is pre-alpha quality though :)

Implementing uniplate combinators using GHC Generics
TheMatten

Hi people! Would same time work for you today? (4PM UTC)

Bolt

I might be able to find time! :D

Lysxia

Is it now? Where is it?

TheMatten

@Lysxia It's in half an hour :slight_smile:

Lysxia

Oooooh silly me. Thanks!

TheMatten

Click to join video call

Join a WebRTC video conference powered by the Jitsi Videobridge
TheMatten

Thank you guys for coming!