Opened 2 years ago

Last modified 11 months ago

#13933 new bug

Support Typeable instances for types with coercions

Reported by: goldfire Owned by:
Priority: normal Milestone:
Component: Compiler Version: 8.3
Keywords: TypeInType, Typeable Cc:
Operating System: Unknown/Multiple Architecture: Unknown/Multiple
Type of failure: None/Unknown Test Case:
Blocked By: Blocking:
Related Tickets: #13872, #15872 Differential Rev(s):
Wiki Page:


If I say

{-# LANGUAGE GADTs, TypeApplications, TypeInType #-}

module Bug where

import Type.Reflection

data G a where
  MkG :: a ~ Bool => G a

rep = typeRep @MkG

I get

Bug.hs:10:7: error:
    • No instance for (Typeable <>) arising from a use of ‘typeRep’
    • In the expression: typeRep @MkG
      In an equation for ‘rep’: rep = typeRep @MkG
10 | rep = typeRep @MkG

First off, the error message is confusing, mentioning the mysterious <>. But more importantly, it would be nice if the Typeable mechanism supported coercions.

Change History (2)

comment:1 Changed 2 years ago by RyanGlScott

comment:2 Changed 11 months ago by RyanGlScott

See #15872 for a standalone ticket about the pretty-printing issue.

Note: See TracTickets for help on using tickets.