Future of "Text.Show.Functions" module

Herbert Valerio Riedel hvr at gnu.org
Sun Oct 19 10:20:23 UTC 2014


Hello *,

I noticed the following module (trimmed for brevitiy) hiding in `base`:


  -- This module deliberately declares orphan instances:
  {-# OPTIONS_GHC -fno-warn-orphans #-}
  
  -- | Optional instance of 'Text.Show.Show' for functions:
  --
  -- > instance Show (a -> b) where
  -- >    showsPrec _ _ = showString \"\<function\>\"
  --
  -----------------------------------------------------------------------------
   
  module Text.Show.Functions () where
   
  instance Show (a -> b) where
          showsPrec _ _ = showString "<function>"


However, I consider this a questionable module to be in `base` due to
its deliberate use of orphan instances.  Should this module be
deprecated, removed, alternatively, should the `Show` instance be made a
non-orphan (e.g. by importing it by the `Prelude` module), or shall this
curiousity be just left untouched in `base` in its current form?

Cheers,
  hvr


More information about the Libraries mailing list