-
-
Save desophos/62603c4a120393b92941f29c60da22a8 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module Instances where | |
import Data.Typeable | |
instance (Typeable a, Typeable b) => Show (a -> b) where | |
showsPrec _ _ = showParen True $ showString "_ :: " . showsTypeRep (typeRep p) | |
where p = Proxy :: Proxy (a -> b) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
test\Instances.hs: line 6, column 73: | |
Error: * Could not deduce (Typeable a0) arising from a use of `typeRep' | |
from the context: (Typeable a, Typeable b) | |
bound by the instance declaration at test\Instances.hs:5:10-50 | |
The type variable `a0' is ambiguous | |
* In the first argument of `showsTypeRep', namely `(typeRep p)' | |
In the second argument of `(.)', namely `showsTypeRep (typeRep p)' | |
In the second argument of `($)', namely | |
`showString "_ :: " . showsTypeRep (typeRep p)' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment