Skip to content

Instantly share code, notes, and snippets.

@desophos
Created February 5, 2021 02:55
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save desophos/62603c4a120393b92941f29c60da22a8 to your computer and use it in GitHub Desktop.
Save desophos/62603c4a120393b92941f29c60da22a8 to your computer and use it in GitHub Desktop.
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)
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