projects
/
ghc-base.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
f6ed39f
)
nhc98 version of instance Show (a->b) copied from Prelude
author
Malcolm.Wallace@cs.york.ac.uk
<unknown>
Thu, 24 May 2007 16:06:15 +0000
(16:06 +0000)
committer
Malcolm.Wallace@cs.york.ac.uk
<unknown>
Thu, 24 May 2007 16:06:15 +0000
(16:06 +0000)
Text/Show/Functions.hs
patch
|
blob
|
history
diff --git
a/Text/Show/Functions.hs
b/Text/Show/Functions.hs
index
d0e2207
..
315d4d3
100644
(file)
--- a/
Text/Show/Functions.hs
+++ b/
Text/Show/Functions.hs
@@
-22,4
+22,12
@@
import Prelude
#ifndef __NHC__
instance Show (a -> b) where
showsPrec _ _ = showString "<function>"
+#else
+instance (Show a,Show b) => Show (a->b) where
+ showsPrec d a = showString "<<function>>"
+
+ showsType a = showChar '(' . showsType value . showString " -> " .
+ showsType result . showChar ')'
+ where (value,result) = getTypes undefined
+ getTypes x = (x,a x)
#endif