ifcxt icon indicating copy to clipboard operation
ifcxt copied to clipboard

Typeable instances aren't found

Open Warbo opened this issue 9 years ago • 3 comments

mkIfCxtInstances ''Typeable doesn't seem to find any instances of Typeable, which in turn means the cxtShowTypeable example doesn't work:

> :t typeRep
typeRep :: Typeable a => proxy a -> TypeRep
> typeRep [id :: Int -> Int]
Int -> Int
> cxtShowTypeable (id :: Int -> Int)
"<<unshowable>>"

Presumably this is due to Typeable's deriving-only property, which might be hard/impossible to work around. Either way, I think the example should be removed, since it gives the impression that ifcxt can look up Typeable, and caused me much head-scratching when I kept getting the else branch in my code.

Warbo avatar Jan 26 '16 13:01 Warbo

Which version of ghc are you using? This was working for me on 7.10.2.

mikeizbicki avatar Feb 02 '16 19:02 mikeizbicki

This doesn't work for me on 8.6.5.

endgame avatar Dec 23 '19 03:12 endgame

Newer versions of GHC have changed the interface to Typeable, so unfortunately it won't work. It shouldn't be much work to add support for these newer versions, but I don't think the package has enough userbase to justify the effort for me personally.

mikeizbicki avatar Dec 23 '19 17:12 mikeizbicki