Instances are defined for types in general, and not for individual constructors, so he complains that Fun not a type.
I assume that your common goal is to have a Show instance for A that cannot be inferred because functions cannot (in general) have a Show instance. You have a couple of options:
Write your own instance of Show :
That is, something like:
instance Show A where show (Num n) = "Num " ++ show n show (Fun _ s) = s
In many cases, this makes the most sense. But sometimes it is better to retrieve Show , especially in complex recursive types, where only one case of many is not automatically Show -able.
Print A output:
You can only get Show for types containing types that have instances of Show . There is no instance for A -> A , so the output does not work. But you can write one that uses some kind of placeholder:
instance Show (A -> A) where show _ = "(A -> A)"
Or even an empty string if you want.
Note that this requires an extension of the FlexibleInstances language ; it is one of the safest and most commonly used extensions, supported by several Haskell implementations, and the restrictions that it relaxes are, in my opinion, a little silly to start with, so there is no reason to eliminate it.
An alternative approach would be to have a type of wrapper, as you mentioned in the question. You can even make it more general:
data ShowAs a = ShowAs a String instance Show (ShowAs a) where show (ShowAs _ s) = s
... and then use (ShowAs (A -> A)) in the Fun constructor. This makes it a little inconvenient, forcing you to make an additional template, matching any time you want to use a wrapped type, but it gives you more flexibility to “mark” the material with how it should be displayed, for example. showId = id `ShowAs` "id" or the like.