我正在尝试,Data.Functor.Compose并希望在ghci中尝试时为它编写一个Show实例.我所拥有的(有效)是:
{-# LANGUAGE FlexibleContexts #-}
instance (Show (f (g a))) => Show (Compose f g a) where
show = show . getCompose
Run Code Online (Sandbox Code Playgroud)
我想知道的是:有没有办法在没有FlexibleContexts的情况下编写这个Show实例?