GHC issueshttps://gitlab.haskell.org/ghc/ghc/issues2019-11-14T21:14:59Zhttps://gitlab.haskell.org/ghc/ghc/issues/17472Ord1 instance for Down is broken2019-11-14T21:14:59ZVaibhav SagarOrd1 instance for Down is broken## Summary
https://twitter.com/Iceland_jack/status/1193558757122494466
## Steps to reproduce
```haskell
> import Data.Ord
> import Data.Functor.Classes
> compare1 (Down 1) (Down 2)
LT
```
## Expected behavior
```haskell
> compare1 (Down 1) (Down 2)
GT
```
## Environment
* GHC version used: 8.6.5
Optional:
* Operating System: NixOS 19.09
* System Architecture: x86-64## Summary
https://twitter.com/Iceland_jack/status/1193558757122494466
## Steps to reproduce
```haskell
> import Data.Ord
> import Data.Functor.Classes
> compare1 (Down 1) (Down 2)
LT
```
## Expected behavior
```haskell
> compare1 (Down 1) (Down 2)
GT
```
## Environment
* GHC version used: 8.6.5
Optional:
* Operating System: NixOS 19.09
* System Architecture: x86-648.8.2https://gitlab.haskell.org/ghc/ghc/issues/17303Rounding always throws an arithmetic underflow exception when used with a rat...2019-10-04T12:48:41ZtaylorfausakRounding always throws an arithmetic underflow exception when used with a ratio of natural numbersI originally reported this in !1878.
Today I was surprised to find that `round` does not work at all for `Ratio Natural` values. For example:
``` hs
>>> round (1 :: Ratio Natural) :: Natural
*** Exception: arithmetic underflow
```
As far as I can tell it's true regardless of the value of the `Ratio Natural` or the result type.
``` hs
>>> round (1.5 :: Ratio Natural) :: Natural
*** Exception: arithmetic underflow
>>> round (1 :: Ratio Natural) :: Integer
*** Exception: arithmetic underflow
```
For comparison, rounding works fine for `Rational`, which is an alias for `Ratio Integer`.
``` hs
>>> round (1 :: Rational) :: Integer
1
>>> round (1.5 :: Rational) :: Integer
2
>>> round (1 :: Rational) :: Natural
1
```I originally reported this in !1878.
Today I was surprised to find that `round` does not work at all for `Ratio Natural` values. For example:
``` hs
>>> round (1 :: Ratio Natural) :: Natural
*** Exception: arithmetic underflow
```
As far as I can tell it's true regardless of the value of the `Ratio Natural` or the result type.
``` hs
>>> round (1.5 :: Ratio Natural) :: Natural
*** Exception: arithmetic underflow
>>> round (1 :: Ratio Natural) :: Integer
*** Exception: arithmetic underflow
```
For comparison, rounding works fine for `Rational`, which is an alias for `Ratio Integer`.
``` hs
>>> round (1 :: Rational) :: Integer
1
>>> round (1.5 :: Rational) :: Integer
2
>>> round (1 :: Rational) :: Natural
1
```8.8.2