Skip to content
GitLab
Projects Groups Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
  • Sign in / Register
  • GHC GHC
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
    • Locked Files
  • Issues 5,400
    • Issues 5,400
    • List
    • Boards
    • Service Desk
    • Milestones
    • Iterations
  • Merge requests 590
    • Merge requests 590
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
    • Test Cases
  • Deployments
    • Deployments
    • Releases
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Code review
    • Insights
    • Issue
    • Repository
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • Glasgow Haskell CompilerGlasgow Haskell Compiler
  • GHCGHC
  • Issues
  • #10011
Closed
Open
Issue created Jan 20, 2015 by Edward Kmett@ekmett

The Data instance for Ratio violates internal invariants.

I found this when Simon was cleaning up unused dependencies in

https://phabricator.haskell.org/rGHCc409b6f30373535b6eed92e55d4695688d32be9e#10730

The Data instance for Ratio just uses the raw (:%) constructor and doesn't check that the result is reduced to normal form.

It strikes me that the fix is to add back the Integral constraint on the Data instance and to use (%) rather than (:%) in the gfoldl and gunfold code.

This restores the invariant and matches the behavior of "virtual constructors" we've used to patch up such problems elsewhere.

Edited Mar 10, 2019 by Edward Kmett
To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information
Assignee
Assign to
Time tracking