Giter VIP home page Giter VIP logo

Comments (5)

mboes avatar mboes commented on June 30, 2024

Unfortunate BC breaking in GHC 8.4. Do you know what is causing it? I tried enabling TypeSynonymInstances but even then it's giving the same error.

It would be very convenient to be able to continue writing the instances inside the withStatic block as-is.

from distributed-closure.

mpickering avatar mpickering commented on June 30, 2024

Ryan Scott told me that the problem is because of https://ghc.haskell.org/trac/ghc/ticket/13267

from distributed-closure.

RyanGlScott avatar RyanGlScott commented on June 30, 2024

Thankfully, the workaround is fairly simple: just don't generate instance Serializable SerializableInt! (It wasn't doing anything before anyways, since Serializable is a type synonym, not a class.)

from distributed-closure.

mboes avatar mboes commented on June 30, 2024

OK in that case, I propose the following change. Instead of

type Serializable a = (Binary a, Typeable a)

have

class (Binary a, Typeable a) => Serializable a
instance (Binary a, Typeable a) => Serializable a

If we do that, then we don't have a constraint synonym anymore, thus working around the fact that GHC doesn't support defining instances for those anymore. @mpickering @RyanGlScott might either of you have any thoughts about the downsides of such an alternative definition?

from distributed-closure.

RyanGlScott avatar RyanGlScott commented on June 30, 2024

That would also work fine. As far as downsides go:

  1. It's yet another class that you have to generate code for to accommodate. (With the type synonym version, you don't have to generate any extra code in order to use it.)
  2. It requires defining a flexible, undecidable catch-all instance to use, which you may or may not find appealing depending on your tastes.

tl;dr You can't go wrong with either version, so pick which one suits you better.

from distributed-closure.

Related Issues (12)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.