Ok, sorry about that.
A common rendering of floating point numbers is not recognized by the Read instance.
Prelude> read "500.0" :: Double
500.0
Prelude> read "500" :: Double
500.0
Prelude> read "500." :: Double
*** Exception: Prelude.read: no parse
Prelude> read "500." :: Double
500.0
A common rendering of floating point numbers is not recognized by the Read instance.
Prelude> read "500.0" :: Double
500.0
Prelude> read "500" :: Double
500.0
Prelude> read "500." :: Double
*** Exception: Prelude.read: no parse
Prelude> read "500." :: Double
500.0
I mean, if you add the constraints it still crashes ghc-9.2.2 but the correct output becomes nothing.
It worked in ghc-8.6.5 and in head it does give a type error. I think if you add the constraints it requests it works.
Seems to be fixed in head.
The code is derived from the -ddump-deriv
output of deriving instance Ord (Op a)
.
The file below produces a panic on ghc-9.2.2:
import Data.Map
type family IxValue (m :: *) :: *
type family Index (m :: *) :: *
data Op a where
Insert :: (a ~ Map (Index a) (IxValue a)) => (Int, Index a, IxValue a) -> Op a
instance Ord a => Ord (Op a) where
compare (Insert a1) (Insert b1) = compare a1 b1
Sorry I don't have access to head right now.