Skip to content
Snippets Groups Projects
Commit dde5561b authored by Herbert Valerio Riedel's avatar Herbert Valerio Riedel :man_dancing:
Browse files

Restore invariant in `Data (Ratio a)` instance

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

The fix is to add back the `Integral` constraint on the Data
instance (which was dropped in c409b6f3) and to use `%` rather
than `:%` in the `gfoldl` and `gunfold` implementation.

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

This addresses #10011

(cherry picked from commit 79b0d0e6)
parent a993712d
No related branches found
No related tags found
No related merge requests found
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment