summaryrefslogtreecommitdiff
path: root/libraries/base/Data/Typeable/Internal.hs
diff options
context:
space:
mode:
Diffstat (limited to 'libraries/base/Data/Typeable/Internal.hs')
-rw-r--r--libraries/base/Data/Typeable/Internal.hs7
1 files changed, 1 insertions, 6 deletions
diff --git a/libraries/base/Data/Typeable/Internal.hs b/libraries/base/Data/Typeable/Internal.hs
index 39974b4052..962f5b82c1 100644
--- a/libraries/base/Data/Typeable/Internal.hs
+++ b/libraries/base/Data/Typeable/Internal.hs
@@ -495,12 +495,7 @@ splitApp (TrTyCon{trTyCon = con, trKindVars = kinds})
-- | Use a 'TypeRep' as 'Typeable' evidence.
withTypeable :: forall k (a :: k) rep (r :: TYPE rep). ()
=> TypeRep a -> (Typeable a => r) -> r
-withTypeable rep k = unsafeCoerce k' rep
- where k' :: Gift a r
- k' = Gift k
-
--- | A helper to satisfy the type checker in 'withTypeable'.
-newtype Gift a (r :: TYPE rep) = Gift (Typeable a => r)
+withTypeable rep k = withDict @(TypeRep a) @(Typeable a) rep k
-- | Pattern match on a type constructor
pattern Con :: forall k (a :: k). ()