Giter Site home page Giter Site logo

Comments (2)

snowleopard avatar snowleopard commented on June 22, 2024

I'd say this is the right behaviour. Your instance Show breaks the unstated (but generally agreed upon) requirement for Show instances: if show x == s then it must be possible to feed s to a Haskell compiler and obtain x back. This might seem like a strange requirement, but it's very useful when you want to show a Haskell expression and use the result as a real Haskell code.

This requirement is often violated, but I'd advise against this, because some useful libraries (for example, Facebook's Haxl) rely on it to generate Haskell code.

Note that a consequence of this requirement is that show should be an injective (or one-to-one) function, which guarantees that this issue will not occur.

If you want to obtain the second graph, you need to use the export function instead, where you are in full control of how labels are assigned.

from alga.

snowleopard avatar snowleopard commented on June 22, 2024

@jmtd I'm convinced the current behaviour is correct, so I'm closing this issue. Feel free to reopen if you'd like to argue that something should be changed.

from alga.

Related Issues (20)

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.