1 -- This module deliberately declares orphan instances:
2 {-# OPTIONS_GHC -fno-warn-orphans #-}
3 -----------------------------------------------------------------------------
5 -- Module : Text.Show.Functions
6 -- Copyright : (c) The University of Glasgow 2001
7 -- License : BSD-style (see the file libraries/base/LICENSE)
9 -- Maintainer : libraries@haskell.org
10 -- Stability : provisional
11 -- Portability : portable
13 -- Optional instance of 'Text.Show.Show' for functions:
15 -- > instance Show (a -> b) where
16 -- > showsPrec _ _ = showString \"\<function\>\"
18 -----------------------------------------------------------------------------
20 module Text.Show.Functions () where
25 instance Show (a -> b) where
26 showsPrec _ _ = showString "<function>"
28 instance (Show a,Show b) => Show (a->b) where
29 showsPrec d a = showString "<<function>>"
31 showsType a = showChar '(' . showsType value . showString " -> " .
32 showsType result . showChar ')'
33 where (value,result) = getTypes undefined